DOC-FULL-001:ReadingMaterialRef V2 #102
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
目标
定义 V2 阅读材料引用模型,作为 ReadingSession、ReadingEvent、DocumentInfo 等模块的基础输入。
设计要求
ReadingMaterialRef 只包含 Rust 层需要知道的信息。
建议字段
明确禁止字段
原因
Rust document runtime 不知道 materialId 对应 KnowledgeSource 还是 TemporaryReadingMaterial。业务类型由 iOS / API 判断。
需要支持
验收标准
完成证据
产物:
crates/zx_document_core/src/reading_material.rs(V2 新增 131 行)提交:
c276503feat: ReadingMaterialRef V2 (DOC-FULL-001)ReadingMaterialRefV2 字段:
#[serde(rename_all = "camelCase")])明确禁止字段: readingTargetType, userId, knowledgeBaseId, platform, appVersion
V1 兼容: ReadingMaterialRef 标记
#[deprecated],保留不删除测试: 6 个新增测试 (test_v2_new_minimal / test_v2_builder / test_v2_serde_camel_case / test_v2_serde_roundtrip / test_v2_no_forbidden_fields / V1 backward compat)
影响范围:
session_v2.rs: start_reading_session_v2 接收 V2events_v2.rs: 测试 helper 迁移ffi/lib.rs: pub use V2 类型, FFI 函数迁移构建: cargo check 0 errors, cargo test 160 passed / 0 failed