Skip to content

feat(workspace): link saved measurements for the same research candidate - #9138

Merged
loopx-agent merged 1 commit into
mainfrom
codex/research-candidate-measurements-20261120
Nov 21, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/research-candidate-measurements-20261120

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Summary

  • Link saved measurements across explore findings on the current page when they share an exact enveloped sha256: candidate digest (ENVELOPED_SHA256_PATTERN), while preserving candidate-local plain labels and quarantined measurement errors.
  • Add styling in goal-explore-results.css and a collapsible Other measurements of this candidate (this page) / 同一候选的其他测量(本页) details section in goal-explore-results.tsx that navigates to the source finding on click.

Local Verification

  • npm --prefix apps/presentation/dashboard run build:desktop (tsc --noEmit && vite build) — passed
  • npm --prefix apps/presentation/dashboard run check:css-custom-properties — passed (43 stylesheets, 0 undefined references)
  • npm --prefix apps/presentation/dashboard run smoke:explore-timeline-scan — passed
  • uv run loopx --runtime-root /Users/huangruiteng/.loopx check --scan-path ... — passed (0 errors, public boundary scan clean)

@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 · Gemini · Google DeepMind · self_reported

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

对精确提交 870838c30a030fef1e17edaf496e75b1b0ee5bcd 的独立复核结论为 APPROVE。代码实现紧致(2 个文件 +38/-0),经独立本地构建与无头浏览器真实渲染核验(1440×900 默认折叠/展开/点击跳转与 390×844 窄屏展开),功能、排版与负向隔离行为均符合预期;随文记录两项非阻塞(P2)后续完善建议:补充针对 relatedCandidateMeasurements 的回归测试以及在 PR 正文补齐首屏可视化截图。

动机 / Motivation

在工作台研究视图“已保存的结论”(GoalExploreResults)中阅读某条实验结论、并需要对照同一候选版本(candidate_ref)散落在本页其他结论下的量化测量的研究者与维护者。改动前,当同一候选产物在多个 Explore finding 中分别测得不同指标(如一条测延时、另一条测吞吐或内存)时,读者必须逐条点击左侧清单手动对照且容易遗漏;改动后,当本页其他未被 measurement_error 隔离的 finding 携带完全相同的 enveloped sha256: 候选摘要时,详情区会在总结文本下方以默认折叠的“同一候选的其他测量(本页)”面板聚合展示去重后的跨结论指标,并提供直达来源结论的按钮。改动产生的可观测改善为:精确匹配 ENVELOPED_SHA256_PATTERN(64 位小写 hex 的 sha256: 摘要)的跨 finding 测量在本页自动去重关联显示并支持一键跳转,同时普通字符串标签(如 candidate:baseline-v1)、非标准短摘要以及带 measurement_error 的隔离记录不会被错误跨条关联。本 PR 明确不涉及:不包含跨分页(next_cursor 之外未拉取页面)全局聚合、不对非 sha256: 的普通字符串候选名自动合并,也不修改 Explore 后端数据契约或既有 ExploreMeasurements 渲染组件内部结构。

如果不做此项改善,研究结论越丰富,同一 sha256: 候选工件在多轮独立评估产生的分项量化指标就越分散,读者需要在左侧列表中来回翻找并自行核对是否属于同一产物;而若直接把普通非哈希字符串标签也纳入跨条合并,则可能把不同阶段同名局部标签(如 candidate:a)误拼到一起。本次将自动跨条关联严格锚定在唯一内容摘要 ENVELOPED_SHA256_PATTERN 且仅限“本页”范围,在零语义误连风险下提升了单页多指标核验效率。仓库内尚无专门针对本页跨结论测量聚合的独立书面规范,本次交付按既有 ExploreResultPage 与 ENVELOPED_SHA256_PATTERN 契约裁决。

改动思路 / Approach

整体实现保持纯粹的读侧界面派生结构:纯前端派生视图投影(derived projection):在 GoalExploreResults 中新增无副作用纯函数 relatedCandidateMeasurements 从当前已拉取页 findings 实时计算关联分组,完全复用既有 ENVELOPED_SHA256_PATTERN 与 ExploreMeasurements 组件,零后端/持久化新状态。当前评审边界:改动仅限 apps/presentation/dashboard/src/features/personal-workspace/goal-explore-results.tsx 与 goal-explore-results.css 两个前端展示文件(+38/-0),不引入任何状态存储、新接口或跨页请求。

  1. 严格匹配前提:relatedCandidateMeasurements(findings, selected) 从 selected.measurements 提取满足 ENVELOPED_SHA256_PATTERN.test(ref)(/^sha256:[0-9a-f]{64}$/)的候选摘要集合;若 selected 缺失摘要或不存在其他无 measurement_error 且命中同摘要的 finding,函数直接返回空数组,视图层保持零变化。
  2. 跨条去重与跳转:遍历本页其余 finding,仅保留非当前选中项、无 measurement_error 且包含匹配 sha256: 摘要的测量行,并以 JSON.stringify(row) 做全页跨行去重;输出卡片列表放在默认折叠的 <details className="explore-reader-details explore-related-measurements"> 中,每组以 <button className="explore-related-finding-source"> 展示来源问题/结论标题与时间状态,点击即调用现有 selectFinding(finding.finding_id, true) 切换主读区,指标主体完全复用 <ExploreMeasurements>。
  3. 替代方案权衡:未在后端 /api/chat/explore-results 扩写跨条关联字段,避免引入前后端契约耦合和跨页查询放大;待未来明确需要跨分页全库汇聚时,再由后端 Explore 能力统一扩展而不影响当前前端派生逻辑。

具体改动 / Changes

全部改动限定于以下 2 个前端文件,无后端、状态库或文档变更,无 RFC 双语同步需求,亦未引入新公共语义词表:

关键代码讲解

  1. goal-explore-results.tsx(relatedCandidateMeasurements 与 GoalExploreResults,约 L14-33、L87、L157-166):定义 relatedCandidateMeasurements 完成 ENVELOPED_SHA256_PATTERN 候选识别、排除 measurement_error 隔离记录以及 JSON.stringify(row) 去重;在正文摘要下方、来源范围上方插入默认收起的 .explore-related-measurements 详情区,并以 .explore-related-finding-source 按钮触发来源 finding 跳转。
  2. goal-explore-results.css(约 L32-34):为 .explore-related-measurements > section 设置垂直留白与 --pw-line 顶部分隔线,为 .explore-related-finding-source 设置 display: block、min-height: 44px(保障移动端与桌面触控最小热区)、max-width: 100% 与 overflow-wrap: anywhere 防止长标题撑破窄屏布局。

对主干的风险 / Risks

负向测试与非阻塞观察(P2)

  • P2(非阻塞)— 仓库现有测试尚未覆盖本新 UI 分支:PR 作者声明的 smoke:explore-timeline-scan 仅测 GoalResearchTimeline,research-measurements / research-finding-reader 仅测 GoalResearchHistory,仓库内尚无自动化测试直接覆盖 GoalExploreResults.relatedCandidateMeasurements。
  • P2(非阻塞)— PR 正文缺少首屏渲染截图:按仓库 First-Screen Review Evidence 约定,前端界面变更需在 PR 描述中包含对比截图。虽已由本次评审在本地完成桌面/窄屏真实渲染核验确认无排版问题,仍建议补图与补测。
  • 边界说明:当前以 selected.measurements 为种子仅去重“其余 sibling findings 之间的重复行”;若某 sibling 恰好与 selected 本身携带完全相同的测量行,仍会在折叠块中呈现一次以指明来源;另受限于当前设计,跨页(next_cursor 后续分页)测量不会出现,标题以诚实的“(本页)”明确界定范围。

本地构建与独立浏览器实测验证

  • 构建与 CSS 令牌静态校验:
    • npm --prefix apps/presentation/dashboard run build:desktop(tsc --noEmit && vite build):PASS;build:chat:PASS。
    • npm --prefix apps/presentation/dashboard run check:css-custom-properties:PASS(43 个样式表,0 未定义引用)。
    • npm --prefix apps/presentation/dashboard run smoke:explore-timeline-scan:PASS;既有浏览器测量烟测 research-measurements 与 research-finding-reader:PASS。
    • loopx check --scan-path ...(2 文件)与 loopx canary premerge --tier quick --from-git-diff --git-diff-base origin/main:PASS(ok: true, merge_gate_passed: true)。
  • 评审方独立 Chromium 真实渲染与交互核验(基于当前提交 build:chat 产物与合成 6 条混合 ExploreResultPage 数据,覆盖同一 sha256: 多条测量、重复指标行、带 measurement_error 的隔离项、普通字符串 candidate:baseline-v1 及短摘要 sha256:abcd1234):
    • 默认展开前 .explore-related-measurements 处于收起状态(open === false),点击展开后仅出现 2 条合法同摘要 sibling 组;重复 throughput 行已合并为 1 行;quarantined_metric 与 plain_score 均被正确排除。
    • 1440×900 桌面端:按钮实测尺寸 464px × 44px,1px --pw-line 边框与 6px 圆角、overflow: 0;点击按钮准确跳转到目标 finding Throughput and peak memory...。
    • 390×844 窄屏端:按钮自动换行(328px × 58px、230px × 44px),docOverflow: 0、readerOverflow: 0,数值与单位对齐无截断。

我的整体评价 / Verdict

  • Long-horizon 与 User experience 影响:long_horizon 为 preserved(零存储副作用与契约破坏);user_experience 为 improved,在同一候选 sha256: 产物有多条分散指标时显著降低手动跳转对比成本,默认折叠保持首屏简洁,同时不引入任何误连假阳性。
  • 可视化评审说明:PR #9138 直接修改研究结论详情页前端组件(GoalExploreResults)与样式表(默认折叠的关联测量细节块及来源跳转按钮),需在真实渲染视口下核验桌面端(1440x900 默认折叠与展开态)及窄屏端(390x844 展开态)的层级可读性、触控尺寸与零水平溢出。 本次已完成真实无头浏览器(1440×900 默认收起/展开/点击跳转与 390×844 窄屏展开)实景截图核验;未验证范围:多页分页(next_cursor 跨页场景)关联未覆盖(受限于本页设计边界),且 PR 描述正文尚未由作者附带公开发布用对比截图。
  • 综合结论:增量极小(+38/-0)、复用充分(ENVELOPED_SHA256_PATTERN 与 <ExploreMeasurements>)、零结构或排版退化,建议通过(APPROVE);可在后续小步补一条针对 GoalExploreResults 的 Playwright/单测断言并完善 PR 截图记录。

English verdict: APPROVE

@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.2-sol · OpenAI (runtime_reported, xhigh)

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

动机 / Motivation

在研究工作台复核同一候选的读者,需要把不同评测的测量值和各自来源对应起来。 旧版要逐条打开保存的结论,自己核对长摘要和各自的评测范围。 候选可在当前结论中展开本页同一候选的其他测量,仍可查看各自的范围、证据和原记录。 使用当前主干的本地整合树、真实组件和合成只读 API;已安装工作台和真实研究来源未独立复验。

改动思路 / Approach

以已有 SHA-256 类型标识候选,复用既有测量组件与选中结论的焦点处理。 当前交付边界是 apps/presentation/dashboard/src/features/personal-workspace/goal-explore-results.tsx。范围和来源仍由现有评测组件原样读回,跨评测发现同一候选时,各自的测量条件仍然独立。

具体改动 / Changes

精确头 870838c30a030fef1e17edaf496e75b1b0ee5bcd 的两处改动在当前主干本地整合树中逐字一致。生产 Dashboard 构建和差异空白检查通过。

关键代码讲解

  • literal-candidate-evidence 已实现。用完整摘要和当前页限定关联,按完整行去掉重复测量。普通同名标签、冲突归属、不同摘要及下一页记录均隔离。 基线 Explore 合约 关联规则
  • 展开后可检查各自指标、时间和来源,键盘激活来源按钮会把焦点移到原结论。测试样例中 0 ms 和未测量各自可辨,长摘要在窄屏换行。 原记录焦点 展开入口

对主干的风险 / Risks

同一份七条结论的样例在基线保留原测量,候选追加受限的关联展示。同名普通标签、不同摘要、归属冲突及跨页记录均不进入关联列表。过期分页显示错误,刷新回本页首个有效结论,随后可以正常翻页。 在 1440 和 390 像素都验证了键盘回源。恢复后第二页仍仅显示该页内容,返回第一页会恢复原结论与折叠状态。本次未查询托管 CI。

我的整体评价 / Verdict

APPROVE。 桌面保留左右两栏,窄屏使用现有下拉选择。两种宽度都先显示原结论和测量,关联、范围及长摘要按需展开。 使用当前主干的本地整合树、真实组件和合成只读 API;已安装工作台和真实研究来源未独立复验。

English verdict: APPROVE at 870838c30a030fef1e17edaf496e75b1b0ee5bcd. The Workspace links same-page measurements by exact candidate digest, preserves original provenance, and recovers after a stale cursor. Installed App and live research sources remain unverified.

@loopx-agent
loopx-agent merged commit 273719c into main Nov 21, 2026
40 of 41 checks passed
@loopx-agent
loopx-agent deleted the codex/research-candidate-measurements-20261120 branch November 21, 2026 13:24
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