{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://localendpoints.com/schemas/localendpoint.evidence-packet.schema.json",
  "title": "LocalEndpoint Evidence Packet",
  "description": "Redacted evidence packet for public-safe local endpoint review. It is not runtime certification.",
  "type": "object",
  "required": [
    "packetVersion",
    "sourceManifestHash",
    "redactionStatus",
    "resourceTraceSummary",
    "slowLoopActionSummary",
    "diagnosticsSummary",
    "generatedUtc",
    "artifactHashes",
    "nonClaims"
  ],
  "properties": {
    "packetVersion": {
      "type": "string",
      "const": "1.0"
    },
    "sourceManifestHash": {
      "type": "string",
      "pattern": "^[a-fA-F0-9]{64}$"
    },
    "redactionStatus": {
      "type": "string",
      "enum": [
        "redacted",
        "redaction-required",
        "private-do-not-publish"
      ]
    },
    "resourceTraceSummary": {
      "type": "object",
      "required": [
        "cpu",
        "memoryMb",
        "durationMs",
        "network"
      ],
      "properties": {
        "cpu": {
          "type": "string"
        },
        "memoryMb": {
          "type": "integer",
          "minimum": 0
        },
        "durationMs": {
          "type": "integer",
          "minimum": 0
        },
        "network": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "slowLoopActionSummary": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "diagnosticsSummary": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "generatedUtc": {
      "type": "string",
      "format": "date-time"
    },
    "artifactHashes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "path",
          "sha256"
        ],
        "properties": {
          "path": {
            "type": "string"
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-fA-F0-9]{64}$"
          }
        },
        "additionalProperties": false
      }
    },
    "nonClaims": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string"
      }
    }
  },
  "additionalProperties": false
}
