Skip to content

feat(learning): 只有角色发言作证据的确认不加保留强度 - #136

Merged
leafliber merged 1 commit into
mainfrom
feat/confirm-needs-other-evidence
Nov 10, 2026
Merged

leafliber merged 1 commit into
mainfrom
feat/confirm-needs-other-evidence

Conversation

@leafliber

Copy link
Copy Markdown
Member

BR-B1 的 PR 2。依据 DECISIONS.md 2026-11-10「由此补充的规则」,设计 10.2。与 #135 互相独立,都从 origin/main 建分支。

改动

记忆的说话人不是“我”时,如果一次确认在目标段的证据全部是 self_output:

  • 不增加保留强度,不更新 last_confirmed_at,也不占用拆分树的确认名额(record_batch_memory_effect 不调用);
  • 在批次结果的 dropped 中写一条单项弃项,固定原因 confirmation only from self output;
  • 来源照常追加。

显式“确认”和去重触发的确认都适用。说话人是“我”的记忆行为不变。

未改学习提示词、memory_ops.confirm_retention 的增量语义、修正和反驳。只改了 src/iris/learning.py 和新增测试文件。

实现上需要说明的几点

  • 只看目标段内的证据:目标段外的证据(如历史段里他人的消息)不算,这是规则“在目标段的证据”的字面含义。证据中没有目标段消息时保持原行为。
  • 去重路径的弃项去掉了 _embedding。这个字段是 numpy 数组,配置了 embedding 时 dumps 会抛错、使整批失败,假模型默认没有 embedding,测不到,已单独加测试。
  • 同一批中同一条记忆有多项确认时逐项判断:仅角色发言的那项记弃项,他人证据的那项照常加一次,顺序不影响结果,每批每条只计一次的行为不变。

既有测试

没有修改任何既有断言或夹具。

测试

新增 tests/test_learning_confirmation_evidence.py(23 项):显式确认和去重确认各覆盖证据全为 self_output、混合、全为他人、说话人是“我”四种情况;action_result/event 不算角色发言;目标段外证据不计;遗忘中的记忆不因此恢复;弃项写入 result_json;同批多项、拆分树的名额;修正和反驳不变。

检查 结果
uv run pytest(3.13) 5513 通过
uv run --locked --isolated --python 3.12 pytest 5513 通过
uv build 成功

不调用真实模型;按任务要求不跑真实评测,随下一次学习线正式运行回归。

…lone

When a memory's speaker is not the role and a confirmation's target
evidence is entirely self_output, skip the retention increment and the
last_confirmed_at update and record a dropped item. Sources are still
appended. Applies to explicit and duplicate-triggered confirmations.
@leafliber
leafliber merged commit 7568622 into main Nov 10, 2026
1 check passed
@leafliber
leafliber deleted the feat/confirm-needs-other-evidence branch November 10, 2026 14:11
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