{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.tretsven.com/snapcentral/assets/standards/snapcentral-model-information-standard-v0.1.schema.json",
  "title": "SnapCentral Model Information Standard",
  "description": "A public-review field standard for complete, evidence-aware 3D-printing model information.",
  "version": "0.1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "standardVersion",
    "recordId",
    "recordStatus",
    "modelIdentity",
    "pictures",
    "printSummary",
    "filamentPlan",
    "startingSettings",
    "exactPrintSetup",
    "permissionsAndFiles",
    "proof"
  ],
  "properties": {
    "standardVersion": { "const": "0.1" },
    "recordId": { "type": "string", "minLength": 1 },
    "recordStatus": { "$ref": "#/$defs/recordStatus" },
    "modelIdentity": {
      "type": "object",
      "additionalProperties": false,
      "required": ["modelName", "creatorName", "sourceUrl", "description", "creatorSupportedPrinters", "snapCentralTestedPrinters"],
      "properties": {
        "modelName": { "type": "string", "minLength": 1 },
        "creatorName": { "type": "string", "minLength": 1 },
        "creatorUrl": { "type": "string", "format": "uri" },
        "sourceUrl": { "type": "string", "format": "uri" },
        "description": { "type": "string", "minLength": 1 },
        "features": { "type": "array", "items": { "type": "string" } },
        "creatorSupportedPrinters": { "type": "array", "items": { "type": "string" } },
        "snapCentralTestedPrinters": { "type": "array", "items": { "type": "string" } }
      }
    },
    "pictures": {
      "type": "array",
      "minItems": 3,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["url", "view", "widthPixels", "heightPixels", "credit", "permissionConfirmed", "altText"],
        "properties": {
          "url": { "type": "string", "format": "uri-reference" },
          "view": { "type": "string", "minLength": 1 },
          "widthPixels": { "type": "integer", "minimum": 1 },
          "heightPixels": { "type": "integer", "minimum": 1 },
          "credit": { "type": "string", "minLength": 1 },
          "permissionConfirmed": { "type": "boolean" },
          "altText": { "type": "string", "minLength": 1 }
        }
      }
    },
    "printSummary": {
      "type": "object",
      "additionalProperties": false,
      "required": ["estimatedPrintTimeMinutes", "totalFilamentGrams", "nozzleDiameterMm", "buildPlate", "sourceNotes"],
      "properties": {
        "estimatedPrintTimeMinutes": { "type": "number", "minimum": 0 },
        "measuredPrintTimeMinutes": { "type": "number", "minimum": 0 },
        "totalFilamentGrams": { "type": "number", "minimum": 0 },
        "totalFilamentLengthMm": { "type": "number", "minimum": 0 },
        "nozzleDiameterMm": { "type": "number", "exclusiveMinimum": 0 },
        "buildPlate": { "type": "string", "minLength": 1 },
        "sourceNotes": { "type": "string", "minLength": 1 },
        "varianceNotes": { "type": "array", "items": { "type": "string" } }
      }
    },
    "filamentPlan": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["tool", "manufacturer", "product", "material", "color", "diameterMm", "amountGrams", "evidenceSource"],
        "properties": {
          "tool": { "type": "integer", "minimum": 1 },
          "manufacturer": { "type": "string", "minLength": 1 },
          "product": { "type": "string", "minLength": 1 },
          "material": { "type": "string", "minLength": 1 },
          "color": { "type": "string", "minLength": 1 },
          "finish": { "type": "string" },
          "diameterMm": { "type": "number", "exclusiveMinimum": 0 },
          "amountGrams": { "type": "number", "minimum": 0 },
          "colorChangeOverheadIncluded": { "type": "boolean" },
          "substitutes": { "type": "array", "items": { "type": "string" } },
          "evidenceSource": { "type": "string", "minLength": 1 }
        }
      }
    },
    "startingSettings": {
      "type": "object",
      "additionalProperties": false,
      "required": ["layerHeightMm", "infillPercent", "infillPattern", "wallCount", "supports", "orientation", "assemblyRequired"],
      "properties": {
        "layerHeightMm": { "type": "number", "exclusiveMinimum": 0 },
        "firstLayerHeightMm": { "type": "number", "exclusiveMinimum": 0 },
        "infillPercent": { "type": "number", "minimum": 0, "maximum": 100 },
        "infillPattern": { "type": "string", "minLength": 1 },
        "wallCount": { "type": "integer", "minimum": 0 },
        "supports": { "type": "string", "minLength": 1 },
        "orientation": { "type": "string", "minLength": 1 },
        "assemblyRequired": { "type": "boolean" },
        "creatorRecommendation": { "type": "string" },
        "choiceExplanation": { "type": "string" }
      }
    },
    "exactPrintSetup": {
      "type": "object",
      "additionalProperties": false,
      "required": ["printer", "slicer", "slicerVersion", "firmwareVersion", "nozzleTemperatureC", "bedTemperatureC", "topLayers", "bottomLayers", "cooling", "wipeTower"],
      "properties": {
        "printer": { "type": "string", "minLength": 1 },
        "slicer": { "type": "string", "minLength": 1 },
        "slicerVersion": { "type": "string", "minLength": 1 },
        "firmwareVersion": { "type": "string", "minLength": 1 },
        "nozzleTemperatureC": { "type": "number" },
        "bedTemperatureC": { "type": "number" },
        "topLayers": { "type": "integer", "minimum": 0 },
        "bottomLayers": { "type": "integer", "minimum": 0 },
        "speedNotes": { "type": "string" },
        "cooling": { "type": "string", "minLength": 1 },
        "adhesion": { "type": "string" },
        "wipeTower": { "type": "string", "minLength": 1 },
        "preparedFileType": { "type": "string" }
      }
    },
    "permissionsAndFiles": {
      "type": "object",
      "additionalProperties": false,
      "required": ["creatorAuthority", "attributionText", "demonstrationPermission", "distributionRightsGranted", "alterationRightsGranted", "sourceUrl", "listedFileTypes", "checksumRetainedPrivately"],
      "properties": {
        "creatorAuthority": { "type": "string", "minLength": 1 },
        "licenseOrTerms": { "type": "string" },
        "attributionText": { "type": "string", "minLength": 1 },
        "demonstrationPermission": { "type": "boolean" },
        "distributionRightsGranted": { "type": "boolean" },
        "alterationRightsGranted": { "type": "boolean" },
        "sourceUrl": { "type": "string", "format": "uri" },
        "listedFileTypes": { "type": "array", "minItems": 1, "items": { "type": "string" } },
        "checksumRetainedPrivately": { "type": "boolean" }
      }
    },
    "proof": {
      "type": "object",
      "additionalProperties": false,
      "required": ["verificationStatus", "testedAt", "resultSummary", "evidenceSources", "photographUrls"],
      "properties": {
        "verificationStatus": { "$ref": "#/$defs/recordStatus" },
        "testedAt": { "type": "string", "format": "date-time" },
        "resultSummary": { "type": "string", "minLength": 1 },
        "limitations": { "type": "array", "items": { "type": "string" } },
        "evidenceSources": { "type": "array", "minItems": 1, "items": { "type": "string" } },
        "photographUrls": { "type": "array", "minItems": 1, "items": { "type": "string", "format": "uri-reference" } }
      }
    }
  },
  "$defs": {
    "recordStatus": {
      "type": "string",
      "enum": [
        "draft",
        "revision-required",
        "information-complete",
        "verification-ready",
        "print-verified",
        "print-verified-with-limitations",
        "not-verified"
      ]
    }
  }
}
