/archebase 前缀的明确兼容;不带前缀的现有 MCAP 行为完全保持不变;不考虑 v1。
+ 需求定义
现有模式
+/decxin/rgb/compressed +/decxin/imu +/decxin/serial_number + +→ 输出 +/decxin/left_rgb/h264 +/decxin/right_rgb/h264 +/decxin/imu +/decxin/serial_number+
新增模式
+/archebase/decxin/rgb/compressed +/archebase/decxin/imu +/archebase/decxin/serial_number + +→ 输出 +/archebase/decxin/left_rgb/h264 +/archebase/decxin/right_rgb/h264 +/archebase/decxin/imu +/archebase/decxin/serial_number+
/archebase。不支持任意 /foo、多级 namespace 或不同 topic 使用不同前缀。
+ 最小方案
/archebase input。topic_prefix,值只能为空或 /archebase。+ 不需要数据库迁移,不需要新增管理配置,不需要 Keystone 预读源 MCAP,也不需要把完整 topic 列表设计成通用动态契约。 +
+镜像改造
改动集中在当前构建使用的 orbit/jobs/stereo-split/ 中。
3.1 固定前缀探测
+SUPPORTED_TOPIC_PREFIXES = ("", "/archebase")
+
+def detect_topic_prefix(topics):
+ canonical = "/decxin/rgb/compressed"
+ prefixed = "/archebase/decxin/rgb/compressed"
+
+ if canonical in topics and prefixed in topics:
+ raise RuntimeError("ambiguous stereo input topics")
+ if canonical in topics:
+ return ""
+ if prefixed in topics:
+ return "/archebase"
+ raise RuntimeError("no supported CompressedImage topic found")
+
+ 3.2 根据 prefix 构造有效配置
+def topic(prefix, canonical): + return prefix + canonical + +config = ConverterConfig( + input_topic=topic(prefix, "/decxin/rgb/compressed"), + left_topic=topic(prefix, "/decxin/left_rgb/h264"), + right_topic=topic(prefix, "/decxin/right_rgb/h264"), + imu_topic=topic(prefix, "/decxin/imu"), + serial_topic=topic(prefix, "/decxin/serial_number"), +)+
+ 这样现有转换主流程基本不需要理解 namespace:它仍然使用 config.input_topic、
+ config.imu_topic、config.left_topic 等字段,只是 config 由输入自动决定。
+
3.3 Manifest 增加一个简单字段
+{
+ "schema_version": 2,
+ "output_format": "stereo_h264",
+ "topic_prefix": "/archebase",
+ "stats": {
+ "input_messages": 1238,
+ "left_videos": 1214,
+ "right_videos": 1214,
+ "imu_messages": 27236
+ }
+}
+ -
+
- 无前缀任务写
"topic_prefix": "",或者省略该字段。
+ - 旧镜像生成的 manifest 没有此字段,Keystone 读取零值
"",继续按无前缀处理。
+ - 只接受
""和"/archebase"。
+
3.4 已拆分输入
++ 为保持行为一致,split H.264 timestamp-repair 分支也使用同一套 prefix 探测。带前缀的 left/right/imu 输入仍带前缀写出;无前缀行为不变。 +
+Keystone 改造
Keystone 只需要知道本次结果属于哪一种固定布局,不需要解析源文件,也不需要支持任意 namespace。
+ +4.1 Manifest 结构增加字段
+type processingManifest struct {
+ // existing fields...
+ TopicPrefix string `json:"topic_prefix,omitempty"`
+}
+
+ 4.2 QA contract 增加 IMU topic
+type mcapOutputContract struct {
+ // existing fields...
+ LeftTopic string
+ RightTopic string
+ IMUTopic string
+}
+
+ 4.3 v2/v3 contract 构造
+prefix := strings.TrimSpace(manifest.TopicPrefix)
+if prefix != "" && prefix != "/archebase" {
+ return mcapOutputContract{}, fmt.Errorf(
+ "unsupported stereo split topic prefix %q", prefix,
+ )
+}
+
+contract.LeftTopic = prefix + leftVideoTopic
+contract.RightTopic = prefix + rightVideoTopic
+contract.IMUTopic = prefix + imuTopic
+
+ 其中现有常量保持为 canonical suffix:/decxin/left_rgb/h264、
+ /decxin/right_rgb/h264、/decxin/imu。
+
4.4 inspectOutputMCAP 使用 contract.IMUTopic
+states := map[string]*topicQAState{
+ contract.LeftTopic: {},
+ contract.RightTopic: {},
+ contract.IMUTopic: {},
+}
+
+expectedSchemas := map[string]string{
+ contract.LeftTopic: compressedVideoSchema,
+ contract.RightTopic: compressedVideoSchema,
+ contract.IMUTopic: imuSchema,
+}
+
+imuCount := states[contract.IMUTopic].Count
+ + 左右视频 schema、protobuf encoding、IMU schema、cdr encoding、消息数量和时间戳检查逻辑都保持不变,只是 topic key 根据固定 prefix 切换。 +
+ +不需要做的 Keystone 改动
+-
+
- 不需要新增数据库字段或 migration。 +
- 不需要修改 Episode、Derivative 或 Bulk API。 +
- 不需要修改 Synapse 页面。 +
- 不需要 Keystone 读取源 MCAP summary。 +
- 不需要新增系统设置或管理员选择项。 +
兼容性行为
| 输入 | 镜像输出 | Manifest | Keystone QA |
|---|---|---|---|
/decxin/... |
+ /decxin/... |
+ topic_prefix="" 或缺省 |
+ 使用现有 topic;行为不变 | +
/archebase/decxin/... |
+ /archebase/decxin/... |
+ topic_prefix="/archebase" |
+ 使用带前缀 topic;验证通过 | +
| 两种 input 同时存在 | +不生成 | +无 | +作业失败,避免猜测 | +
| 其它前缀 | +不生成 | +无 | +明确报 unsupported | +
| 旧镜像的无 prefix manifest | +历史产物 | +没有 topic_prefix |
+ Go 零值为空,继续通过 | +
测试清单
镜像测试
+-
+
- 无前缀 joined H.264 回归测试。 +
/archebasejoined H.264 输出带前缀。
+ /archebaseIMU 与 serial 被正确识别和保留。
+ /archebasesplit H.264 timestamp-repair。
+ - 两种 input 同时存在时失败。 +
- manifest 的
topic_prefix与输出一致。
+
Keystone 测试
+-
+
- 缺省 prefix 构造现有 QA contract。 +
/archebase构造带前缀 QA contract。
+ - 其它 prefix 被拒绝。 +
- 带前缀 MCAP 的 left/right/imu 计数通过。 +
- 带前缀 MCAP 缺失 IMU 时失败。 +
- 现有无前缀测试全部保持通过。 +
真实文件验收
+
+ 使用 ~/Downloads/session_004(1).mcap 作为集成样本。作业应识别
+ topic_prefix=/archebase,输出 left/right/imu/serial 全部保留前缀,并由 Keystone 完成产物验证与自动 QA。
+
实施顺序
-
+
- 先在镜像 converter 中增加两种固定 prefix 的探测与有效 config 构造。 +
- 让
run_processing.py把topic_prefix写入 metadata 与 manifest。
+ - 修改 Keystone manifest struct 和动态 QA contract。 +
- 补镜像与 Keystone 单测。 +
- 用
session_004(1).mcap跑一次真实 Orbit Job。
+ - Keystone 升级后再切换新的 immutable image digest。 +
/archebase QA,再启用会输出该前缀的新镜像;否则新镜像的带前缀产物会被旧 Keystone 判定失败。
+ 结论
这是一个小范围兼容改造
+
+ 镜像增加两种固定 topic 布局的选择;manifest 增加一个 topic_prefix 字段;Keystone QA 根据该字段在两套固定 topic 之间切换。
+
+ 不引入通用 namespace、不增加数据库、不改变 API、不影响现有无前缀 MCAP,也不考虑 v1。 +
+