Files

181 lines
6.6 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://cezentech.com/schemas/nexus-one/artifact-manifest-v1.json",
"title": "Nexus One AI Signed Artifact Manifest",
"type": "object",
"additionalProperties": false,
"required": [
"schema", "artifact", "source", "targets", "payload", "requirements",
"lifecycle", "integrity"
],
"properties": {
"schema": { "const": "com.cezen.nexus-one.artifact-manifest.v1" },
"artifact": {
"type": "object",
"additionalProperties": false,
"required": ["id", "type", "version", "created_at", "architecture"],
"properties": {
"id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{2,127}$" },
"type": { "enum": ["iso-payload", "model-pack", "update-bundle", "trust-bundle"] },
"version": { "type": "string", "minLength": 1 },
"created_at": { "type": "string", "format": "date-time" },
"architecture": { "enum": ["amd64", "arm64", "multi"] },
"description": { "type": "string", "maxLength": 512 }
}
},
"source": {
"type": "object",
"additionalProperties": false,
"required": ["repository", "revision", "builder", "build_recipe_digest"],
"properties": {
"repository": { "type": "string", "minLength": 1 },
"revision": { "type": "string", "pattern": "^[0-9a-f]{40,64}$" },
"builder": { "type": "string", "minLength": 1 },
"build_recipe_digest": { "$ref": "#/$defs/digest" },
"sbom": { "$ref": "#/$defs/objectRef" },
"provenance": { "$ref": "#/$defs/objectRef" }
}
},
"targets": {
"type": "object",
"additionalProperties": false,
"required": ["categories", "tiers", "platform_versions", "ubuntu_release"],
"properties": {
"categories": {
"type": "array", "minItems": 1, "uniqueItems": true,
"items": { "enum": ["workstation", "server"] }
},
"tiers": {
"type": "array", "minItems": 1, "uniqueItems": true,
"items": { "enum": ["workstation", "starter", "basic", "pro", "max"] }
},
"platform_versions": { "type": "string", "minLength": 1 },
"ubuntu_release": { "type": "string", "minLength": 1 },
"hardware_profiles": {
"type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 }
}
}
},
"payload": {
"type": "array", "minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["path", "bytes", "digest", "media_type", "install_scope"],
"properties": {
"path": { "type": "string", "pattern": "^[^/].*$" },
"bytes": { "type": "integer", "minimum": 0 },
"digest": { "$ref": "#/$defs/digest" },
"media_type": { "type": "string", "minLength": 1 },
"install_scope": { "enum": ["base", "category", "tier", "optional"] },
"immutable_source": { "type": "string" }
}
}
},
"requirements": {
"type": "object",
"additionalProperties": false,
"required": ["download_bytes", "unpacked_bytes", "required_free_bytes"],
"properties": {
"download_bytes": { "type": "integer", "minimum": 0 },
"unpacked_bytes": { "type": "integer", "minimum": 0 },
"required_free_bytes": { "type": "integer", "minimum": 0 },
"minimum_ram_bytes": { "type": "integer", "minimum": 0 },
"minimum_vram_bytes": { "type": "integer", "minimum": 0 },
"required_capabilities": {
"type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 }
}
}
},
"lifecycle": {
"type": "object",
"additionalProperties": false,
"required": ["activation", "reboot", "rollback_class"],
"properties": {
"from_versions": { "type": "string" },
"to_version": { "type": "string" },
"activation": { "enum": ["install", "import", "staged-switch", "trust-update"] },
"reboot": { "enum": ["none", "may-require", "required"] },
"rollback_class": { "enum": ["automatic", "operator", "restore", "none"] },
"security_floor": { "type": "string" },
"health_validation_seconds": { "type": "integer", "minimum": 1 }
}
},
"integrity": {
"type": "object",
"additionalProperties": false,
"required": ["signature_algorithm", "signing_key_id", "policy_version"],
"properties": {
"signature_algorithm": { "const": "ed25519" },
"signing_key_id": { "type": "string", "minLength": 8 },
"policy_version": { "type": "string", "minLength": 1 },
"revocation_list_version": { "type": "string" }
}
},
"model": {
"type": "object",
"additionalProperties": false,
"required": ["provider", "model_id", "revision", "runtime", "activation_name"],
"properties": {
"provider": { "type": "string", "minLength": 1 },
"model_id": { "type": "string", "minLength": 1 },
"revision": { "type": "string", "minLength": 1 },
"runtime": { "type": "string", "minLength": 1 },
"activation_name": { "type": "string", "minLength": 1 }
}
},
"actions": {
"type": "array",
"items": {
"type": "object", "additionalProperties": false,
"required": ["order", "kind", "object", "failure_action"],
"properties": {
"order": { "type": "integer", "minimum": 1 },
"kind": { "enum": ["install", "replace", "remove", "migrate", "activate", "validate"] },
"object": { "type": "string", "minLength": 1 },
"failure_action": { "enum": ["stop-safe", "rollback", "restore", "operator-recovery"] }
}
}
}
},
"$defs": {
"digest": { "type": "string", "pattern": "^sha256:[0-9a-f]{64}$" },
"objectRef": {
"type": "object",
"additionalProperties": false,
"required": ["path", "bytes", "digest"],
"properties": {
"path": { "type": "string", "pattern": "^[^/].*$" },
"bytes": { "type": "integer", "minimum": 0 },
"digest": { "$ref": "#/$defs/digest" }
}
}
},
"allOf": [
{
"if": {
"properties": {
"artifact": {
"properties": {
"type": { "const": "model-pack" }
}
}
}
},
"then": { "required": ["model"] }
},
{
"if": {
"properties": {
"artifact": {
"properties": {
"type": { "const": "update-bundle" }
}
}
}
},
"then": { "required": ["actions"] }
}
]
}