Privacy-safe asset manifests¶
openmed.multimodal.asset_manifest defines a small manifest for preflight steps that need to describe an input without reading or storing the input itself.
The manifest is intentionally narrow. It records only:
versionasset_idmedia_typesha256byte_size- optional bounded counts:
pages,width,height,frames,duration_seconds - optional waveform metadata:
channel_count,sample_rate_hz,samples_per_channel - optional controlled DICOM selector:
dicom_subprofile(waveformornon_pixel)
The validator rejects unknown fields, paths, URLs, and free-text fields such as descriptions or source metadata. Validation errors name the failed field or rule without echoing the supplied value.
Integer sizes and counts use explicit 64-bit and 32-bit upper bounds, respectively. Duration is finite, positive, and capped at the same upper bound as other counts. Boolean values, scalar subclasses, duplicate JSON fields, and numeric values outside those bounds fail closed.
from openmed.multimodal.asset_manifest import AssetManifest
manifest = AssetManifest.from_dict(
{
"asset_id": "dicom-001",
"media_type": "application/dicom",
"sha256": "a" * 64,
"byte_size": 4096,
"frames": 12,
"width": 512,
"height": 512,
}
)
payload = manifest.to_json()
to_dict() emits fields in a stable order and omits unset optional fields. to_json() emits compact JSON with sorted keys so callers can compare manifest payloads deterministically.
The manifest does not read assets, perform OCR or inference, retain embedded metadata, or define model-specific tensor shapes.
Waveform declarations add application/edf and application/wfdb; DICOM can opt into a waveform or non-pixel sub-profile. See manifest profiles for required metadata, consistency checks, bounds and byte-preflight limitations. All new fields are omitted when unset, preserving existing manifest v1 JSON. See JSON Schemas for offline validation of these records.