收口 MNote P0 P1 P2 审查尾项

- 归档 OnlyOffice live bridge、Page AI、mindmap、design governance 与相关 bug 条目
- 补齐 MinerU OCR 后端 runtime 合同与 smoke/test 基线
- 收口 ChatOnly/Doubao、ObjectIdentity、Page Aggregate compat 与 runtime owner 文档口径

验证:
- cargo test --manifest-path rust/Cargo.toml -p mnote-web local_ocr -- --test-threads=1
- cargo test --manifest-path rust/Cargo.toml -p mnote-web onlyoffice_bridge -- --test-threads=1
- git diff --check
- git diff --cached --check
- codegraph index . --force && codegraph status .
- codegraph sync . && codegraph status .
This commit is contained in:
lix-2026
2026-06-01 09:29:12 +08:00
parent 49a0545148
commit 1882db7681
143 changed files with 29810 additions and 3228 deletions
+67
View File
@@ -202,6 +202,10 @@ fn legacy_command_function_name(name: &str) -> BridgeResult<&'static str> {
Ok("documents:updateContent")
}
"mindmaps.put" => Ok("mindmaps:put"),
"tree.resource.archive" => Ok("treeResource:archive"),
"tree.resource.restore" => Ok("treeResource:restore"),
"tree.resource.purge" => Ok("treeResource:purge"),
"tree.resource.rename" => Ok("treeResource:rename"),
_ => Err(retired_bridge_error()),
}
}
@@ -6416,6 +6420,25 @@ fn legacy_block_projection_attrs(block: &Value, block_type: &str) -> Value {
attrs.insert("language".into(), json!(language));
}
}
if block_type == "mindmap" {
for (raw_key, canonical_key) in [
("mindmapId", "mindmapId"),
("mindmap_id", "mindmapId"),
("sourcePath", "sourcePath"),
("source_path", "sourcePath"),
("rootNodeId", "rootNodeId"),
("root_node_id", "rootNodeId"),
] {
if let Some(value) = props
.and_then(|map| map.get(raw_key))
.and_then(Value::as_str)
.map(str::trim)
.filter(|value| !value.is_empty())
{
attrs.insert(canonical_key.into(), json!(value));
}
}
}
Value::Object(attrs)
}
@@ -13086,6 +13109,50 @@ mod tests {
);
}
#[test]
fn page_aggregate_block_document_preserves_mindmap_projection_attrs() {
let result = execute_runtime_query(RuntimeInput::Query {
context: demo_context(),
query: RuntimeQueryEnvelopeWire {
name: "page.aggregate.get".into(),
payload: json!({
"documentId": "doc_mindmap",
"workspaceId": "ws_1",
}),
},
data: Some(json!({
"meta": {
"id": "doc_mindmap",
"workspace_id": "ws_1",
"title": "Mindmap Page"
},
"content": {
"content": [
{
"id": "local-block-1",
"type": "mindmap",
"props": {
"mindmapId": "mindmap-123456.json",
"sourcePath": "mindmap-123456.json",
"rootNodeId": "root"
},
"content": []
}
],
"revision": 3,
"conflict_detection_key": "doc_mindmap:3"
}
})),
})
.expect("page aggregate query should build");
let block = &result["body"]["blockDocument"]["blocks"][0];
assert_eq!(block["type"], json!("mindmap"));
assert_eq!(block["attrs"]["mindmapId"], json!("mindmap-123456.json"));
assert_eq!(block["attrs"]["sourcePath"], json!("mindmap-123456.json"));
assert_eq!(block["attrs"]["rootNodeId"], json!("root"));
}
#[test]
fn page_aggregate_get_prefers_editor_document_over_legacy_content() {
let result = execute_runtime_query(RuntimeInput::Query {