Repository navigation
feat(lark): trace native event stages during bounded diagnosis - #7014
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; model=gpt-6.1-sol; provider=OpenAI; runtime_reported; reasoning_effort=max.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
维护原生飞书 Bot 的人员在停止回复偏慢时,需要知道消息在哪一段等待。原路径只打印处理总数,无法区分消息尚未到达、来源校验较慢和回传等待;本提交可在同一原处理链中临时记录这些边界。受控原生路径能把注入的来源读取等待定位到对应分段,同时保留停止目标、原消息回传和重复投递结果。本次不修改停止、权限或重试规则,不宣称真实提供方停止时限已经达标。安装后的真实消息样本、完整停止时限和更广的发布资格仍须独立验收。
改动思路
在已有传输模块保留一个默认关闭的诊断函数,调用点围绕原有操作;Core 继续决定授权、执行、停止目标和恢复,原服务继续拥有唯一消费者与回传。本提交交付可用于原服务的分段观测,实际延迟修复取决于后续真实样本,不把日志当成成功回执。维持现状会继续缺少定位依据;另建追踪服务、持久时间线或额外消息消费者则超过本问题所需。这里仅复用原服务的本地结构化输出,显式开启后记录固定阶段和时钟,关闭或输出失败时继续原操作。普通用户发送与停止消息的路径、所需说明及确认轮次保持不变,诊断配置由已有维护者完成。
具体改动
规范依据为 docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md,读取固定于 d5665210e24ddb7c2836a20579e7c684b5339fc6 的正文。Selected group topics: isolated ordinary project Chat 的来源、授权、话题停止和原处回传要求在本头保持 implemented;Ordinary workspace conversations: bounded implementation checkpoint 的单消费者、有界处理及既有恢复要求也保持 implemented。此处的 implemented 指受影响的既有不变量保留且通过关联验证,完整发布及真实提供方时限仍为独立未完验收。
关键代码讲解
record_event_timing只在本地明确开启时输出。关联键由配置名与消息 ID 的摘要组成,正文、原始身份、凭据及提供方输出不进入记录;局部输出异常被隔离。stream_lark_goal_topic_profile在同一原消费者上区分读到事件、来源通道就绪、工作线程开始和新快照就绪;分发、容量、顺序及健康结果仍由原实现负责。_admit_group_control围绕原始消息对读取、Core 受理与来源前置校验设置边界。它仍在读取后重新核验当前绑定与 App,没有缓存授权,也没有把事件提示当命令依据。_deliver的时间记录覆盖原 Inbox 准备、发送前来源核验及回传返回;verified 字段仍只来自原提供方读回。配套文档说明单调时钟、墙钟、缺少返回标记及上游时钟的解释边界。
对主干的风险
主要风险是诊断泄漏内容、异常阻断消息,或被误读为执行成功。七项最终定向检查覆盖默认关闭、开启、输出异常三种模式的相同目标与单次回传,也覆盖 App、发送者和授权在回传前撤销,以及字段脱敏。已有 248 项关联检查通过;最后两次仅补测试断言,生产代码逐字节未变。冻结的相同原生测试脚本在基线和最终头均得到目标已记录、执行中断、原消息已回传、重复检查零发送的完整相同结果;提供方和模型宿主是合成夹具,不能替代真实飞书时延。去掉诊断函数的受控变异会使实际流式入口的阶段断言失败,原头通过,因此验证覆盖了接线而非仅序列化器。最初测试错误把 Core 的 command_completed 和传输层 delivered 混为一谈,已改为独立读取原传输日志;原失败记录保留,当前相关运行及最终检查覆盖该断言。必需本地 premerge、RFC 双语、语法和差异检查通过;按 Goal 配置未查询 CI。无布局或权限变化,真实安装和完整停止时限继续单独验收。
我的整体评价
APPROVE,本次为 justified_increment。long_horizon 与 user_experience 均为 preserved:没有引入需要同步的新状态、补办队列、重试 owner 或额外用户确认,原目标、原回传和持续恢复仍由同一链路承担。在已有传输模块保留一个默认关闭的诊断函数,调用点围绕原有操作;Core 继续决定授权、执行、停止目标和恢复,原服务继续拥有唯一消费者与回传。本提交交付可用于原服务的分段观测,实际延迟修复取决于后续真实样本,不把日志当成成功回执。新增内容与定位问题相称,兼容层或新模块都没有必要;局部诊断词汇属于 local_only,不扩展共享状态或成功语义。当前精确头为 a79870419d188ce90ac4431204ac851444694a9c,证据覆盖整个差异,没有阻塞性 finding。真实提供方时延和完整验收未被这次代码批准关闭。
English verdict: APPROVE — exact head a79870419d188ce90ac4431204ac851444694a9c adds default-off, content-free stage observations on the existing native Lark path. Native Stop/delivery parity, revoked-source denials, sink failure and a wiring mutation are checked; required local premerge passes. This is a bounded diagnostic increment, not a live Stop SLA qualification. CI was not queried.
Native Lark Stop latency can exceed its interaction budget while the current event logs expose only aggregate counts. This adds an explicit, default-off local stage trace to the existing listener, private admission and reply path so a bounded installed sample can distinguish consumer arrival, snapshot/lane work, source reads, Core recovery and outbound delivery.
LOOPX_LARK_EVENT_TIMING=1enables content-free timestamps correlated by an opaque profile/message digest. No message content, raw identity, credentials or provider output is logged. Sink failures do not reject messages. Existing source/grant checks, target freezing, bounded dispatch, retries and provider readback remain with their current owners; this introduces no consumer, queue or durable authority.The specification basis is
docs/architecture/rfcs/app-conversation-and-async-inbox-v0.md, especially “Selected group topics: isolated ordinary project Chat” and “Ordinary workspace conversations: bounded implementation checkpoint”. This change observes those existing boundaries. It does not qualify the live Stop budget or complete the broader conversation rollout.Validation: native stream → Core Stop → original reply/readback with a controlled source-read delay; diagnostic sink failure; revoked App/sender/grant; default-off/redaction checks. Related native transport regressions and the repository premerge gate are recorded in the review. Installed provider timing remains a separate acceptance step. CI is not queried under the managed Goal policy.