Skip to content

fix(research): reuse the canonical digest matcher - #7201

Merged
loopx-agent merged 1 commit into
mainfrom
codex/trajectory-input-digest-owner-20261024
Oct 24, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/trajectory-input-digest-owner-20261024

Conversation

@huangruiteng

@huangruiteng huangruiteng commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Goal And Delivered Outcome

  • Outcome basis / optional anchor: Base branch commit 385771e (feat(research): record and estimate LoopX Turn packet input #7170) added a second private bare SHA-256 matcher, making the repository's content-digest single-owner guard fail on main and on unrelated PRs.
  • Goal/source and gap: Route trajectory input digest validation through the existing canonical owner and register the reviewed consumer.
  • Observable before → after, with the validation row that proves it: The single-owner test previously reported trajectory_input_usage.ts:24 as an offender. The focused 27-test suite now passes.
  • Issue/task and intended base: Regression from feat(research): record and estimate LoopX Turn packet input #7170; base main.

Author Declaration

  • Written by: OpenAI Codex (GPT-6 model agent)

Implemented against

  • Specification and revision: tests/control_plane_ts/content_digest_single_owner.test.ts at base b8b9c1d.
  • Criteria:
Criterion (spec clause) Disposition Symbol / path Test or command
Bare SHA-256 validation has one canonical matcher owner implemented BARE_SHA256_PATTERN focused digest-owner suite
New canonical consumers are explicitly reviewed and pinned implemented CANONICAL_CONSUMERS focused digest-owner suite
Trajectory attribution behavior remains unchanged implemented estimateTrajectoryLoopXInput trajectory input usage suite
  • Self-check before submission: Reviewed the introducing commit, changed only the matcher import/use and the pinned consumer inventory, ran focused tests and control-plane type checking, and scanned the two-file diff.

Scope And Continuation

  • Completed scope and remaining work: Complete within this scope.
  • Slice boundary / successor: N/A.

Validation

  • Tested revision: 1422b6d
  • Run state: finished
  • Input classes: synthetic
Check kind Result Public-safe evidence / limitation
unit passed Digest-owner and trajectory input usage suites: 27/27 passed.
static passed npm run typecheck:control-plane.
static passed git diff --check and changed-file boundary scan passed.

Frontend / Visual Evidence

  • UI impact: none
  • Before: N/A
  • After: N/A
  • First viewport and preview: N/A
  • States and viewports shown: N/A
  • Source data: none
  • Attention review: N/A
  • Craft review: N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring (no functional changes)
  • Documentation update
  • Test update

LoopX Area

  • Control plane (goals, todos, quota, scheduler, registry, runtime)
  • Benchmark boundary (adapters, runners, verifiers, scoring, evidence)
  • Capability or extension (providers, adapters, skills)
  • Public docs or presentation surface (README, protocols, dashboard)
  • Build, packaging, installer, or CI
  • Host or runtime integration

Technical Direction

  • Direction / acceptance reference, when applicable: Core control-plane hardening.

Shared-authority RFC fixture impact

N/A.

Boundary Checklist

  • Neither the diff nor this PR body/comments/attachments disclose private state, credentials, raw traces or verifier output, internal links, or local machine paths.
  • I did not duplicate maintainer-owned benchmark work.
  • I kept the change scoped to the regression.
  • No paired RFC changed.
  • UI impact is none.
  • Every commit includes a DCO Signed-off-by trailer.

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

@loopx-agent loopx-agent 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; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max

Approval conclusion — APPROVE at 1422b6d8db341e0e0b5112c06d7623af69ab40bc.

动机

修改核心代码的维护者运行既有摘要所有权检查时,会被轨迹输入归因模块的第二份正则挡住,即使本次改动与它无关。
基础版本报告同一个额外匹配器;当前改用已有的统一匹配器并登记实际消费者,原检查通过,输入归因的完整输出保持一致。
独立重现的摘要所有权检查从 16 过、1 败变为 17 全过;连同 10 项归因测试共 27 通过,72 组汇总函数的完整输出在两版逐字相等。
本次只修复重复匹配器及其维护检查,不改变输入归因算法、百分比口径或模型行为;全仓、安装态与长期收益不在本轮验证范围。

剩余范围:未重复全仓套件、安装态 Research App 或真实模型;完整输入结果与当前源码检查有证,不据此声称语义理解或净成本收益。

改动思路

删除重复表达式并复用现有常量即可解决问题;登记消费者没有增加例外,也没有削弱全库检测、引入新状态或第二个校验器。
当前 PR 完成统一摘要校验及既有归因行为保持,不扩展 Research 能力或页面。
消费者清单继续要求实际导入并使用统一导出,第二个匹配器仍会触发失败。只把数组顺序从 [a-f0-9] 改成 [0-9a-f] 不会改变允许的字符;本次同时保留原类型检查、锚点、错误和非全局正则,避免引入状态性的重复调用差异。

具体改动

完整差异为 2 files +3/-1。没有独立书面规格专门定义这一消费者;依据是改动前 tests/control_plane_ts/content_digest_single_owner.test.ts 在 b8b9c1d77c17edf75e0d8860e533a7785b9bd224 的全库检测及消费者固定清单,以及已复现的当前基础版本失败。完整 PR 只有两文件、三行增加和一行删除;新增导入和登记之外没有算法、配置、协议或界面变更。

关键代码讲解

  • digest:保留原类型检查和失败消息,只把局部裸 SHA-256 正则替换为统一常量;非法格式仍仅令输入归因不可用。
  • estimateTrajectoryLoopXInput:真实消费方继续绑定来源、Goal、会话和同请求用量,再计算明确记录的输入;完整、部分及不可用结果和独立计数保持。
  • BARE_SHA256_PATTERN:既有字符类与原表达式等价,保留锚点且无状态性全局标志;消费者登记不扩大检测例外。

对主干的风险

独立使用实际 summarizeTrajectoryCodexUsage 构造 72 组输入:五个摘要位置分别覆盖有效小写、数字、大小写/前缀/长度/空白/换行/非字符串,以及缺失 trace 和未重放输入。两版完整 JSON 字节完全一致;错误只令归因 unavailable,独立请求计数仍为 100。不是只比较状态码或聚合测试数量。相同单一归属与归因套件在不可变基础版本为 26 过、1 败,在当前为 27 全过;没有改写检测器或扩大例外。

完整保留早期质量回执不匹配导致的聚合失败;重新针对当前精确范围资格化后通过。当前类型检查、四项直接和两项选定 premerge 检查,以及两文件公共边界检查通过。 精确范围 cqr_d9c344ffb07da5df7c25 为 pass;质量记录检查一致性,不能替代上述实际执行证据。没有查询、轮询或等待远端 CI,代码批准也不代替合并准备度与维护者权限。

我的整体评价

本次局部目标为 goal_achieved;长程控制边界 preserved,维护者处理无关 PR 的路径 improved。统一既有规则比保留重复正则或增加豁免更小、更易回滚;没有需要在本 PR 继续扩大的重构。
删除重复表达式并复用现有常量即可解决问题;登记消费者没有增加例外,也没有削弱全库检测、引入新状态或第二个校验器。 当前 PR 完成统一摘要校验及既有归因行为保持,不扩展 Research 能力或页面。

视觉审查不适用:已检查完整 diff、现有 Research 汇总/Agent CLI 等待入口及已有 Todo/设置消费者,没有渲染布局、控件或新能力入口变更。未验证范围:未重复全仓套件、安装态 Research App 或真实模型;完整输入结果与当前源码检查有证,不据此声称语义理解或净成本收益。 事实与未知分别保留,不以测试、回执或 PR 数关闭更广成果。

English verdict: APPROVE. The duplicate matcher is removed through the existing canonical export, without weakening the ownership guard. All 27 focused tests pass and 72 complete production-summarizer outputs exactly match the immutable base. This is a bounded maintenance fix; no installed/model, whole-suite or long-horizon benefit is claimed.

@loopx-agent
loopx-agent merged commit a5f06aa into main Oct 24, 2026
30 of 38 checks passed
@loopx-agent
loopx-agent deleted the codex/trajectory-input-digest-owner-20261024 branch October 24, 2026 07:19
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