收紧历史测试与注释口径

移除 legacy 投影描述

将历史测试统一为 Response item 合同
This commit is contained in:
2026-09-15 16:16:03 +08:00
committed by kdletters
parent 5576acdc11
commit 051c2ec898
@@ -452,8 +452,8 @@ pub(crate) fn direct_project_local_message_item(
))
}
/// 本地补写与 legacy 投影共用同一种 Responses message item 形状,两者的区别只在
/// 是否对入参做 trim 校验:本地补写走上面的校验,legacy 行按文件内容逐字节投影
/// 本地补写与 Codex response item 共用同一种 Responses message item 形状;本地补写额外做
/// trim 校验,历史读取只接受 response_item envelope
fn direct_project_message_item(role: &str, content: &str, message_id: Option<&str>) -> Value {
let mut item = serde_json::json!({
"type": "message",
@@ -566,7 +566,7 @@ mod tests {
fn init_history_project(name: &str) -> tempfile::TempDir {
let root = tempfile::tempdir().expect("temp project");
crate::init_local_game_project_at(root.path(), name, "历史格式兼容测试")
crate::init_local_game_project_at(root.path(), name, "Response item 历史测试")
.expect("init project");
root
}
@@ -976,9 +976,9 @@ mod tests {
let unrecognized_rows = [
// 带 type 却不是 response_item
r#"{"type":"message","role":"user","content":[{"type":"input_text","text":"x"}]}"#,
// schemaVersion 不在白名单里
// schema 不提供 fallback
r#"{"schemaVersion":"game-creator-conversation.v2","role":"user","content":"x","agentId":null,"updatedAt":1}"#,
// legacy 写入器角色集合之外的角色
// 旧 schema 的其它角色也拒绝
r#"{"schemaVersion":"game-creator-conversation.v1","role":"system","content":"x","agentId":null,"updatedAt":1}"#,
r#"{"schemaVersion":"game-creator-conversation.v1","role":"developer","content":"x","agentId":null,"updatedAt":1}"#,
// content 不是字符串