[Slice 2/4] arise 反应式核:自撤/改口 + 已发日志(Self-message Control) #3
Loading…
Add table
Add a link
Reference in a new issue
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?
Parent
拆自 #1(arise 反应式核 / Reactive Core PRD,Phase 1)。本片是该 PRD 的第 2/4 片,建立在 #2(Slice 1: Walking Skeleton)之上。
What to build
让机器人对自己发出的消息有控制力——撤回(
self_recall)/改口(edit),端到端验证:模型调工具 → core 按句柄状态路由 → 平台侧产生正确的撤回/编辑(或降级)动作。具体包含:
edit:本片先以静态配置常量表达(不建完整能力探测 port,那是后续多模态切片的范围);OneBot v11 测试适配器场景下edit=false(OneBot v11 只有delete_msg、无原生edit_msg)。self_recall(handle)/edit(handle, new_content)两个 core 工具,按句柄的 send-state 路由:message_id)→edit=true走原生编辑;edit=false降级为"撤回旧 + 重发新"(重发走一次新的send_message,句柄重新回填)。句柄 ↔ 平台 message_id / content / chat / time / send-state,是 send-state 路由判断的依据。本片先满足 self_recall/edit 寻址需要即可,不强求持久化到 Postgres(持久化 + 崩溃恢复的事务边界是 Slice 3 的范围)。self_recall至多一次、edit至多 N 次(N 为静态配置,防止 edit↔recall↔resend 死循环)。Acceptance criteria
edit,在edit=false(OneBot v11 测试适配器)场景下,断言产生delete_msg+ 新的send_msg(而不是报错或静默失败),新消息句柄正确回填。self_recall/edit,断言零平台调用(纯 core 内部丢弃/改写)。self_recall,断言不产生任何平台调用(fail-closed)。self_recall第二次 /edit超过 N 次,断言被硬约束拒绝,不产生额外平台调用。Blocked by
send_message返回的句柄机制已经存在)