{
  "$comment": "Generated from the Buildish Release Tooling Pydantic models. Do not edit by hand; regenerate with `make schemas`.",
  "$defs": {
    "RetainedArtifactSnapshot": {
      "additionalProperties": false,
      "description": "One retained file snapshot described inside an inspection-bundle metadata document.",
      "properties": {
        "filename": {
          "description": "Artifact filename as seen in staging, manifests, or retained evidence.",
          "minLength": 1,
          "title": "Filename",
          "type": "string"
        },
        "sha512": {
          "description": "SHA-512 checksum payload associated with the related artifact.",
          "title": "Sha512",
          "type": "string"
        },
        "size_bytes": {
          "description": "Byte size recorded for the related artifact, retained snapshot, or inventory entry.",
          "minimum": 0,
          "title": "Size Bytes",
          "type": "integer"
        }
      },
      "required": [
        "filename",
        "sha512",
        "size_bytes"
      ],
      "title": "RetainedArtifactSnapshot",
      "type": "object",
      "x-buildish-contract": {
        "category": "emitted",
        "ownership": "tooling-derived"
      }
    },
    "ShallowArchiveAnalysisReport": {
      "additionalProperties": false,
      "description": "Durable shallow archive-comparison findings for one retained artifact pair.",
      "properties": {
        "archive_format": {
          "anyOf": [
            {
              "enum": [
                "tar",
                "zip"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Detected top-level archive format of the compared artifact when shallow archive inspection succeeded.",
          "title": "Archive Format"
        },
        "classification": {
          "description": "High-level shallow-comparison classification that summarizes the most important archive drift pattern Buildish observed.",
          "minLength": 1,
          "title": "Classification",
          "type": "string"
        },
        "content_mismatches": {
          "description": "Archive member paths whose direct top-level content bytes differed between the staged and rebuilt artifacts during shallow comparison.",
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "title": "Content Mismatches",
          "type": "array"
        },
        "entry_order_mismatches": {
          "description": "Archive-entry ordering differences detected between the staged and rebuilt artifacts during shallow comparison.",
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "title": "Entry Order Mismatches",
          "type": "array"
        },
        "metadata_mismatches": {
          "description": "Archive-entry metadata differences, such as timestamps, modes, owners, or file-type drift, found during shallow comparison.",
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "title": "Metadata Mismatches",
          "type": "array"
        },
        "missing_paths": {
          "description": "Archive or repository paths that were present in the staged artifact but missing from the rebuilt artifact.",
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "title": "Missing Paths",
          "type": "array"
        },
        "raw_bytes_equal": {
          "description": "Whether raw staged and rebuilt bytes matched before any archive-aware normalization.",
          "title": "Raw Bytes Equal",
          "type": "boolean"
        },
        "rebuilt_archive_format": {
          "description": "Detected top-level archive format of the rebuilt artifact retained for shallow archive inspection.",
          "enum": [
            "tar",
            "zip",
            "non-archive"
          ],
          "title": "Rebuilt Archive Format",
          "type": "string"
        },
        "rebuilt_entry_count": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Number of top-level archive entries found in the rebuilt artifact during shallow inspection.",
          "title": "Rebuilt Entry Count"
        },
        "staged_archive_format": {
          "description": "Detected top-level archive format of the staged artifact retained for shallow archive inspection.",
          "enum": [
            "tar",
            "zip",
            "non-archive"
          ],
          "title": "Staged Archive Format",
          "type": "string"
        },
        "staged_entry_count": {
          "anyOf": [
            {
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Number of top-level archive entries found in the staged artifact during shallow inspection.",
          "title": "Staged Entry Count"
        },
        "unexpected_paths": {
          "description": "Archive or repository paths that were present only in the rebuilt artifact and not in the staged artifact.",
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "title": "Unexpected Paths",
          "type": "array"
        }
      },
      "required": [
        "classification",
        "raw_bytes_equal",
        "staged_archive_format",
        "rebuilt_archive_format"
      ],
      "title": "ShallowArchiveAnalysisReport",
      "type": "object",
      "x-buildish-contract": {
        "category": "emitted",
        "ownership": "tooling-derived"
      }
    }
  },
  "$id": "https://buildish.org/components/release-tooling/schemas/source-artifact-reproducibility-metadata.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Retained comparison metadata for source-artifact reproducibility inspection.",
  "properties": {
    "archive_analysis": {
      "anyOf": [
        {
          "$ref": "#/$defs/ShallowArchiveAnalysisReport"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Shallow top-level archive comparison details retained for reproducibility inspection."
    },
    "comparison_mode": {
      "description": "Declared reproducibility comparison mode used for the related artifact or profile.",
      "minLength": 1,
      "title": "Comparison Mode",
      "type": "string"
    },
    "failure_class": {
      "anyOf": [
        {
          "minLength": 1,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Structured failure classification that summarizes the main reason why verification or reproducibility failed.",
      "title": "Failure Class"
    },
    "issues": {
      "description": "Collected human-readable issues observed for the related verification, inspection, or reproducibility subject.",
      "items": {
        "type": "string"
      },
      "title": "Issues",
      "type": "array"
    },
    "matches_remote_bytes": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether the rebuilt artifact bytes matched the staged or signed remote bytes exactly.",
      "title": "Matches Remote Bytes"
    },
    "profile_id": {
      "description": "Reproducibility profile identifier selected for the related artifact or source verification.",
      "minLength": 1,
      "title": "Profile Id",
      "type": "string"
    },
    "rebuilt_artifact": {
      "anyOf": [
        {
          "$ref": "#/$defs/RetainedArtifactSnapshot"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Retained snapshot metadata for one rebuilt artifact copy in the inspection bundle."
    },
    "staged_artifact": {
      "$ref": "#/$defs/RetainedArtifactSnapshot",
      "description": "Retained snapshot metadata for the staged artifact bytes used as the comparison target."
    }
  },
  "required": [
    "profile_id",
    "comparison_mode",
    "staged_artifact"
  ],
  "title": "Buildish Release Tooling SourceArtifactReproducibilityMetadata",
  "type": "object",
  "x-buildish-contract": {
    "category": "emitted",
    "ownership": "tooling-derived",
    "summary": "Inspection-bundle metadata payload for source-artifact reproducibility evidence."
  }
}
