Skip to content

fix(reward-memory): hint reviewed feedback ingestion on Lark inbox drain - #4010

Merged
huangruiteng merged 1 commit into
mainfrom
codex/lark-inbox-reward-memory-hint
Sep 6, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/lark-inbox-reward-memory-hint

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

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

Behavior and boundaries

  • Existing reward_memory capability owns the effect-free hint; the bundled Lark extension is wired at the CLI composition root.
  • Exact Goal/Agent/registry command binding; only active writable scoped-feedback routes with enabled standing policy and exact peer identity are listed.
  • No provider calls, message parsing, candidate creation, new authority, automatic flag changes, or settlement gates.
  • Agent verifies source authority and current evidence, previews a compact event, and checks exact readback after any authorized execution. Allowed actor roles are constraints, not sender verification.
  • Disabled/empty/unconfigured/invalid/incompatible routes and explicit config/project overrides preserve prior output.
  • JSON and Markdown both expose the guidance.

Validation

  • 92 focused tests passed across feedback hints, experiment routing, ingestion, outbound guidance and routed Lark inbox tests.
  • Generated preview command exercised through the real CLI: automatic-ingest-off preview succeeds; cross-agent candidate is guard-blocked.
  • Read-only local runtime drain verified hint presence while automatic ingestion remained off; no memory provider calls or writes. No live memory ingested.
  • Ruff and git diff --check passed.
  • LoopX check: five-file public boundary scan clean; zero errors, three pre-existing unrelated registry/history warnings.
  • Full canary and remote CI not yet run at PR creation.

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.

Signed-off-by: huangruiteng <huangrt01@163.com>

@huangruiteng huangruiteng 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.

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.

@huangruiteng
huangruiteng merged commit b6c2d04 into main Sep 6, 2026
14 checks passed
@huangruiteng
huangruiteng deleted the codex/lark-inbox-reward-memory-hint branch September 6, 2026 16:06
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