Skip to content

Reuse canonical SHA-256 validators for private results - #8836

Merged
huangruiteng merged 1 commit into
mainfrom
codex/canonical-result-digests-20261116
Nov 16, 2026
Merged

huangruiteng merged 1 commit into
mainfrom
codex/canonical-result-digests-20261116

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

The SHA-256 ownership checks started failing on main when three result readers defined their own digest patterns. Chat history and Feishu image repair now use the existing generated Python validator for bare digests. The native child-result inbox uses the shared TypeScript validator for the sha256: envelope.

The TypeScript substitution and its consumer-list entry already appear in the broader C1 integration. This PR carries that prerequisite independently so the repository checks can recover while the integration is reviewed. C1 integration #8266

Chat still verifies the digest against the stored image bytes, Feishu still binds the original answer and each image, and the child inbox still binds the original receipt and bytes. The Lark module retains its reviewed size ceiling through a small simplification of the descriptor file read.

Validation

  • Reproduced the Python and TypeScript ownership failures on the base.
  • Compared the old and canonical validators on 1,754 bare and 1,764 enveloped synthetic values, including wrong length, uppercase, whitespace, non-ASCII input and trailing line breaks.
  • 280 focused Python tests, 25 focused TypeScript tests and all 10 diff-selected premerge validators passed.
  • Both ownership suites passed with this change applied to the exact current PostgreSQL proposal. PR #8759

The full TypeScript suite passed 6,539 tests with 89 skips. The full Python run stopped after two recovery failures and 6,226 passes. Isolated runs on both the target baseline and this exact head reproduced the missing terminal review during Steward restart and the current_turn_work_changed rejection after restoring the original input for an external Turn retry. The managed quality gate remains held, and the rest of the full Python suite is unverified.

Independent review and hosted CI are pending on the published revision.

Route Chat image reads, Feishu repair descriptors and native child receipts through the existing digest owner. Carry the native-inbox prerequisite from #8266 independently of the C1 integration.

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 · gpt-6.1-sol · OpenAI · runtime_reported · reasoning_effort=max

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

评审 head 1dff1eead58db018951515eacc9ebe34f225f4dc,对照基线 f7e3f427197bab6c66ab535e26613a7f9c2fdbe0。

动机 / Motivation

这项改动服务于维护私有结果读取和构建发布候选的维护者,后者目前会遇到摘要归属检查失败。 Chat 图片、飞书补图和 native child result 分别写了完整摘要格式判断,重复规则使 Python 和 TypeScript 的归属检查失败。 同样的主干检查在基线报告两个 Python 模块和一个 TypeScript 模块重复声明,候选转用共享校验后两组检查通过。 在两份已安装 wheel 中,合法图片和原 receipt 都照常可读,错误格式、错误字节及跨 Agent 读取均保持拒绝。 这是摘要格式归属修复。完整恢复场景、真实线上飞书、最终 tag 与正式发布资格仍属于原有验收。 主干的管家重启用例仍缺终态评审回执,合并检查仍缺当前 quality receipt,最终发布版本需按完整范围资格复验。

改动思路 / Approach

把两种摘要格式交给现有共享校验,三个调用者继续持有自己的来源、权限和原字节验证。 此 PR 只合并三个现有读取者的摘要格式校验,并保留其存储和失败语义。 继续使用已有的 TypeScript 定义和生成的 Python 导出。这个复用仅处理完整摘要格式。字节和来源绑定仍用原路由,不增加跨语言调用或第二套授权。小范围收敛有自己的实际入口和验证,解除向 #8266 更广变更等待的依赖。

具体改动 / Changes

本次按tests/architecture/test_content_digest_single_owner.py 在 f7e3f427197bab6c66ab535e26613a7f9c2fdbe0 的版本逐项复核。test_only_the_owner_module_states_a_whole_value_digest_shape 对应裸摘要和带前缀摘要的完整格式使用现有共享 owner。 bare- and enveloped-digest parity 对应现有调用入口保留自己记录要求的摘要形式与拒绝语义。 source binding and byte validation 对应形状校验之后仍以原受众、数据与 receipt 读回为准。 Chat 原消息图片读取与飞书历史补图分别使用裸摘要,native child result inbox 解析它原本持有的前缀摘要。选择同一共享形状之后,Session、原答复、图片字节、宿主终态 receipt 与 Agent 作用域仍由各入口逐项验证。两处现有测试 manifest 记录新调用者。补图的小型路径内联保持同样的 40000 字节上限与错误处理。 验收依据 · _serve_chat_history_image · _historical_image_plan · readEntry

对主干的风险 / Risks

  • 通过 候选 244 项 Python 摘要规则与 25 项 TypeScript 定向测试通过。匹配基线分别有 243、24 项通过,两个失败集中在本 PR 收敛的重复格式定义。扩大到摘要、私聊和图片的匹配组后,候选 771 项通过,基线 770 项通过与同一归属失败。
  • 通过 两份已安装 wheel 均验证原图片字节、非法摘要和跨站拒绝。25 个飞书补图正负例在两端一致。追加不合格式的裸摘要保持原回执且无上传,修正输入后原路径可继续。native Effect runtime 通过正确格式和终态 receipt,拒绝缺失前缀、损坏摘要或内容,以及其他 Agent 的记录,重放回到同一份结果。
  • 既有失败 管家重启用例两端各 12 个参数均缺 terminal.recovery.22.review.1。它们的失败签名一致,摘要相关入口已有决定性的匹配覆盖。标准 premerge 的 6 项直接和 10 项选中执行都通过,当前合并质量回执缺失。

我的整体评价 / Verdict

批准此版本的代码结论。该改动能独立恢复现有摘要归属检查,保留私有结果的格式、内容与授权判定。主干已有的恢复缺口与正式候选的合并和发行仍由现有流程处理。两份 wheel 的外部 provider 都使用合成输入。

英文简短结论

English verdict: APPROVE at 1dff1eead58db018951515eacc9ebe34f225f4dc. All three installed result readers preserve digest, content, and scope behavior while delegating validation shape to the established shared owner.

@huangruiteng huangruiteng left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewer: model_agent · Codex · OpenAI · self_reported

动机 / Motivation

私有 result 读取器需要复用同一个 SHA-256 校验语义,避免本地正则副本继续与 canonical owner 漂移。此前 digest-owner 检查能发现 native_child_result_inbox.ts 中遗留的独立 matcher,导致相关 PR 的 TypeScript 门禁失败。

改动思路 / Approach

把三个读取入口改为调用现有 canonical digest validator,删除本地 envelope 正则,并扩展单一 owner 检查覆盖这些消费者。没有新增校验协议、状态或权限边界。

具体改动 / Changes

当前 head 1dff1eead58db018951515eacc9ebe34f225f4dc 中,Python chat result reader、TypeScript native child result inbox 和 Lark private conversation reader 都委托共享 digest owner;架构测试把这三个消费者纳入单一 owner 约束,并对 rename、local cap、错误 envelope 和不可静态折叠的构造保持 fail-closed。实际行为仍分别校验 digest、内容和 scope,只是校验来源不再重复。

对主干的风险 / Risks

无阻断发现。共享 owner 的失败会直接传播到三个读取入口,不会退化成默认接受;行为差异只会出现在原本重复的 digest 校验来源。验证通过 244 个 digest-owner Python 用例和 17 个 TypeScript 用例;测试覆盖 bare/enveloped SHA-256 区分、导出来源、消费者集合及构造变体。

我的整体评价 / Verdict

APPROVE。该改动消除共享校验知识的本地副本,并直接关闭当前主干上由第二个 matcher 引起的 TypeScript 红灯;改动边界集中,回滚只需恢复三个消费者对本地校验函数的调用。

English verdict: APPROVE at 1dff1ee. All three private-result readers reuse the canonical SHA-256 validator, focused Python and TypeScript owner checks pass, and duplicate local matcher knowledge is removed.

@huangruiteng
huangruiteng merged commit 918809b into main Nov 16, 2026
42 of 48 checks passed
@huangruiteng
huangruiteng deleted the codex/canonical-result-digests-20261116 branch November 16, 2026 04:51
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.

2 participants