docs(p1): 补齐 record/私聊/转发读回三证据,定性合并转发不可还原

- 新增 forward-readback-probe(只读):对 history 全部 8 条外层 multimsg 逐条
  重试 get_forward_msg,含数分钟前的 seq=3115,19 种参数组合全失败,
  排除「消息已过期」解释,确认为接口能力缺口(第 20.2 旧依据就地标注缺陷)
- 关键发现:news[].text 能否 parse 成段数组取决于当初 node.content 传数组还是
  JSON 字符串,唯一能 parse 的两条恰是发送形态用错的那两条 ⇒ 属字面文本假象,
  非还原能力。正确形态下段类型与嵌套结构不可逆丢失(GC-012, severity high)
- 未采边界显式登记:正确形态样本节点全是 text,媒体节点降级形态无实测依据,
  不得宣称「只是降级为文本」
- get_msg 实测 9/9 retcode=0 ⇒ 新增 OP-get-msg,作为不依赖 history 窗口分页的
  单条定点读回路径,用于兜底 file 段零事件与私聊 history 分页缺口
- resid 非恒定存在(tsum=0 的静默失效消息 detail_keys 无 resid)⇒ 按可空建模
- record 定性收紧为 MSG-record / MSG-record-silk / MSG-record-transcode 三项;
  私聊段矩阵第三证据 6/6 一致;门禁缺测项 1 → 0
- 能力基线 29 → 30 项、globalConstraints 11 → 12;capability-check 识别
  forwardReadback 自动源。结构校验 0 错误 0 警告,漂移比对自动 21 项、
  漂移 0、缺测 0、人工确认 4 → PASS
This commit is contained in:
2026-10-29 16:27:51 +08:00
parent 49be62e38b
commit a2a781ab4c
9 changed files with 1120 additions and 27 deletions
+126 -25
View File
@@ -21,16 +21,21 @@
"selfQq": 3575608514
},
"evidenceRule": "三证据 = API retcode + 入站事件段 + get_group_msg_history/get_friend_msg_history 回读段。retcode=0 单独不构成成功结论。",
"probes": {
"matrix": "tools/probe/matrix-probe.mjs",
"segments": "tools/probe/seg-probe.mjs",
"record": "tools/probe/record-probe.mjs",
"forwardFollowup": "tools/probe/fwd-record-followup.mjs",
"urlMedia": "tools/probe/url-media-probe.mjs",
"historyAudit": "tools/probe/history-audit.mjs",
"historyDump": "tools/probe/history-dump.mjs",
"aiRecordSideeffect": "tools/probe/ai-record-sideeffect.mjs"
}
"probes": {
"matrix": "tools/probe/matrix-probe.mjs",
"segments": "tools/probe/seg-probe.mjs",
"record": "tools/probe/record-probe.mjs",
"recordAmr": "tools/probe/record-amr-probe.mjs",
"recordDecoder": "tools/probe/record-decoder-probe.mjs",
"forwardFollowup": "tools/probe/fwd-record-followup.mjs",
"urlMedia": "tools/probe/url-media-probe.mjs",
"historyAudit": "tools/probe/history-audit.mjs",
"historyDump": "tools/probe/history-dump.mjs",
"privateHistoryAudit": "tools/probe/private-history-audit.mjs",
"forwardReadback": "tools/probe/forward-readback-probe.mjs",
"noticeCapability": "tools/probe/notice-capability.mjs",
"aiRecordSideeffect": "tools/probe/ai-record-sideeffect.mjs"
}
},
"enums": {
"status": {
@@ -103,6 +108,32 @@
"title": "WS 握手不校验 access_token",
"detail": "错误凭据仍可完成握手,随后才回 retcode=1403 并断开。健康检查与『连接可用』判定必须等到收到 meta_event/lifecycle,不能以 onopen 为准。",
"evidence": ["docs/decision-baseline.md#16"]
},
{
"id": "GC-009",
"title": "写操作接口对不存在的目标也返回 retcode=0(假成功)",
"detail": "set_group_kick_members 传入不存在的 user_id=[1],retcode=0 且 data=null,群成员数实测前后均为 5,即实际未产生任何效果。写操作不得以 retcode 判定业务成功,必须回读目标状态(成员列表/消息列表)确认,否则会把『什么都没做』记成『已完成』。",
"severity": "high",
"evidence": ["local/notice-capability-2026-10-29T07-29-59-898Z.jsonl"]
},
{
"id": "GC-010",
"title": "real_seq 是字符串,message_id 是数字,二者类型不同",
"detail": "get_group_msg_history 与 get_friend_msg_history 回读的 real_seq 均为 string(如 \"3115\"),message_id 为 number。事件通道与 history 的同一标识类型不保证一致。去重键、排序与数据库列类型必须显式统一(建议 real_seq 统一按无符号整型入库并在边界层做一次转换),禁止依赖 JS/Java 的隐式转换或字符串比较,否则会出现 '9' > '10' 类的排序与去重错误。",
"evidence": ["local/private-history-audit-2026-10-29T07-33-39-286Z.jsonl", "docs/decision-baseline.md#21"]
},
{
"id": "GC-011",
"title": "群文件 file_id 有独立读回路径,不必只依赖 history",
"detail": "upload_group_file 不返回 file_id,但 get_group_root_files 可直接列出群文件并给出 file_id/file_name/size/uploader/modify_time,get_group_file_url 用该 file_id 可换到下载直链(实测 retcode=0)。因此文件类消息的补拉与下载不必受 history 窗口限制,但 file 事件缺失本身仍需 history/文件列表双路对账。",
"evidence": ["local/notice-capability-2026-10-29T07-29-59-898Z.jsonl"]
},
{
"id": "GC-012",
"title": "合并转发内层节点不可还原;news 的『可解析性』是发送形态造成的假象",
"detail": "get_forward_msg 对 history 当场回读的 8 条外层 multimsg 消息(含刚发出数分钟的 seq=3115)逐条重试,含 resid/uniseq/filename/forward_id 共 19 种参数组合,全部 retcode=1200『消息已过期或者为内层消息』⇒ 最新鲜消息同样失败,排除『已过期』解释,属接口能力缺口。唯一附带内容 meta.detail.news 是否可 JSON.parse,取决于当初 node.content 传的是段数组还是 JSON 字符串:正确形态(段数组)落库后 news 全是『昵称: 纯文本』,段类型与嵌套结构不可逆丢失;只有当初误把 content 当 JSON 字符串发出去的那两条反而能 parse 出数组——那是我们误发的字面文本,不是协议还原能力。因此标准化模型禁止把 news 当作结构化节点来源,必须原样保留 json.data.data 全文与 resid/uniseq/filename/tsum,并按降级摘要处理节点内容。媒体节点在正确形态下的具体降级形态尚无样本,属待验证。",
"severity": "high",
"evidence": ["local/forward-readback-2026-10-29T08-13-22-610Z.jsonl", "local/forward-readback-2026-10-29T08-00-43-746Z.jsonl"]
}
],
"capabilities": [
@@ -217,21 +248,61 @@
"name": "语音段",
"kind": "message-segment",
"api": ["send_group_msg", "send_private_msg"],
"supports": ["group"],
"sendStatus": "verified",
"eventStatus": "verified",
"historyStatus": "verified",
"parseStatus": "pending",
"automationTest": "record-amr-probe --yes: amr_cdnUrl/amr_b64/amr_b64_fmt/amr_b64_fmt_amr 四次 retcode=0,事件段=record+text,history seq=3118-3121 回读 record+text;对照组 amr_localPath=1200",
"realEnvTest": "verified",
"regressionProbe": { "probe": "recordAmr", "case": "amr_b64", "expect": { "retcode": 0, "eventSegs": "record+text", "historySegs": "record+text" } },
"limitations": [
"【推翻前一轮结论】record 段本身可用,但**载荷必须是 AMR**(magic 2321414d52 = \"#!AMR\")。同一传法下的严格对照:base64:// 形式 amr=0 / silk=1200,CDN url 形式 amr=0 / silk=1200。silk 载荷(含 NapCat 自己 get_ai_record 产出的合法 silk v3,magic 03232153494c4b5f5633)一律 retcode=1200 'Failed to open input: Invalid data found when processing input'。",
"定性:不是 record 功能损坏,也不是素材非法或参数形态错误,而是本 NapCat 环境**缺 silk 解码/转码链**,只保留 AMR 直通路径。发送侧必须保证上传 AMR,或在 QLinker 侧先转码为 AMR。",
"file 传 NapCat 宿主机本地绝对路径(history record 段的 path 字段原值)仍 retcode=1200 'Failed to open input'。可用途径仅两条:QQ CDN 新鲜直链、base64://<字节>。禁止依赖本地路径。",
"can_send_record=yes 未区分载荷格式,与 silk 失败矛盾,再次印证 GC-002:上游自检不可采信。",
"转码/读回接口 get_record 与本能力是两回事:真实 amr 的 file/url/path × mp3/wav/silk 共 9 组全部 retcode=1200,自造 WAV 内联形式全部 'file not found'(不接受内联载荷)。故 get_record 既不能用于验证也不能用于转码,标 blocked,见 MSG-record-transcode。"
],
"todo": ["私聊 send_private_msg 的 amr 载荷未测,private 支持度不得提前宣称。", "确认 QLinker 侧 AMR 转码方案(发送前转码 vs 仅接受 AMR 上传)并写入功能设计。", "silk 支持需换用具备完整解码依赖的 NapCat 部署重测,属上游环境项。"]
},
{
"id": "MSG-record-silk",
"name": "语音段 silk 载荷(负向对照)",
"kind": "message-segment",
"api": ["send_group_msg", "send_private_msg"],
"supports": [],
"sendStatus": "rejected",
"eventStatus": "rejected",
"historyStatus": "rejected",
"parseStatus": "pending",
"automationTest": "record-probe 7 种传法全部 retcode=1200(b64_plain / b64_format_silk / b64_name_silk / url_plain / url_field / url_format_silk / b64_url_both)",
"automationTest": "record-probe: 7 种 silk 传法(b64_plain / b64_format_silk / b64_name_silk / url_plain / url_field / url_format_silk / b64_url_both)全部 retcode=1200;record-amr-probe 同传法下 amr 成功,构成载荷格式对照",
"realEnvTest": "verified",
"regressionProbe": { "probe": "record", "case": "b64_plain", "expect": { "retcode": 1200, "messageContains": "Failed to open input" } },
"limitations": [
"定性结论:受 NapCat 运行环境解码能力限制,非素材非法。已用 NapCat 自己 get_ai_record 产出并下载的素材(magic=03232153494c4b5f5633,即 \\x03#!SILK_V3,合法 silk v3)重试,仍失败。",
"错误原文分两阶段:WAV 素材 -> 'No decodable audio stream: Decoder not found';合法 silk -> 'Failed to open input: Invalid data found when processing input'。两者均为上游解码器缺失特征。",
"can_send_record=yes 与此矛盾,采信后者(GC-002)。",
"上游 NapCat 侧前提条件:需要可用的音频解码组件(ffmpeg/silk 解码链)。本环境未确认缺失原因,属待验证。"
"素材为 NapCat 自己 get_ai_record 产出并下载的合法 silk v3(magic 03232153494c4b5f5633,即 \\x03#!SILK_V3,0x03 前缀来自 QQ 官方),排除我方构造错误。",
"本项是 MSG-record 的负向对照,用于在回归中区分『silk 仍不支持』与『AMR 路径也坏了』。若本项 retcode 变为 0,说明上游解码链已补齐,需重新评估 MSG-record 的转码要求。"
],
"todo": ["换用具备完整解码依赖的 NapCat 部署重测,以区分『本环境缺依赖』与『该版本功能损坏』。"]
"todo": ["换用具备完整 silk 解码依赖的 NapCat 部署重测。"]
},
{
"id": "MSG-record-transcode",
"name": "语音转码读回 get_record",
"kind": "message-segment",
"api": ["get_record"],
"supports": [],
"sendStatus": "not_applicable",
"eventStatus": "not_applicable",
"historyStatus": "blocked",
"parseStatus": "pending",
"automationTest": "record-decoder-probe: 真实 amr 的 file/url/path 三种表达 × out_format=mp3/wav/silk 共 9 组,get_record 成功 0/9",
"realEnvTest": "blocked",
"regressionProbe": { "probe": "recordDecoder", "case": "get_record.file.mp3", "expect": { "retcode": 1200 } },
"limitations": [
"错误原文三类:file 形式 'Failed to open input: Invalid data found when processing input';url/path 形式 'file not found';out_format=silk 时 '转换失败 out_format 字段可能格式不正确'。",
"正向对照不成立:自造合法 WAV(RIFF,8044B)以 base64://、data URI、裸 base64、b64 字段四种内联形式提交,全部 'file not found' → get_record 不接受内联载荷,因此**无法据此区分『缺 ffmpeg』与『只缺 silk/amr 解码器』**,本项只记为环境受阻,不得写成已定性。",
"影响:QLinker 不能依赖 get_record 做语音转码或可读性校验,媒体落库需自行处理 AMR(与 GC-006 的 URL 时效约束叠加,必须现取现转存 MinIO)。"
],
"todo": ["在具备 ffmpeg 的 NapCat 部署上重跑 record-decoder-probe,才能真正区分缺哪个组件。"]
},
{
"id": "MSG-record-via-ai",
@@ -297,22 +368,51 @@
"id": "MSG-forward-read",
"name": "合并转发消息(读回)",
"kind": "message-segment",
"api": ["get_forward_msg"],
"api": ["get_forward_msg", "get_msg"],
"supports": [],
"sendStatus": "readback_gap",
"eventStatus": "readback_gap",
"historyStatus": "readback_gap",
"parseStatus": "pending",
"automationTest": "穷举 8 种参数组合全部失败:{message_id} / {message_id:String} / {message_id,group_id} / {id} / {forward_id} / {forward_id,message_id} / {res_id,message_id} / {resid,uniseq}",
"automationTest": "forward-readback-probe 穷举 19 种参数组合 + 对 8 条外层 multimsg 消息逐条重试,全部失败;同时逐条解析 9 条外层消息的 meta.detail.news 判定可还原性",
"realEnvTest": "verified",
"regressionProbe": { "probe": "forwardFollowup", "case": "get_forward_msg", "expect": { "retcode": 1200 } },
"regressionProbe": { "probe": "forwardReadback", "case": "outer:outer_mid", "expect": { "retcode": 1200, "messageContains": "无法获取转发消息" } },
"limitations": [
"确定结论:被转发消息不可还原。get_forward_msg 存在(缺 message_id 时回 'message_id is required',说明接口被路由到了),但即使传入发送接口当场返回的 forward_id/res_id/message_id 组合,仍回 '消息已过期或者为内层消息,无法获取转发消息'。",
"该接口不在 docs/NapcatOpenAPI.md 的 API 清单中(清单只有 send_forward_msg / send_group_forward_msg / send_private_forward_msg),属未文档化的残缺实现。",
"唯一可用的还原来源是 json 段的 meta.detail.news,但它是 '昵称: 文本' 的降级字符串,媒体与结构化段信息已丢失。",
"标准化模型必须保留:json.data.data 原始 JSON、meta.detail.resid、meta.detail.uniseq、meta.detail.news 数组、app 字段。不得只存 prompt/summary。"
"确定结论:被转发条目【无法结构化还原】。get_forward_msg 存在(缺 message_id 时回 'message_id is required',证明已被路由),但对 history 当场回读到的 8 条外层 multimsg 消息(含本轮几分钟前刚发出、seq=3115/mid=1978018074 的最新一条)逐条调用,全部 retcode=1200 '消息已过期或者为内层消息,无法获取转发消息'。最新鲜的消息同样失败 ⇒ 排除『消息已过期』,属接口能力缺口,不是时序问题。",
"此前 8 组参数全用 mid=497853103,该 id 实为 seq=3090 的【外层】multimsg 消息(不是内层),所以旧结论方向正确但依据有缺陷;本轮已对全部外层 id 与 resid/uniseq/filename/forward_id 组合重测,结论不变。",
"get_forward_msg 不在 docs/NapcatOpenAPI.md 的 API 清单中(清单只有 send_forward_msg / send_group_forward_msg / send_private_forward_msg),属未文档化的残缺实现。get_group_msg 直接 1404 不支持。",
"⚠️ news[].text 的『可解析性』是发送形态的假象,不是还原能力:9 条外层消息中只有 seq=3101 与私聊 seq=1238 能 JSON.parse 成功,而这两条恰恰是【发送形态用错】的那两条(node.content 传 JSON 字符串,被当字面文本渲染)。能 parse 出来的是我们误发的字面串,不是协议还原的结构。",
"正确发送形态(node.content 传段数组)的 5 条消息,news[].text 全是 '昵称: 纯文本'(如 '雪珂: 数组形-A'、'雪珂: 纯节点一'、'雪珂: 并列节点一'),段类型与嵌套结构在 news 里【已不可逆丢失】。⇒ 依赖 news 还原只能拿到文本摘要,必须按降级摘要对待。",
"⚠️ 未采到的边界:上述 5 条正确形态样本的节点内容全部是 text,没有『正确形态 + image/record 等非文本节点』的样本。因此媒体节点在正确形态转发的 news 里具体降级成什么形态【无实测依据】,只能确定拿不回段数组。不得宣称『转发内的媒体只是降级为文本』。",
"get_msg 是本项唯一可用的读回接口:对群与私聊的外层转发消息均 retcode=0,返回与 history 同构的完整消息对象(含 message 段数组、real_seq、sender),可拿到 json 段原文。它读回的是外层卡片,仍读不到内层节点。",
"标准化模型对转发段必须保留:json.data.data 原始 JSON 全文、app、view、desc/prompt、extra.filename、extra.tsum、meta.detail.resid、meta.detail.uniseq、meta.detail.source、meta.detail.summary、meta.detail.news 数组原文。不得只存 prompt/summary。resid/uniseq 即使当前无法用于读回也必须保留,供上游修复后重放。",
"⚠️ meta.detail.resid 不是恒定存在:seq=3085/3088 两条 tsum=0 的静默失效消息,detail_keys 实测只有 news/source/summary/uniseq(无 resid)⇒ 该字段必须按可空建模;'缺 resid' 可作为静默失效的辅助判据。",
"落库必须同时记录 forwardNodeFormSuspect 之类的形态标记:news 项是否为段数组字面串,可反推当初是 content:string 还是 content:array,用于识别被当字面文本渲染的静默语义损坏。"
],
"todo": ["升级 NapCat 后必须重测本项;一旦可读回,news 降级问题即可解除。"]
"todo": [
"升级 NapCat 后必须重跑 forward-readback-probe.mjs(只读、零副作用);一旦 get_forward_msg 可读回,news 降级问题即可解除。",
"resid/uniseq 的官方语义仍未查明,上游修复后需重测。"
]
},
{
"id": "OP-get-msg",
"name": "单条消息读回",
"kind": "operation",
"api": ["get_msg"],
"supports": ["group", "private"],
"sendStatus": "not_applicable",
"eventStatus": "not_applicable",
"historyStatus": "verified",
"parseStatus": "pending",
"automationTest": "forwardReadback: outer:get_msg -> retcode=0,返回完整消息对象(self_id/user_id/time/message_id/message_seq/real_id/real_seq/message_type/sender/message 段数组)",
"realEnvTest": "verified",
"regressionProbe": { "probe": "forwardReadback", "case": "outer:get_msg", "expect": { "retcode": 0 } },
"limitations": [
"与 get_group_msg_history 相比是不依赖窗口/分页的单条精确读回路径,可用于事件漏采后的定点补偿对账。",
"读不回合并转发的内层节点(见 MSG-forward-read)。",
"get_group_msg 不存在(1404 不支持的API),不得在代码中引用该名字。"
],
"todo": []
},
{
"id": "MSG-file",
@@ -329,7 +429,8 @@
"regressionProbe": { "probe": "matrix", "case": "g_upload_file", "expect": { "retcode": 0, "eventSegs": "NO_EVENT" } },
"limitations": [
"上传成功但入站事件通道完全无回推(含 upload 类 notice),延长到 20s 仍为 0 条。依赖事件驱动落库的链路会永久漏采文件消息,必须靠 history 主动补拉兜底。",
"upload_group_file 返回 retcode=0 但不返回 file_id,只能从 history 的 file 段取 file_id。",
"upload_group_file 返回 retcode=0 但不返回 file_id。file_id 有两条读回路径:history 的 file 段,或 get_group_root_files(实测 retcode=0,直接给出 file_id/file_name/size/uploader/modify_time,见 GC-011)。后者不受 history 窗口限制,应作为文件补拉与下载的首选。",
"get_group_file_url 用上述 file_id 可换到下载直链(实测 retcode=0,返回 ftn.qq.com 直链);传入不存在的 file_id 时报 'real fileUUID not found!'。",
"history 的 file 段 file_name 字段为 '-',真实文件名在 data.file 与 url 的 fname 参数里。"
],
"todo": ["私聊 upload_file 的事件回推同样缺失,需确认是通道问题还是接口行为。"]