fix(reward-memory): hint reviewed feedback ingestion on Lark inbox drain - #4010
Conversation
Signed-off-by: huangruiteng <huangrt01@163.com>
huangruiteng
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
这个 PR 补上了一个真实但此前断开的操作链:Agent 从 registry-routed Lark inbox 读到用户反馈后,系统没有告诉它如何在既有 Reward Memory 权限和 route 内进行“人工审核、压缩、预览、显式写入、精确读回”。本改动只在 Reward Memory 已对同一 Agent 启用、inbox 非空、并存在 active/writable scoped_feedback route 时给出提示,动机成立。
改动思路
实现把 hint 放在 Reward Memory capability 内,由 Lark CLI composition root 在 drain 后调用;它复用现有 experiment resolver、surface route、scoped_feedback adapter 和 reward-memory ingest-event,没有再造第二套账本、队列或 ingestion authority。这个归属和复用边界是合理的。
我重点核对了默认关闭隔离、authority 语义和 guidance/obligation 区分:hint 明确标为 advisory_only,不会调用 provider、不会自动生成 candidate、不会授予新权限,也不会阻塞 reply/material-review/ACK。automatic_ingest=false 仅关闭自动 hook,不会错误禁止已有的显式 ingest 路径;这个行为变化在 PR 描述与文档中均有披露。
具体改动
- 新增 effect-free
build_feedback_review_hint,只投影 exact Goal/Agent/registry 绑定、可写 active route 和 standing-policy 约束。 - 仅对非空、registry-routed 的
lark-inbox drain注入reward_memory_feedback_review;empty/disabled/unconfigured/explicit override 路径保持原输出。 - JSON 与 Markdown 都展示 advisory、preview command 和 route 约束。
- 文档说明 source/authority/freshness/conflict 检查、compact event、preview-before-execute、exact readback 和 no-memory 合法结果。
- 新测试覆盖 enable/disable、跨 Agent、wrong peer、unsupported adapter、policy disabled、read-only、真实 CLI preview、scope expansion guard、JSON/Markdown rendering 和 drain parity。
本地复核:96 passed in 13.26s(feedback hint、experiment routing、scoped feedback、outbound guidance、routed Lark inbox),相关文件 ruff check 通过,git diff --check 通过;远端 14 个 checks 均为 success/skipped-as-designed。
对主干的风险
风险低到中等:这是一个 opt-in operator-facing 输出变化,不改变 inbox 内容、ACK 状态或 memory 写入效果。主要风险是提示被误读为授权或自动学习;当前 typed fields、instruction、route eligibility 和负向 parity 测试已经把该风险约束得比较充分。preview command 暴露 invoked registry 路径,但该输出本来就是本地 operator inbox surface,且路径用于精确绑定同一 registry,没有扩大 public/provider 边界。
默认关闭证明覆盖了共享 drain 输出面和显式 override;authority 不是通过 prose 猜测,而是继续由现有 typed route/standing-policy/ingestion guards 执行。未发现会阻塞合并的问题。
我的整体评价
正向,建议合并。它修复了“看到反馈但不知道如何走既有安全写入链路”的可用性缺口,同时保持了默认关闭、显式执行、最小 authority 和精确读回。未来导向检查也没有发现需要在本 PR 中追加的抽象:继续复用 Reward Memory 的单一 ingestion owner 比新增 inbox-specific learner 更合适。中文 README 的对应操作说明可以后续补齐,但英文 canonical capability 文档和 Lark inbox 文档已足以描述本次行为,不构成本次 blocker。
English verdict: No blocking findings. The change adds a narrowly scoped, advisory-only bridge from a non-empty registry-routed Lark inbox drain to the existing explicit Reward Memory ingestion workflow. It preserves feature-off parity, does not call providers or mutate inbox/memory state, does not grant authority or create a settlement obligation, and relies on existing typed route and ingestion guards. Focused local validation passed (96 tests, Ruff, and diff check), and all remote checks are green. Approve for merge.
Summary
Add an advisory feedback-review hint to non-empty, registry-routed Lark inbox drains when the same registered agent has an eligible Reward Memory route.
中文:补齐“读到反馈 → agent 审核提炼 → 显式预览/写入 → 读回”的提示链路,不自动采集群聊,不新增偏好账本,不改变 ACK 或权限。
Root cause and prior work
automatic_ingest=falsedisables module-owned automatic hooks, not explicitingest-event.Behavior and boundaries
reward_memorycapability owns the effect-free hint; the bundled Lark extension is wired at the CLI composition root.Validation
Scope and risk
Five cohesive files: product helper/wiring, canonical capability/inbox documentation and regression tests. No private chat, local config, runtime state, credentials or internal evidence included.
Future-facing pass: reuse the existing scoped ingestion owner; no new store, queue, scheduler or hook framework is warranted. The only new behavior is opt-in advisory output, not enforced learning. Runtime change requires separate review; this PR does not install or self-merge.