atlas-iac/services/hermes/contracts/hux/multimodal.schema.json

92 lines
4.5 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://hermes.bstein.dev/contracts/hux/v1/multimodal.schema.json",
"title": "HUX scoped multimodal metadata",
"description": "Metadata-only records for HUX-07. Binary capture and upload are deliberately outside this API and remain gated by HUX-05.",
"$defs": {
"scope": {
"type": "object",
"additionalProperties": false,
"required": ["owner", "project_id", "conversation_id"],
"properties": {
"owner": {"$ref": "common.schema.json#/$defs/user_ref"},
"project_id": {"$ref": "common.schema.json#/$defs/id"},
"conversation_id": {"$ref": "common.schema.json#/$defs/id"}
}
},
"lineage": {
"type": "object",
"additionalProperties": false,
"properties": {
"parent_item_id": {"$ref": "common.schema.json#/$defs/id"},
"artifact_id": {"$ref": "common.schema.json#/$defs/id"},
"artifact_version": {"type": "integer", "minimum": 1}
}
},
"item": {
"type": "object",
"additionalProperties": false,
"required": ["schema", "id", "owner", "project_id", "conversation_id", "kind", "source", "filename", "mime", "bytes", "hash", "approval_id", "status", "created_at", "revision"],
"properties": {
"schema": {"const": "hux.multimodal_item.v1"},
"id": {"$ref": "common.schema.json#/$defs/id"},
"owner": {"$ref": "common.schema.json#/$defs/user_ref"},
"project_id": {"$ref": "common.schema.json#/$defs/id"},
"conversation_id": {"$ref": "common.schema.json#/$defs/id"},
"kind": {"type": "string", "enum": ["image", "audio", "video", "document"]},
"source": {"type": "string", "enum": ["upload", "camera", "screen", "voice"]},
"filename": {"type": "string", "minLength": 1, "maxLength": 160},
"mime": {"type": "string", "enum": ["image/jpeg", "image/png", "image/webp", "audio/wav", "audio/webm", "audio/ogg", "video/webm", "video/mp4", "application/pdf", "text/plain"]},
"bytes": {"type": "integer", "minimum": 1, "maximum": 26214400},
"hash": {"$ref": "common.schema.json#/$defs/sha256"},
"approval_id": {"$ref": "common.schema.json#/$defs/id"},
"lineage": {"$ref": "#/$defs/lineage"},
"latest_correction_id": {"$ref": "common.schema.json#/$defs/id"},
"status": {"const": "metadata_only"},
"created_at": {"$ref": "common.schema.json#/$defs/timestamp"},
"revision": {"$ref": "common.schema.json#/$defs/revision"}
}
},
"correction": {
"type": "object",
"additionalProperties": false,
"required": ["schema", "id", "owner", "project_id", "conversation_id", "item_id", "replacement_text", "created_at", "revision"],
"properties": {
"schema": {"const": "hux.transcript_correction.v1"},
"id": {"$ref": "common.schema.json#/$defs/id"},
"owner": {"$ref": "common.schema.json#/$defs/user_ref"},
"project_id": {"$ref": "common.schema.json#/$defs/id"},
"conversation_id": {"$ref": "common.schema.json#/$defs/id"},
"item_id": {"$ref": "common.schema.json#/$defs/id"},
"replacement_text": {"type": "string", "minLength": 1, "maxLength": 10000},
"created_at": {"$ref": "common.schema.json#/$defs/timestamp"},
"revision": {"$ref": "common.schema.json#/$defs/revision"}
}
},
"capture_intent": {
"type": "object",
"additionalProperties": false,
"required": ["schema", "id", "owner", "project_id", "conversation_id", "source", "purpose", "status", "requires_approval", "execution_allowed", "created_at", "revision"],
"properties": {
"schema": {"const": "hux.capture_intent.v1"},
"id": {"$ref": "common.schema.json#/$defs/id"},
"owner": {"$ref": "common.schema.json#/$defs/user_ref"},
"project_id": {"$ref": "common.schema.json#/$defs/id"},
"conversation_id": {"$ref": "common.schema.json#/$defs/id"},
"source": {"type": "string", "enum": ["camera", "screen"]},
"purpose": {"type": "string", "minLength": 1, "maxLength": 280},
"status": {"const": "proposed"},
"requires_approval": {"const": true},
"execution_allowed": {"const": false},
"created_at": {"$ref": "common.schema.json#/$defs/timestamp"},
"revision": {"$ref": "common.schema.json#/$defs/revision"}
}
}
},
"oneOf": [
{"$ref": "#/$defs/item"},
{"$ref": "#/$defs/correction"},
{"$ref": "#/$defs/capture_intent"}
]
}