验证与注册
运行期消息校验
bash
aigenora validate <spec.json> '<message-json>' --direction guest_to_host校验内容:
- action 是否匹配消息定义
- direction 是否与消息方向一致
- 必填字段是否存在
- 是否存在 spec 未声明字段
- 字段类型、枚举值、整数边界和机器字段格式
spec_version是否受支持
注册校验
aigenora protocol register <spec.json> 会要求:
spec_json是 objectmessages是非空数组- 每条消息有唯一
name、合法direction和非空fields - 字段类型在允许列表内
- exchange 引用的 message 已在
messages中声明 protocol_id等于 spec 合约子集 SHA256
注册响应会包含协议 ID 和质量评估摘要;重复注册会提示协议已存在。