2026-08-23 22:07:38 -03:00
{
"$schema" : "https://json-schema.org/draft/2020-12/schema" ,
"$id" : "https://hermes.bstein.dev/contracts/hux/v1/artifact.schema.json" ,
"title" : "HUX artifact" ,
"description" : "Typed, versioned output (HUX-04). Content lives behind content_ref; versions are immutable and diffable; lineage records what an artifact was derived from; promotion copies a version into a project." ,
"type" : "object" ,
"additionalProperties" : false ,
2026-08-24 00:04:37 -03:00
"required" : [
"schema" ,
"id" ,
"owner" ,
"type" ,
"title" ,
"current_version" ,
"versions" ,
"sensitivity" ,
"created_at" ,
"updated_at" ,
"revision" ,
"access"
] ,
2026-08-23 22:07:38 -03:00
"properties" : {
2026-08-24 00:04:37 -03:00
"schema" : {
"const" : "hux.artifact.v1"
} ,
"id" : {
"$ref" : "common.schema.json#/$defs/id"
} ,
"owner" : {
"$ref" : "common.schema.json#/$defs/user_ref"
} ,
"conversation_id" : {
"$ref" : "common.schema.json#/$defs/id"
} ,
"project_id" : {
"$ref" : "common.schema.json#/$defs/id"
} ,
"type" : {
"type" : "string" ,
"enum" : [
"markdown" ,
"code" ,
"html" ,
"svg" ,
"image" ,
"json" ,
"csv" ,
"document" ,
"audio"
]
} ,
"language" : {
"type" : "string" ,
"maxLength" : 40
} ,
"title" : {
"type" : "string" ,
"minLength" : 1 ,
"maxLength" : 200
} ,
"current_version" : {
"type" : "integer" ,
"minimum" : 1
} ,
2026-08-23 22:07:38 -03:00
"versions" : {
"type" : "array" ,
"minItems" : 1 ,
"items" : {
"type" : "object" ,
"additionalProperties" : false ,
2026-08-24 00:04:37 -03:00
"required" : [
"version" ,
"created_at" ,
"created_by" ,
"content_ref"
] ,
2026-08-23 22:07:38 -03:00
"properties" : {
2026-08-24 00:04:37 -03:00
"version" : {
"type" : "integer" ,
"minimum" : 1
} ,
"created_at" : {
"$ref" : "common.schema.json#/$defs/timestamp"
} ,
"created_by" : {
"$ref" : "common.schema.json#/$defs/actor"
} ,
"message_id" : {
"type" : "string" ,
"maxLength" : 120
} ,
2026-08-23 22:07:38 -03:00
"content_ref" : {
"type" : "object" ,
"additionalProperties" : false ,
2026-08-24 00:04:37 -03:00
"required" : [
"hash" ,
"bytes" ,
"mime"
] ,
2026-08-23 22:07:38 -03:00
"properties" : {
2026-08-24 00:04:37 -03:00
"hash" : {
"$ref" : "common.schema.json#/$defs/sha256"
} ,
"bytes" : {
"type" : "integer" ,
"minimum" : 0
} ,
"mime" : {
"type" : "string" ,
"maxLength" : 120
}
2026-08-23 22:07:38 -03:00
}
} ,
2026-08-24 00:04:37 -03:00
"diff_from" : {
"type" : "integer" ,
"minimum" : 1
} ,
2026-08-23 22:07:38 -03:00
"lineage" : {
"type" : "object" ,
"additionalProperties" : false ,
2026-08-24 00:04:37 -03:00
"required" : [
"artifact_id" ,
"version"
] ,
2026-08-23 22:07:38 -03:00
"properties" : {
2026-08-24 00:04:37 -03:00
"artifact_id" : {
"$ref" : "common.schema.json#/$defs/id"
} ,
"version" : {
"type" : "integer" ,
"minimum" : 1
}
2026-08-23 22:07:38 -03:00
}
} ,
2026-08-24 00:04:37 -03:00
"note" : {
"type" : "string" ,
"maxLength" : 200
}
2026-08-23 22:07:38 -03:00
}
}
} ,
"promotion" : {
"type" : "object" ,
"additionalProperties" : false ,
2026-08-24 00:04:37 -03:00
"required" : [
"project_id" ,
"version" ,
"at"
] ,
2026-08-23 22:07:38 -03:00
"properties" : {
2026-08-24 00:04:37 -03:00
"project_id" : {
"$ref" : "common.schema.json#/$defs/id"
} ,
"version" : {
"type" : "integer" ,
"minimum" : 1
} ,
"at" : {
"$ref" : "common.schema.json#/$defs/timestamp"
}
2026-08-23 22:07:38 -03:00
}
} ,
2026-08-24 00:04:37 -03:00
"sensitivity" : {
"$ref" : "common.schema.json#/$defs/sensitivity"
} ,
"created_at" : {
"$ref" : "common.schema.json#/$defs/timestamp"
} ,
"updated_at" : {
"$ref" : "common.schema.json#/$defs/timestamp"
} ,
"revision" : {
"$ref" : "common.schema.json#/$defs/revision"
} ,
"access" : {
"type" : "object" ,
"description" : "Owner-only unless a share token is minted; shares are read-only and expire." ,
"additionalProperties" : false ,
"required" : [
"mode"
] ,
"properties" : {
"mode" : {
"type" : "string" ,
"enum" : [
"owner" ,
"shared_readonly"
]
} ,
"share_expires_at" : {
"$ref" : "common.schema.json#/$defs/timestamp"
}
}
}
2026-08-23 22:07:38 -03:00
}
}