Skip to content

fix(lark): use bounded source verification for mentioned controls - #6991

Merged
loopx-agent merged 1 commit into
mainfrom
codex/lark-mentioned-control-preflight-20261021
Oct 21, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/lark-mentioned-control-preflight-20261021

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Mentioning a Bot before /stop, /status, /help or /new in an already admitted Topic currently takes the general rendered-message path. That adds a display lookup, duplicate identity observation and separate source reads before the control operation.

Recognize the structured mention as a read-planning hint and reuse the existing bounded source/root read. The canonical raw mention, fresh App identity and existing Core fences still authorize the exact command. Preserve the original rendered message and exact replay; mismatched canonical text falls back to the existing path. The paired RFCs describe this boundary.

Validation: 255 related transport/binding tests pass; all four new positive regressions fail on the unchanged base, and the three new authority counterexamples pass. Ruff and bilingual staged checks pass. Five controlled synthetic samples reduce provider calls from five to two; these are transport observations, not live latency or full release qualification. Required exact-head local premerge qualification passed, including the paired RFC, semantic vocabulary, extension/content risk and public boundary gates. No CI observation was requested.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent; runtime_reported; model=gpt-6.1-sol; provider=OpenAI; effort=max

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机

在既有群话题中发送带 Bot 提及的控制指令的成员。 同样一条带提及的停止请求,旧入口先走普通消息投影和重复来源观测;新入口读取确切消息及原话题根后仍交 Core 核验。 在受控 provider 回归中,每次控制准入从五次调用减为两次,命令、目标 Session 和重放消息保持一致。 本 PR 的边界是提及控制的读取规划;完整线上停止时延、所有交互准出和私有业务处理继续由独立采用验收证明。 真实安装后的回执与物理停止时钟仍需复验。

改动思路

只在 Lark 传输边界投影只读提示,控制规则仍由原 canonical 解析器和 Core 锁内核验持有,因此不需要新状态或新执行器。 当前 PR 仅复用已受理群话题的来源读取路径;原生停止、外发回执和完整线上时限验收保持各自 owner。

旧入口已经有正确的 raw 来源解析器和锁内核验,问题是渲染后的提及文本不满足“纯控制命令”的读取提示条件。本提交把事件名称或 key 仅作为读调度提示,随后重新核对原始正文、当前 App、根话题和授权。正文不同就退回原有普通路径,来源不完整或权限变化仍由原 owner 拒绝。保留既有入口比缓存身份、扩建控制器或要求成员重发更直接。

受控准入观测 原路径 当前路径
provider 调用 5 2
canonical 命令、目标和重放消息 原契约 原契约

这张表来自同解释器、同合成 backend 的五次配对观测;它不表示生产网络时延、p95 或完整停止准出。

具体改动

本次逐项对照改动前的接受契约:spec_ref docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md,spec_revision 68e99ad93ef1954a0bf90ad7158ffb85cf365f2d。检查的是该提交之前的规则,RFC 补充文字只是披露新读取路径。

  • RFC-PAIR:使用已受理根确定两条确切 raw 读取,之后仍在既有双重锁内重新选择身份和 binding;四类提及控制均通过端到端回归。
  • RFC-AUTH:canonical 正文和当前 App 才能授权;原提示是 stop、正文却为普通消息或 help 时,结果依正文。其他 Bot 的提及不能取得停止权。
  • RFC-REPLAY:原始渲染消息保留,四类请求重放及旧渲染 journal 使用原目标和原消息;不新增版本迁移或跨次身份缓存。
  • RFC-LIVE:线上安装后的完整回执和物理停止时限仍需独立采用复验,File/Core 通过只覆盖本提交声明的传输边界。

关键代码讲解

  1. _group_control_hint 从结构化提及的名称或 key 推导现有精确命令候选,仅决定读取路径。不能把名称相同视为身份,不能仅凭事件产生控制效果。
  2. _admitted_control_root 继续核对当前启用群 binding、已受理根、source 和原 journal 的渲染表示。未知根、旧表示冲突仍走已有路径,避免用优化改变持久重放语义。
  3. _admit_group_control 复用既有 raw pair 与 source_preflight,在 Core 锁内用现有 _group_text_command_input 的结果核对候选;不一致时,在任何 Core 写入前回普通渲染,失败则保留原拒绝语义。

代码为四文件 +111/-3:传输模块净增32行、七个回归参数实例及两份契约披露。原始消息、typed Core 命令、原生停止和结果投递 owner 保持原位置。

对主干的风险

主要风险是把渲染后的名称误当权限,或为了优化提及入口而改变旧请求的重放表示。三个新反例分别覆盖普通 canonical 正文、不同 canonical 命令和其他 App 提及;原来源、撤权、并发话题和旧 journal 用例一起运行,相关两模块共255项通过。四个新增正例在未改 base 上全部失败,在当前 head 上通过,能捕捉原遗漏而非仅检查函数存在。

required premerge 在同一精确 head 通过,包含双语 RFC、语法、maintainability、semantic vocabulary、extension/content 风险与 public boundary 检查。首次运行因新检出目录缺 TypeScript 开发依赖而失败,按仓库声明执行 npm ci --ignore-scripts 后原门槛重跑通过;规则、断言和预算均未调整。按 Goal 配置 wait_for_ci=false,本评审没有查询、轮询或等待 GitHub CI。合成协议不证明全部真实宿主和线上 SLA。

语义与 CI 对齐

本提交复用已有控制词汇,事件 hint 只是 extension 内的只读投影。共享 Core 的身份、权限和效果状态机不变;没有新的 Goal 义务、调度开关、worker 或自动加载 prompt。普通输入和旧格式 fallback 的存在有持久 journal 兼容需求,不能用删除它们换取表面行数下降。后续实际采用应继续检查原话题的回执和独立话题继续运行。

我的整体评价

未发现阻断性代码问题。结论为 justified_increment:long_horizon 的原请求、重放和后续恢复语义 preserved;user_experience 在同一轮控制请求的必要 provider IO 上 improved。只在 Lark 传输边界投影只读提示,控制规则仍由原 canonical 解析器和 Core 锁内核验持有,因此不需要新状态或新执行器。 当前 PR 仅复用已受理群话题的来源读取路径;原生停止、外发回执和完整线上时限验收保持各自 owner。 该增量结构必要且范围适当,仍保留真实安装后时限、Web 与整体准出的独立缺口。当前精确 head eb768283b5fe06a79f145fba9aa1813af764dca9 的本地验证和负例支持 APPROVE;该结论不代替合并资格或外部授权。

English verdict: APPROVE — exact head eb76828. Mentioned controls reuse canonical source-pair verification without granting event hints authority; 255 related tests, base-sensitive regressions and required local premerge pass. Live timing and full release qualification remain separate.

@loopx-agent
loopx-agent merged commit a590609 into main Oct 21, 2026
27 of 39 checks passed
@loopx-agent
loopx-agent deleted the codex/lark-mentioned-control-preflight-20261021 branch October 21, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant