{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/logbrew/json-schema/logbrew-issue-correction-verification-response-schema.json",
  "title": "IssueCorrectionVerificationResponse",
  "description": "One bounded correction-verification snapshot for humans and software agents.",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/logbrew-openapi.json#/components/schemas/IssueCorrectionVerificationResponse",
  "properties": {
    "absence_is_proof": {
      "description": "False in every response: absence during a bounded window is never proof of correction.",
      "type": "boolean"
    },
    "baseline_occurrence_id": {
      "description": "Exact retained failing occurrence supplied by the caller.",
      "format": "uuid",
      "type": "string"
    },
    "baseline_release": {
      "description": "Release captured on the exact failing occurrence.",
      "type": "string"
    },
    "candidate_deployment": {
      "$ref": "#/$defs/InvestigationDeploymentResponse",
      "description": "Exact successful candidate deployment in the same environment and service."
    },
    "causality": {
      "$ref": "#/$defs/InvestigationCausalityStatus",
      "description": "Deployment and telemetry correlation never independently prove a correction or cause."
    },
    "evidence": {
      "$ref": "#/$defs/InvestigationEvidenceCoverageResponse",
      "description": "Explicit captured and unavailable evidence receipt."
    },
    "first_recurrence": {
      "anyOf": [
        {
          "$ref": "#/$defs/IssueInvestigationReappearedOccurrenceResponse"
        },
        {
          "type": "null"
        }
      ],
      "description": "Earliest server-ingested recurrence in the candidate scope."
    },
    "issue_id": {
      "description": "Stable grouped issue identifier.",
      "format": "uuid",
      "type": "string"
    },
    "next_action": {
      "$ref": "#/$defs/IssueCorrectionVerificationNextAction",
      "description": "Stable highest-value continuation for this snapshot."
    },
    "observed_after": {
      "description": "Exclusive server-ingestion lower bound equal to candidate deployment completion.",
      "format": "date-time",
      "type": "string"
    },
    "observed_until": {
      "description": "Inclusive request-time upper bound for this stable snapshot.",
      "format": "date-time",
      "type": "string"
    },
    "project_id": {
      "description": "Owning project identifier.",
      "format": "uuid",
      "type": "string"
    },
    "recurrence_count": {
      "description": "Exact retained same-issue recurrence count, or null when unavailable.",
      "format": "uint64",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "recurrence_status": {
      "$ref": "#/$defs/InvestigationAvailabilityStatus",
      "description": "Whether the same-issue recurrence read succeeded."
    },
    "retained_telemetry_only": {
      "description": "True in every response: only telemetry retained and readable at request time is evaluated.",
      "type": "boolean"
    },
    "schema_version": {
      "description": "Additive response schema version.",
      "format": "uint8",
      "maximum": 255,
      "minimum": 0,
      "type": "integer"
    },
    "status": {
      "$ref": "#/$defs/IssueCorrectionVerificationStatus",
      "description": "Evidence-only conclusion at the exact observation boundary."
    },
    "trace_health": {
      "anyOf": [
        {
          "$ref": "#/$defs/ReleaseTraceHealthResponse"
        },
        {
          "type": "null"
        }
      ],
      "description": "Exact trace health when the optional read succeeded."
    },
    "trace_health_status": {
      "$ref": "#/$defs/InvestigationAvailabilityStatus",
      "description": "Post-deployment candidate-release trace population."
    }
  },
  "required": [
    "schema_version",
    "status",
    "issue_id",
    "project_id",
    "baseline_occurrence_id",
    "baseline_release",
    "candidate_deployment",
    "observed_after",
    "observed_until",
    "recurrence_status",
    "recurrence_count",
    "first_recurrence",
    "trace_health_status",
    "trace_health",
    "causality",
    "absence_is_proof",
    "retained_telemetry_only",
    "evidence",
    "next_action"
  ],
  "type": "object",
  "$defs": {
    "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"
        }
      ]
    },
    "InvestigationDeploymentResponse": {
      "description": "One completed deployment boundary reused by investigation contracts.",
      "properties": {
        "commit_sha": {
          "description": "Lowercase source commit identity when captured.",
          "type": [
            "string",
            "null"
          ]
        },
        "deployment_id": {
          "description": "Caller-owned external deployment identifier.",
          "type": "string"
        },
        "environment": {
          "description": "Exact deployment environment.",
          "type": "string"
        },
        "finished_at": {
          "description": "Inclusive deployment-attempt finish.",
          "format": "date-time",
          "type": "string"
        },
        "release": {
          "description": "Exact deployed release.",
          "type": "string"
        },
        "service_name": {
          "description": "Exact logical service.",
          "type": "string"
        },
        "started_at": {
          "description": "Inclusive deployment-attempt start.",
          "format": "date-time",
          "type": "string"
        },
        "status": {
          "description": "Terminal deployment result.",
          "type": "string"
        }
      },
      "required": [
        "deployment_id",
        "release",
        "environment",
        "service_name",
        "status",
        "started_at",
        "finished_at",
        "commit_sha"
      ],
      "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"
    },
    "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"
    },
    "IssueCorrectionVerificationNextAction": {
      "description": "Stable continuation selected from the verification result.",
      "oneOf": [
        {
          "const": "inspect_recurrence",
          "description": "Inspect the exact first recurrence and its linked trace when available.",
          "type": "string"
        },
        {
          "const": "continue_observation",
          "description": "Continue observing the candidate release; current absence is not proof.",
          "type": "string"
        },
        {
          "const": "observe_candidate_traffic",
          "description": "Exercise or await representative candidate-release traffic before evaluating absence.",
          "type": "string"
        },
        {
          "const": "retry_verification",
          "description": "Retry because one required evidence source was unavailable.",
          "type": "string"
        }
      ]
    },
    "IssueCorrectionVerificationStatus": {
      "description": "Truthful outcomes for a bounded correction-verification snapshot.",
      "oneOf": [
        {
          "const": "recurrence_observed",
          "description": "The same grouped issue was ingested in the candidate release after deployment.",
          "type": "string"
        },
        {
          "const": "no_recurrence_observed",
          "description": "Candidate traces exist and no same-issue recurrence was observed in this bounded window.",
          "type": "string"
        },
        {
          "const": "insufficient_traffic",
          "description": "Recurrence was readable, but no candidate trace proves the release received useful traffic.",
          "type": "string"
        },
        {
          "const": "unavailable",
          "description": "A required optional evidence read failed, so no verification conclusion is defensible.",
          "type": "string"
        }
      ]
    },
    "IssueInvestigationReappearedOccurrenceResponse": {
      "description": "Privacy-safe scope of the first occurrence observed after resolution.",
      "properties": {
        "environment": {
          "description": "Exact deployment environment captured for the occurrence.",
          "type": "string"
        },
        "id": {
          "description": "Stable retained occurrence identity for exact follow-up selection.",
          "format": "uuid",
          "type": "string"
        },
        "ingested_at": {
          "description": "Server ingestion timestamp used for the recurrence decision.",
          "format": "date-time",
          "type": "string"
        },
        "occurred_at": {
          "description": "Client occurrence timestamp.",
          "format": "date-time",
          "type": "string"
        },
        "release": {
          "description": "Exact release captured for the occurrence.",
          "type": "string"
        },
        "sdk": {
          "$ref": "#/$defs/InvestigationSdkResponse",
          "description": "SDK package identity that captured the occurrence."
        },
        "service_name": {
          "description": "Exact logical service captured for the occurrence.",
          "type": "string"
        },
        "trace_id": {
          "description": "Exact distributed trace identifier when captured.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "occurred_at",
        "ingested_at",
        "environment",
        "release",
        "service_name",
        "trace_id",
        "sdk"
      ],
      "type": "object"
    },
    "ReleaseTraceHealthResponse": {
      "description": "Privacy-safe trace health observed for one release and service.",
      "properties": {
        "error_rate_basis_points": {
          "description": "Error-trace rate from 0 to 10,000 basis points.",
          "format": "uint16",
          "maximum": 65535,
          "minimum": 0,
          "type": "integer"
        },
        "error_trace_count": {
          "description": "Distinct traces containing at least one error span.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        },
        "status": {
          "$ref": "#/$defs/ReleaseTraceHealthStatus",
          "description": "Honest observed state without claiming that a release caused errors."
        },
        "trace_count": {
          "description": "Distinct traces observed for the release and service.",
          "format": "uint64",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "status",
        "trace_count",
        "error_trace_count",
        "error_rate_basis_points"
      ],
      "type": "object"
    },
    "ReleaseTraceHealthStatus": {
      "description": "Honest release trace-health states.",
      "oneOf": [
        {
          "const": "unknown",
          "description": "No trace data is available for this release and service.",
          "type": "string"
        },
        {
          "const": "no_errors_observed",
          "description": "Traces are present and none contain an observed error span.",
          "type": "string"
        },
        {
          "const": "errors_observed",
          "description": "At least one observed trace contains an error span.",
          "type": "string"
        }
      ]
    }
  }
}