Files
QLinker/docs/capability-baseline.json
T
xiaowang 4c2b5cb61c docs(p1): 纠正接入链路方向性误判,HTTP 回调状态由 blocked 回退 untested
第 17.3 把三条链路当同一类定性,方向搞错:httpServers 是 QLinker→NapCat
(查端口映射/宿主 DROP),httpClients 与 websocketClients 是 NapCat→QLinker
主动外连(查路由 + 本机 Windows 防火墙入站规则,本地可控)。故 HTTP Server
的受阻原因对后两条完全不适用。

且回调实测只试了 10.66.0.5 一个隧道地址,proxy 可达性也只试 3 个隧道地址;
本机 192.168.200.3(以太网) 与 192.168.43.173(WLAN) 从未实测 ⇒ 「拓扑受限」
当时不成立。

- LINK-http-callback: blocked → untested,补齐依据缺口说明
- LINK-reverse-ws: 删除「预期同样不可达」推断依据,保持 untested
- LINK-http-server: 保持 blocked(该条方向与依据均成立)
- 新增 GC-013:判定链路受阻前必须确定 TCP 发起方,三条链路不可互相外推;
  并登记零副作用预检法(proxy 探本机端口,refused=可达 / timeout=无路由)
- 第 17.3 就地标注推断缺陷,新增第 23 章完整纠正
2026-10-29 16:36:34 +08:00

712 lines
43 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"meta": {
"purpose": "NapCat 能力目录基线(机器可读)。DEC-005 决策为『不锁 NapCat 版本,但升级必须跑全量回归』,本文件即该回归的门禁基线:tools/probe/capability-check.mjs 以此比对实测结果,状态漂移即门禁失败。",
"governance": [
"本文件只登记实测证据支持的结论,禁止把设计目标或上游文档声明写成已验证。",
"status 取值语义见 enums.status;任何项不得留空,未采到必须用 untested 并在 todo 说明阻塞原因。",
"变更本文件必须同时提供证据文件名(evidence),且证据文件位于 gitignored 的 local/ 目录,文件名需在 docs/decision-baseline.md 可检索。"
],
"targetNapCat": {
"protocol_version": "v11",
"version_observed": "4.18.41",
"platform": "linux",
"note": "DEC-005 不锁版本。version_observed 仅为本次基线采集时的实际版本,升级后必须重跑 capability-check。"
},
"collectedAt": "2026-10-29",
"environment": {
"transport": "forward-websocket",
"authConfirmedBy": "meta_event/lifecycle",
"testGroup": 933280401,
"testFriend": 2161656029,
"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",
"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": {
"verified": "三证据一致通过:API 成功、事件段与提交段一致、history 回读段一致。",
"silent_drop": "API retcode=0,但该消息段在事件与 history 中均消失,仅余其它段。上游假成功。",
"downgraded": "API retcode=0 且消息送达,但段被改写为其它类型(通常降级为 text),语义丢失。",
"no_event": "API retcode=0 且 history 可回读到该消息,但入站事件通道完全无回推。",
"rejected": "API 返回非 0 retcode,消息未发出,有明确错误原文。",
"readback_gap": "写入成功但读回接口不可用或读不回内容,属能力缺口。",
"blocked": "受部署/网络/配置条件限制本轮无法采集,不等于不支持。",
"untested": "本轮未采集,无结论。",
"not_applicable": "该维度对此能力不存在(例如纯入站事件没有 history 回读形态)。"
},
"realEnvTest": {
"verified": "已在真实 NapCat 4.18.41 环境完成验证。",
"partial": "部分场景已验证,仍有子场景未覆盖(见 limitations/todo)。",
"blocked": "环境条件受阻,未能验证。",
"not_tested": "本轮未做真实环境验证。"
},
"adapterStatus": {
"pending": "QLinker 侧解析/发送适配尚未实现(当前仓库无 Java 业务代码,全部为 pending)。"
}
},
"globalConstraints": [
{
"id": "GC-001",
"title": "retcode=0 不等于送达,也不等于语义完整",
"detail": "实测存在三类假成功:段被静默丢弃(poke/location/私聊 at)、降级为 text(music 的 url 形式)、成功但零事件回推(file/上传群文件)。判定必须以事件段数组与 history 段数组比对为准。",
"evidence": ["local/matrix-result-2026-10-29T06-48-10-358Z.jsonl", "local/history-audit-1793256740235.jsonl"]
},
{
"id": "GC-002",
"title": "上游自检类 API 不可信",
"detail": "can_send_record 返回 data.yes=true,但真实 record 发送(含合法 silk v3 素材)全部 retcode=1200。能力判定禁止采信上游 can_* 探测,必须真实发送 + 回读。",
"evidence": ["local/record-probe-2026-10-29T06-51-01-418Z.jsonl"]
},
{
"id": "GC-003",
"title": "自发消息的 post_type 不是 message",
"detail": "自己发出的消息回推 post_type=message_sent,并带 message_sent_type=self。接收链路若只匹配 post_type==message 会完全漏掉自发消息。target_id 与 message_sent_type 仅事件通道有,history 无。",
"evidence": ["local/url-media-2026-10-29T06-56-59-995Z.jsonl"]
},
{
"id": "GC-004",
"title": "raw_message 含 HTML 实体转义,禁止用简单正则切 CQ 码",
"detail": "history 的 raw_message 把 [ ] , 等转义为 [ ] ,。按文本标记匹配消息会失败,必须用 message_id 关联。",
"evidence": ["local/dump-145523.jsonl"]
},
{
"id": "GC-005",
"title": "message_id 不是序号",
"detail": "message_id == message_seq == real_id,为随机大整数,不可跨会话比较、不递增。群内唯一稳定递增标识是 real_seq(字符串)。去重键候选 (bindingUid, group_id, real_seq) 仍待验证。",
"evidence": ["docs/decision-baseline.md#19"]
},
{
"id": "GC-006",
"title": "媒体 CDN URL 含 rkey,具时效",
"detail": "跨轮次复用历史 URL 会失效。采集 URL 形式媒体必须『现发现用』,且发送前先 HEAD/GET 验证可达,否则会把 URL 过期误判成 NapCat 不支持 URL 形式。",
"evidence": ["local/url-media-2026-10-29T06-56-59-995Z.jsonl"]
},
{
"id": "GC-007",
"title": "get_ai_record 名义为查询接口,实际会真实发送语音消息",
"detail": "安全影响重大:调用前 history 有 4 条 record 消息,调用一次后新增 1 条,且新增消息的 CDN fileid 与接口返回值完全一致。该接口必须按写操作纳入权限、限流、审计与副作用管控,禁止当作只读探测使用。",
"severity": "high",
"evidence": ["local/ai-record-sideeffect-*.jsonl", "local/dump-145523.jsonl"]
},
{
"id": "GC-008",
"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"]
},
{
"id": "GC-013",
"title": "判定接入链路受阻前必须先确定 TCP 连接发起方,三条链路不可互相外推",
"detail": "httpServers 由 QLinker 主动连 NapCat(受阻查 NapCat 侧端口映射/宿主防火墙);httpClients 与 websocketClients 由 NapCat 主动连 QLinker(受阻查 NapCat→本机路由与开发机自身防火墙入站规则,属本地可控)。三条链路方向与排查位置不同,禁止用一条的受阻原因给另一条定性。当前实测仅覆盖 3 个隧道地址(10.66.0.5 / 10.66.0.4 映射地址 / 100.121.146.35),本机 192.168.200.3 与 192.168.43.173 从未实测,故 LINK-http-callback 由 blocked 回退为 untested。零副作用预检法:NapCat GET /api/base/proxy 探本机端口 + 本机 sink 监听,refused=路由可达、timeout=无可达路由,无需改 OB11 配置也无需重启。",
"evidence": ["docs/decision-baseline.md#23"]
}
],
"capabilities": [
{
"id": "MSG-text",
"name": "文本段",
"kind": "message-segment",
"api": ["send_group_msg", "send_private_msg"],
"supports": ["group", "private"],
"sendStatus": "verified",
"eventStatus": "verified",
"historyStatus": "verified",
"parseStatus": "pending",
"automationTest": "matrix-probe: g_text/p_text + history-audit 16/16 命中",
"realEnvTest": "verified",
"regressionProbe": { "probe": "matrix", "case": "g_text", "expect": { "retcode": 0, "eventSegs": "text", "historySegs": "text" } },
"limitations": ["实测 5000 字长文本不截断(seg-probe: long_text)。"],
"todo": []
},
{
"id": "MSG-at",
"name": "@ 成员段",
"kind": "message-segment",
"api": ["send_group_msg"],
"supports": ["group"],
"sendStatus": "verified",
"eventStatus": "verified",
"historyStatus": "verified",
"parseStatus": "pending",
"automationTest": "matrix-probe: g_at_all -> at+text(群)",
"realEnvTest": "verified",
"regressionProbe": { "probe": "matrix", "case": "g_at_all", "expect": { "retcode": 0, "eventSegs": "at+text", "historySegs": "at+text" } },
"limitations": [
"@全体可用:at.data.qq == \"all\"(字面量字符串),且 get_group_at_all_remain 返回 can_at_all=true、群剩 19 次/个人剩 9 次。",
"私聊 at 段被静默丢弃(见 MSG-at-private)。"
],
"todo": []
},
{
"id": "MSG-at-private",
"name": "@ 段用于私聊",
"kind": "message-segment",
"api": ["send_private_msg"],
"supports": [],
"sendStatus": "silent_drop",
"eventStatus": "silent_drop",
"historyStatus": "silent_drop",
"parseStatus": "pending",
"automationTest": "matrix-probe: p_at -> retcode=0,事件与 history 段均只剩 text",
"realEnvTest": "verified",
"regressionProbe": { "probe": "matrix", "case": "p_at", "expect": { "retcode": 0, "eventSegs": "text", "historySegs": "text" } },
"limitations": ["典型假成功:retcode=0 但 at 段消失。标准化模型不得据此认为 at 生效。"],
"todo": []
},
{
"id": "MSG-face",
"name": "表情段",
"kind": "message-segment",
"api": ["send_group_msg", "send_private_msg"],
"supports": ["group", "private"],
"sendStatus": "verified",
"eventStatus": "verified",
"historyStatus": "verified",
"parseStatus": "pending",
"automationTest": "matrix-probe: g_face/p_face -> face+text",
"realEnvTest": "verified",
"regressionProbe": { "probe": "matrix", "case": "g_face", "expect": { "retcode": 0, "eventSegs": "face+text", "historySegs": "face+text" } },
"limitations": [
"face.data.raw 是 19 字段大对象(faceIndex/faceText/faceType 等),按 ADR-013 必须整体保留原始 JSON,不得只取 id。"
],
"todo": []
},
{
"id": "MSG-image",
"name": "图片段(base64 与 URL 两种形式)",
"kind": "message-segment",
"api": ["send_group_msg", "send_private_msg"],
"supports": ["group", "private"],
"sendStatus": "verified",
"eventStatus": "verified",
"historyStatus": "verified",
"parseStatus": "pending",
"automationTest": "matrix-probe: p_image_b64 -> image+text;url-media-probe: g_image_url -> image+text(事件与 history 均命中)",
"realEnvTest": "verified",
"regressionProbe": { "probe": "urlMedia", "case": "g_image_url", "expect": { "retcode": 0, "eventSegs": "image+text", "historySegs": "image+text" } },
"limitations": [
"URL 形式可用,但必须先现场取 URL 且验证可下载(GC-006)。",
"回推段带 file_size 与 url,url 指向带 rkey 的时效 CDN,落库须转存 MinIO,不得直接持久化该 URL。"
],
"todo": ["超大图与非法图片内容的边界未测。"]
},
{
"id": "MSG-video",
"name": "视频段(base64 与 URL 两种形式)",
"kind": "message-segment",
"api": ["send_group_msg", "send_private_msg"],
"supports": ["group", "private"],
"sendStatus": "verified",
"eventStatus": "verified",
"historyStatus": "verified",
"parseStatus": "pending",
"automationTest": "matrix-probe: g_video_b64 -> text+video;url-media-probe: g_video_url -> text+video",
"realEnvTest": "verified",
"regressionProbe": { "probe": "urlMedia", "case": "g_video_url", "expect": { "retcode": 0, "eventSegs": "text+video", "historySegs": "text+video" } },
"limitations": [
"不校验内容合法性:70 字节的 PNG 伪装成 video 也 retcode=0 并成功落库。发送侧必须自行做类型与大小校验,不能依赖上游。"
],
"todo": ["真实编码视频的可播放性未验证。"]
},
{
"id": "MSG-record",
"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 种 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 自己 get_ai_record 产出并下载的合法 silk v3(magic 03232153494c4b5f5633,即 \\x03#!SILK_V3,0x03 前缀来自 QQ 官方),排除我方构造错误。",
"本项是 MSG-record 的负向对照,用于在回归中区分『silk 仍不支持』与『AMR 路径也坏了』。若本项 retcode 变为 0,说明上游解码链已补齐,需重新评估 MSG-record 的转码要求。"
],
"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",
"name": "语音消息(官方 TTS 旁路)",
"kind": "message-segment",
"api": ["send_group_ai_record", "get_ai_record"],
"supports": ["group"],
"sendStatus": "no_event",
"eventStatus": "no_event",
"historyStatus": "verified",
"parseStatus": "pending",
"automationTest": "fwd-record-followup: send_group_ai_record -> retcode=0 但 data.message_id=0;history 可回读 record 段",
"realEnvTest": "verified",
"regressionProbe": { "probe": "forwardFollowup", "case": "ai_record_group", "expect": { "retcode": 0 } },
"limitations": [
"这是当前唯一能让语音消息进入群的路径,但 send_group_ai_record 返回 data.message_id=0(假标识),必须靠事件或 history 反查真实 message_id。",
"get_ai_record 会真实发消息(GC-007),高风险。",
"record 段本身不可用(MSG-record)与此不矛盾:TTS 走的是上游另一条上传链路。"
],
"todo": ["send_private_ai_record 未测。"]
},
{
"id": "MSG-reply",
"name": "引用回复段(含嵌套引用)",
"kind": "message-segment",
"api": ["send_group_msg", "send_private_msg"],
"supports": ["group", "private"],
"sendStatus": "verified",
"eventStatus": "verified",
"historyStatus": "verified",
"parseStatus": "pending",
"automationTest": "matrix-probe: g_reply_1/g_reply_nested/p_reply -> reply+text",
"realEnvTest": "verified",
"regressionProbe": { "probe": "matrix", "case": "g_reply_nested", "expect": { "retcode": 0, "eventSegs": "reply+text", "historySegs": "reply+text" } },
"limitations": [
"引用嵌套可用:对『本身含 reply 段的消息』再引用,成功。reply.data.id 指向被引用消息的 message_id。",
"上游只给 id,不回推被引用消息的正文与发送者。标准化模型若要展示引用摘要,必须自行按 message_id 反查本地库,且要处理被引用消息不在当前 history 窗口的情况。"
],
"todo": []
},
{
"id": "MSG-forward-write",
"name": "合并转发消息(写出)",
"kind": "message-segment",
"api": ["send_group_msg(node 段)", "send_group_forward_msg", "send_private_forward_msg"],
"supports": ["group", "private"],
"sendStatus": "verified",
"eventStatus": "verified",
"historyStatus": "verified",
"parseStatus": "pending",
"automationTest": "fwd-record-followup: fwd_group_content_arr -> json 段,news=[雪珂: 数组形-A, 小王: 数组形-B];seg-probe: node_multi -> tsum=3",
"realEnvTest": "verified",
"regressionProbe": { "probe": "forwardFollowup", "case": "fwd_group_content_arr", "expect": { "retcode": 0, "eventSegs": "json", "newsCount": 2 } },
"limitations": [
"node.data.content 必须是【消息段数组】。传 JSON 字符串会被当字面文本渲染(matrix-probe: g_forward_api 的 news 里出现被转义的 {\"type\":\"text\"...} 原文),这是典型静默语义损坏。",
"forward 段的 data.nodes 容器形式无效(tsum=0);必须用并列 node 段或 send_*_forward_msg 的 messages 数组。",
"落库形态是 json 段(app=com.tencent.multimsg),真实节点内容在 meta.detail.news,每项是 '昵称: 内容' 的拼接字符串,非结构化段数组。",
"send_group_msg 里 node 段与 text 段混用会 retcode=1400;纯 node 段数组才 retcode=0。"
],
"todo": []
},
{
"id": "MSG-forward-read",
"name": "合并转发消息(读回)",
"kind": "message-segment",
"api": ["get_forward_msg", "get_msg"],
"supports": [],
"sendStatus": "readback_gap",
"eventStatus": "readback_gap",
"historyStatus": "readback_gap",
"parseStatus": "pending",
"automationTest": "forward-readback-probe 穷举 19 种参数组合 + 对 8 条外层 multimsg 消息逐条重试,全部失败;同时逐条解析 9 条外层消息的 meta.detail.news 判定可还原性",
"realEnvTest": "verified",
"regressionProbe": { "probe": "forwardReadback", "case": "outer:outer_mid", "expect": { "retcode": 1200, "messageContains": "无法获取转发消息" } },
"limitations": [
"确定结论:被转发条目【无法结构化还原】。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 后必须重跑 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",
"name": "文件段与群文件上传",
"kind": "message-segment",
"api": ["send_group_msg(file 段)", "upload_group_file"],
"supports": ["group"],
"sendStatus": "no_event",
"eventStatus": "no_event",
"historyStatus": "verified",
"parseStatus": "pending",
"automationTest": "matrix-probe: g_upload_file/p_upload_file -> retcode=0 且事件 NO_EVENT;followup 延长观测 20s 仍 0 条事件;history seq=3108 可回读 file 段",
"realEnvTest": "verified",
"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。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 的事件回推同样缺失,需确认是通道问题还是接口行为。"]
},
{
"id": "MSG-music",
"name": "音乐分享段",
"kind": "message-segment",
"api": ["send_group_msg"],
"supports": ["group"],
"sendStatus": "downgraded",
"eventStatus": "downgraded",
"historyStatus": "downgraded",
"parseStatus": "pending",
"automationTest": "matrix-probe: g_music_url({type,url})-> retcode=0 但段只剩 text;music{type:163,id} -> retcode=1200",
"realEnvTest": "verified",
"regressionProbe": { "probe": "matrix", "case": "g_music_url", "expect": { "retcode": 0, "eventSegs": "text", "historySegs": "text" } },
"limitations": [
"两种不同失败模式,都必须记录:{type:'163',id} 形式被明确拒绝(1200);{type,url} 形式 retcode=0 但整条被降级为纯文本,音乐卡片丢失。",
"降级为 text 属静默语义丢失,标准化模型若按事件段解析会认为这是一条普通文本消息。"
],
"todo": ["未穷举 music 的其它字段组合(如 subtype/content/url 完整三元组),不得宣称音乐分享完全不可用。"]
},
{
"id": "MSG-ark",
"name": "ARK 消息段",
"kind": "message-segment",
"api": ["send_group_msg"],
"supports": [],
"sendStatus": "rejected",
"eventStatus": "rejected",
"historyStatus": "rejected",
"parseStatus": "pending",
"automationTest": "matrix-probe: g_ark -> retcode=1200",
"realEnvTest": "verified",
"regressionProbe": { "probe": "matrix", "case": "g_ark", "expect": { "retcode": 1200, "messageContains": "未知的消息类型" } },
"limitations": ["错误原文 '未知的消息类型:ark' —— 该版本消息段解析器不识别 ark。"],
"todo": []
},
{
"id": "MSG-location",
"name": "位置段",
"kind": "message-segment",
"api": ["send_group_msg"],
"supports": [],
"sendStatus": "silent_drop",
"eventStatus": "silent_drop",
"historyStatus": "silent_drop",
"parseStatus": "pending",
"automationTest": "matrix-probe: g_location -> retcode=0,seq=3103,事件与 history 段均只剩 text(复测两次一致)",
"realEnvTest": "verified",
"regressionProbe": { "probe": "matrix", "case": "g_location", "expect": { "retcode": 0, "eventSegs": "text", "historySegs": "text" } },
"limitations": ["静默丢弃,无错误提示。"],
"todo": []
},
{
"id": "MSG-poke",
"name": "戳一戳",
"kind": "message-segment",
"api": ["send_poke", "group_poke", "friend_poke"],
"supports": ["group", "private"],
"sendStatus": "verified",
"eventStatus": "verified",
"historyStatus": "untested",
"parseStatus": "pending",
"automationTest": "seg-probe: poke 消息段被静默丢弃;改用 send_poke 接口成功",
"realEnvTest": "partial",
"regressionProbe": { "probe": "manual", "case": "poke", "expect": { "note": "消息段形态无效,必须走 send_poke 接口" } },
"limitations": [
"poke 作为消息段无效(静默丢弃),必须用独立接口 send_poke/group_poke/friend_poke。",
"history 回读未采(戳一戳是否入 history 未确认)。"
],
"todo": ["补 poke 的 history 回读证据。"]
},
{
"id": "MSG-json",
"name": "JSON 卡片段(json/markdown)",
"kind": "message-segment",
"api": ["send_group_msg", "send_private_msg"],
"supports": ["group", "private"],
"sendStatus": "verified",
"eventStatus": "verified",
"historyStatus": "verified",
"parseStatus": "pending",
"automationTest": "matrix-probe: p_json -> json+text",
"realEnvTest": "verified",
"regressionProbe": { "probe": "matrix", "case": "p_json", "expect": { "retcode": 0, "eventSegs": "json+text", "historySegs": "json+text" } },
"limitations": ["事件与 history 均给 json 段原文,但卡片是否真正渲染未做客户端目视确认。"],
"todo": []
},
{
"id": "MSG-unknown-seg",
"name": "未知消息段与空消息数组",
"kind": "message-segment",
"api": ["send_group_msg"],
"supports": [],
"sendStatus": "rejected",
"eventStatus": "rejected",
"historyStatus": "rejected",
"parseStatus": "pending",
"automationTest": "seg-probe: 未知段类型与空 message 数组均 retcode=1200,整条失败",
"realEnvTest": "verified",
"regressionProbe": { "probe": "segments", "case": "unknown_type", "expect": { "retcode": 1200 } },
"limitations": ["上游对未知段是整条拒绝而非忽略,发送侧必须自行过滤未知段,否则一条坏段会让整条消息发不出去。"],
"todo": []
},
{
"id": "OP-recall",
"name": "撤回/删除消息",
"kind": "operation",
"api": ["delete_msg"],
"supports": ["group", "private"],
"sendStatus": "verified",
"eventStatus": "verified",
"historyStatus": "verified",
"parseStatus": "pending",
"automationTest": "seg-probe: recall_msg -> retcode=1404(接口不存在);delete_msg -> retcode=0,回推 notice/group_recall,history message=[]",
"realEnvTest": "verified",
"regressionProbe": { "probe": "manual", "case": "recall", "expect": { "recall_msg_retcode": 1404, "delete_msg_retcode": 0 } },
"limitations": [
"recall_msg 不存在(1404),必须用 delete_msg。",
"撤回后 history 的 message 变成空数组,且【没有】 is_recall 标记。区分『空消息』与『已撤回』只能靠本地状态机 + notice/group_recall 事件,不得依赖上游标记。"
],
"todo": []
},
{
"id": "EV-lifecycle",
"name": "连接认证确认(lifecycle)",
"kind": "event",
"api": [],
"supports": ["transport"],
"sendStatus": "verified",
"eventStatus": "verified",
"historyStatus": "not_applicable",
"parseStatus": "pending",
"automationTest": "所有探测脚本以收到 meta_event/lifecycle 作为认证确认门禁",
"realEnvTest": "verified",
"regressionProbe": { "probe": "any", "case": "lifecycle", "expect": { "required": true } },
"limitations": ["见 GC-008:onopen 不代表认证成功。"],
"todo": []
},
{
"id": "EV-self-sent",
"name": "自发消息回推",
"kind": "event",
"api": [],
"supports": ["group", "private"],
"sendStatus": "verified",
"eventStatus": "verified",
"historyStatus": "verified",
"parseStatus": "pending",
"automationTest": "url-media-probe 事件 post_type=message_sent,含 message_sent_type=self 与 target_id",
"realEnvTest": "verified",
"regressionProbe": { "probe": "urlMedia", "case": "g_image_url", "expect": { "postType": "message_sent" } },
"limitations": ["见 GC-003。"],
"todo": []
},
{
"id": "EV-notice",
"name": "群通知类事件(成员增减/管理员变动/群文件/戳一戳通知)",
"kind": "event",
"api": [],
"supports": [],
"sendStatus": "untested",
"eventStatus": "untested",
"historyStatus": "untested",
"parseStatus": "pending",
"automationTest": "未采集",
"realEnvTest": "not_tested",
"regressionProbe": null,
"limitations": ["本轮矩阵事件文件中 notice/request 类事件为 0 条,但原因未定性:可能是无人触发(需真实第二账号操作),也可能是通道不推送。二者不得混为一谈。"],
"todo": [
"需用户在 QQ 端配合的清单(本轮按约定不采集,标记为待验证):群成员加入/退出、群管理员任命/撤销、群文件上传通知(他人上传)、好友申请、群内戳一戳通知、撤回他人消息。",
"群文件通知已单独排除『等待时间不足』:upload_group_file 后连续观测 20s 收到 0 条事件。"
]
},
{
"id": "LINK-forward-ws",
"name": "正向 WebSocket 入站链路",
"kind": "transport",
"api": [],
"supports": ["inbound"],
"sendStatus": "verified",
"eventStatus": "verified",
"historyStatus": "not_applicable",
"parseStatus": "pending",
"automationTest": "本轮全部采样经此链路完成",
"realEnvTest": "verified",
"regressionProbe": { "probe": "any", "case": "connect", "expect": { "required": true } },
"limitations": ["心跳 status 为嵌套对象 {online,good},间隔 3000ms。"],
"todo": []
},
{
"id": "LINK-http-server",
"name": "HTTP Server 入站链路",
"kind": "transport",
"api": [],
"supports": [],
"sendStatus": "blocked",
"eventStatus": "blocked",
"historyStatus": "not_applicable",
"parseStatus": "pending",
"automationTest": "未通过",
"realEnvTest": "blocked",
"regressionProbe": null,
"limitations": ["实测 3000 端口 timeout。受阻不等于不支持。"],
"todo": ["用户已授权临时改 OB11 通道配置 + 自动重启补采(采完必须回滚并逐字段校验一致)。本轮未执行,留待下一轮。"]
},
{
"id": "LINK-http-callback",
"name": "HTTP 回调入站链路",
"kind": "transport",
"api": [],
"supports": [],
"sendStatus": "untested",
"eventStatus": "untested",
"historyStatus": "not_applicable",
"parseStatus": "pending",
"automationTest": "未通过",
"realEnvTest": "not_tested",
"regressionProbe": null,
"limitations": [
"⚠️ 状态曾误标 blocked,依据不完整(第 23 章纠正):本链路的 TCP 连接由 NapCat 主动发起,受阻应查路由可达性与开发机自身防火墙入站规则,与 HTTP Server 的端口映射/宿主 DROP 无关。",
"已实测不可达的仅 3 个隧道地址:10.66.0.5(Laptop-WG) / 10.66.0.4(映射地址,本机不持有) / 100.121.146.35(Tailscale)。本机另有 192.168.200.3(以太网) 与 192.168.43.173(WLAN) 两个局域网地址【从未实测】⇒ 不能宣称拓扑受限。",
"NapCat WebUI 的 GetClientIP 返回 10.66.0.4 是映射地址、本机不持有,不能当回调地址使用。",
"改网络配置必须重启 NapCat(约 10-20s),期间存在事件缺口;但只读预检(proxy 探端口 + 本机 sink 监听)不需要改配置也不需要重启。"
],
"todo": [
"先做零副作用只读预检:NapCat GET /api/base/proxy 探 192.168.200.3:18080 与 192.168.43.173:18080,按 refused=路由可达 / timeout=无可达路由 区分。需 NAPCAT_WEBUI_PASSWORD。",
"预检可达再临时写 httpClients 采集,采完 restore 回滚并逐字段校验(用户已授权该流程)。"
]
},
{
"id": "LINK-reverse-ws",
"name": "反向 WebSocket 入站链路",
"kind": "transport",
"api": [],
"supports": [],
"sendStatus": "untested",
"eventStatus": "untested",
"historyStatus": "not_applicable",
"parseStatus": "pending",
"automationTest": "未尝试",
"realEnvTest": "not_tested",
"regressionProbe": null,
"limitations": [
"本轮未尝试,无任何结论。",
"⚠️ 不得沿用『与 HTTP Server 同为入站故预期不可达』的推断(第 23 章):本链路 TCP 由 NapCat 主动发起,与 HTTP Server 的端口映射/宿主 DROP 无关,本机局域网地址从未实测。"
],
"todo": ["先按 LINK-http-callback 的零副作用 proxy 预检判定可达性,再授权配置 websocketClients 采集。"]
},
{
"id": "REL-dedup",
"name": "重复投递 / 断线重连补推 / 乱序",
"kind": "reliability",
"api": [],
"supports": [],
"sendStatus": "untested",
"eventStatus": "untested",
"historyStatus": "untested",
"parseStatus": "pending",
"automationTest": "未采集",
"realEnvTest": "not_tested",
"regressionProbe": null,
"limitations": [
"去重键候选 (bindingUid, group_id, real_seq) 仍待验证,不得写入设计为已确认。",
"观测工具已就绪:tools/probe/event-listener.mjs 记录 ws_open/ws_close/reconnect_scheduled 与 conn 序号。"
],
"todo": ["用户已授权自动重启 NapCat 采集断线重连补推、重复投递与乱序。本轮未执行,属下一轮任务。"]
}
]
}