{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://silverlab.app/xmp/1.0/schema.json",
  "title": "Silver XMP 1.0",
  "description": "Fields emitted by the Silver macOS app using the silver namespace.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "SchemaVersion": { "type": "string", "enum": ["1.0"], "description": "Schema line version.", "examples": ["1.0"] },
    "SchemaUrl": { "type": "string", "format": "uri", "description": "Canonical schema URL.", "examples": ["https://silverlab.app/xmp/1.0/"] },

    "LabName": { "type": "string", "description": "Lab or studio name.", "examples": ["Silver Lab"] },
    "OrderId": { "type": "string", "description": "Lab order or job number.", "examples": ["ORD-2024-001234"] },
    "CustomerId": { "type": "string", "description": "Customer account identifier.", "examples": ["CUST-5678"] },
    "ScanDate": { "type": "string", "format": "date-time", "description": "ISO 8601 date/time of scan.", "examples": ["2024-12-16T14:30:00Z"] },
    "TechnicianId": { "type": "string", "description": "Technician who performed scan.", "examples": ["TECH-42"] },
    "LabLocation": { "type": "string", "description": "Physical lab location.", "examples": ["Brooklyn Lab A"] },
    "IsRescan": { "type": "boolean", "description": "True if this is a rescan of previously scanned film." },
    "OriginalScanDate": { "type": "string", "format": "date-time", "description": "ISO 8601 date of original scan (if rescan).", "examples": ["2024-11-01T10:15:00Z"] },

    "FilmManufacturer": { "type": "string", "description": "Film brand/manufacturer.", "examples": ["Kodak"] },
    "FilmStock": { "type": "string", "description": "Specific film product name.", "examples": ["Portra 400"] },
    "FilmIsoBox": { "type": "integer", "description": "Rated ISO from box.", "examples": [400] },
    "FilmIsoShot": { "type": "integer", "description": "ISO film was shot at (if pushed/pulled).", "examples": [800] },
    "FilmFormat": { "type": "string", "enum": ["35mm", "120", "4x5", "8x10", "APS", "110", "Other"], "description": "Physical film format.", "examples": ["120"] },
    "FrameCount": { "type": "integer", "description": "Number of frames on roll.", "examples": [36] },
    "FilmExpiredStatus": { "type": "string", "enum": ["fresh", "expired", "unknown"], "description": "Expiration status of film.", "examples": ["fresh"] },
    "FilmExpirationYear": { "type": "integer", "description": "Year film expired (if known).", "examples": [2019] },
    "CameraNotes": { "type": "string", "description": "Freeform notes about camera/shooting.", "examples": ["Leica M6, 50mm f/1.4"] },
    "PhotographerNotes": { "type": "string", "description": "Notes from the photographer about intent or context.", "examples": ["Preferred warm tone rendering."] },

    "ProcessType": { "type": "string", "enum": ["c41", "e6", "bw", "ecn2", "other"], "description": "Development process used.", "examples": ["c41"] },
    "ChemistryBrand": { "type": "string", "description": "Brand/type of chemistry.", "examples": ["Cinestill Cs41"] },
    "PushPullApplied": { "type": "boolean", "description": "True if film was pushed or pulled." },
    "PushPullStops": { "type": "number", "description": "Stops pushed (+) or pulled (-).", "examples": [1.0, -0.5, 2.0] },
    "DevelopmentTime": { "type": "string", "description": "Development time (freeform text).", "examples": ["8 minutes"] },
    "DevelopmentTemperature": { "type": "string", "description": "Development temperature text value.", "examples": ["38C"] },
    "LabStandardProfile": { "type": "string", "description": "Lab standard process/profile identifier.", "examples": ["SilverLab-Std-2024"] },
    "HandProcessed": { "type": "boolean", "description": "True if hand-processed vs machine." },
    "ProcessingNotes": { "type": "string", "description": "Freeform processing notes.", "examples": ["Extended dev for push"] },

    "ScannerManufacturer": { "type": "string", "description": "Scanner brand.", "examples": ["Noritsu"] },
    "ScannerModel": { "type": "string", "description": "Scanner model number/name.", "examples": ["LS-600"] },
    "ScannerSerial": { "type": "string", "description": "Scanner serial number.", "examples": ["NK-001234"] },
    "ScannerType": { "type": "string", "enum": ["drum", "ccd", "cmos", "other"], "description": "Scanner technology type.", "examples": ["ccd"] },
    "WetScan": { "type": "boolean", "description": "True if wet-mounted scan." },
    "HolderType": { "type": "string", "description": "Film holder type used.", "examples": ["glass"] },

    "ScanDpi": { "type": "integer", "minimum": 1, "description": "Scan resolution in DPI.", "examples": [4000] },
    "BitDepth": { "type": "integer", "description": "Bit depth per channel.", "examples": [16] },
    "MultiPass": { "type": "boolean", "description": "True if multi-pass scan." },
    "DustRemovalIce": { "type": "boolean", "description": "True if ICE (infrared cleaning) used." },
    "Sharpening": { "type": "string", "enum": ["none", "low", "medium", "high"], "description": "Sharpening applied at scan.", "examples": ["medium"] },
    "GrainReduction": { "type": "string", "enum": ["none", "low", "medium", "high"], "description": "Grain reduction applied.", "examples": ["low"] },
    "ExposureAdjustmentsApplied": { "type": "boolean", "description": "True if exposure adjusted at scan." },
    "AutoContrast": { "type": "boolean", "description": "True if auto-contrast applied." },
    "ManualOverridesNotes": { "type": "string", "description": "Notes about manual adjustments.", "examples": ["Adjusted shadows +0.5"] },

    "EmbeddedICCProfile": { "type": "string", "description": "Embedded ICC profile name.", "examples": ["Adobe RGB (1998)"] },
    "FrameNumber": { "type": "string", "description": "Frame identifier/number for the file.", "examples": ["118-06"] },

    "BaseColorProfile": { "type": "string", "enum": ["neutral", "vivid", "flat", "custom"], "description": "Base color profile applied.", "examples": ["neutral"] },
    "ColorCorrectionApplied": { "type": "boolean", "description": "True if color correction applied." },
    "WhiteBalanceSource": { "type": "string", "enum": ["auto", "manual", "custom"], "description": "White balance method.", "examples": ["manual"] },
    "ContrastCurve": { "type": "string", "enum": ["soft", "normal", "hard", "custom"], "description": "Contrast curve applied.", "examples": ["normal"] },
    "HighlightRecovery": { "type": "boolean", "description": "True if highlight recovery used." },
    "BlackPointAdjusted": { "type": "boolean", "description": "True if black point adjusted." },
    "LutAppliedName": { "type": "string", "description": "Name of LUT applied (if any).", "examples": ["Kodak 2383"] },

    "RollId": { "type": "string", "description": "Unique roll identifier.", "examples": ["ROLL-2024-456"] },
    "BatchId": { "type": "string", "description": "Batch processing identifier.", "examples": ["BATCH-20241216-03"] },
    "FrameSpacingNormalized": { "type": "boolean", "description": "True if frame spacing normalized." },
    "OrientationCorrected": { "type": "boolean", "description": "True if orientation auto-corrected." },
    "CropApplied": { "type": "boolean", "description": "True if auto-cropped to frame." },
    "BorderRetained": { "type": "boolean", "description": "True if film borders included." },
    "FrameNumberingStart": { "type": "integer", "description": "Starting frame number applied when auto numbering is enabled.", "examples": [1] },

    "QcPassed": { "type": "boolean", "description": "True if passed QC inspection." },
    "DustWarning": { "type": "boolean", "description": "True if significant dust present." },
    "ScratchesPresent": { "type": "boolean", "description": "True if scratches detected." },
    "UnderexposedFrames": { "type": "boolean", "description": "True if frames are underexposed." },
    "OverexposedFrames": { "type": "boolean", "description": "True if frames are overexposed." },
    "TechnicianNotes": { "type": "string", "description": "Notes from scanning technician.", "examples": ["Required extra passes for detail"] },
    "CustomerNotes": { "type": "string", "description": "Notes from or for customer.", "examples": ["Customer requested warm tone"] },

    "ArchiveTier": { "type": "string", "enum": ["master", "web"], "description": "Archive classification.", "examples": ["master"] },
    "UsageRestrictions": { "type": "string", "description": "Freeform usage restrictions.", "examples": ["Personal use only"] },
    "ReprintRecommended": { "type": "boolean", "description": "True if rescan recommended for prints." },
    "LongTermArchive": { "type": "boolean", "description": "True if designated for long-term archive." },
    "CopyrightHolder": { "type": "string", "description": "Copyright holder.", "examples": ["Silver Lab"] }
  },
  "required": ["SchemaVersion", "SchemaUrl"]
}

