feat(dashboard): read and compare team reports in Goal chat - #4828
Conversation
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
huangruiteng
left a comment
There was a problem hiding this comment.
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
Exact head reviewed: b242531a9228a529dbdc1ec152900ef5f656a179
动机
这个 PR 解决的是一个真实且边界清楚的阅读问题:现有团队执行面板已经能展示验收产物和版本依赖,但操作者必须在两个执行之间来回跳转、凭记忆比较内容。这里把“指定依赖版本”和“本次已验收产物”放到同一个证据面板里,同时坚持 operation/ref/SHA-256 精确匹配;因此它是 live-team workspace 的一个有用、可独立回滚的增量,而不是用视觉对照冒充正确性、独立验收或 requester adoption。
更小的“只加一个跳转链接”仍然保留跨页面记忆成本;引入完整语义 diff 框架又会扩大依赖和承诺。复用既有 owner-only readLoopXTeamWork,加一个 fail-closed 纯函数和局部两栏视图,是更合适的最小实现。
改动思路
入口仍是现有 GoalTeamEvidence。只有当前 result 同时包含依赖关系和已验收产物时,GoalTeamComparison 才显示来源按钮;点击后仍调用已有 read operation,不创建执行、不写 Todo、不改变验收或采用状态。
权威边界没有搬到前端:Python/typed collaboration owner 继续产生 DelegationDependency 的 current/unavailable 与版本绑定;前端的 comparisonSource 只做第二层 fail-closed 核验,要求 source operation、accepted/recovery/error 状态、ref、digest 和唯一匹配全部成立。异步请求用 generation fence 丢弃旧完成项,每次重试先清空旧选择,避免把上次成功内容留在新错误状态中。
正向路径是:执行证据 → 选择一个 dependency → 读取对应 operation → 精确找出绑定 artifact → 与显式选择的 output 并排显示。负向路径包括 digest 变化、重复匹配、source 非 accepted/recovery/error、读取失败以及旧异步响应;这些情况均不显示来源正文。input_ref 是接收方输入位置,relation 用于说明 responds_to/revises/uses;来源身份本身由 operation/ref/digest 完整绑定,因此没有再造一套关系判定。
具体改动
关键代码讲解
team-artifact-comparison.ts:6的comparisonSource是关键安全边界。它不接受“同 operation、同文件名但新 hash”,也不接受多个相同匹配;只返回一个精确 artifact。changedRange仅计算首尾公共行之间的范围,并在注释和 UI 中明确它不是 semantic diff。goal-team-comparison.tsx:19的compare复用现有 read API,并通过 generation fence、防陈旧 selection、显式 error/retry 保持失败状态诚实。组件只写 React 本地状态,没有外部 effect。goal-team-comparison.tsx:49的渲染使用 React 文本节点而非 HTML 注入;多输出有显式 selector,版本标识可展开,390px 下两栏改为单栏。页面文案明确“变化范围不代表结论正确或已被采用”。goal-team-evidence.tsx只是把新视图接入既有证据、lineage、feedback、pause 流程;没有复制这些 owner。- focused smoke 覆盖 exact/mismatch/duplicate/equal/insert/remove;真实 dashboard browser scenario 覆盖 literal
<script>文本不执行、移动端无横向溢出、hash 变化后清空、重试成功。源码模式和 committed packaged 模式都通过。
手工审阅了 desktop/mobile/unavailable 三张图:信息层级和窄屏堆叠可读,失败态不会保留来源正文;这不是 README/首页首屏改动。
对主干的风险
当前 blocker 不是 comparison 语义,而是 exact head 已经落后于主干,不能安全合并:
git merge-tree对当前origin/main复现了两个真实冲突:loopx/web/chat/asset-retention.json和loopx/web/chat/index.html。主干现在引用index-Bm1n7i_7.css/index-DgEJ-CB0.js,本分支引用index-HEW_sO3r.css/index-i1QlYZUg.js。简单选一边会丢掉主干最近的前端生成内容或本 PR 的 comparison bundle。- 当前远端状态是
DIRTY,并且test-shard (1)、test-shard (2)、pytest、merge-gate失败。两条 shard 的具体断言都落在另一组 priority-prefix 兼容变更上,而不是本 PR 的 comparison 文件;但这个陈旧 exact head 必须 rebase,旧 rollup 也不能跨新 head 继承。
最低修复:更新到当前 main,使用仓库既有 build 流程重新生成 chat bundle,让 index.html、当前 retention generation 与生成的 JS/CSS 同源;确认上一代资源仍按 retention 约定保留。然后在新 exact head 重跑:
npm run smoke:team-artifact-comparisonnpx tsc --noEmit- development 与 packaged 两个
team-evidencebrowser scenario git diff --check- repository-required checks
本轮已通过的证据:focused smoke、完整 dashboard typecheck、development browser、packaged browser、git diff --check,以及 loopx canary premerge --from-git-diff 的 16/16 选择性检查(0 failure、0 manual hold)。这些证明功能边界目前合理,但不能消除主干集成冲突。
语义与 CI 对齐
该变更复用现有 DelegationDependency / DelegationReadback vocabulary,没有新增状态值、protocol、CLI、authority 或 persistence owner;default 行为变化也已在双语 reference/RFC、命名 smoke 和合成截图中披露。机器强制的是精确版本核验;“变化范围不代表正确性/采用”是解释性 guidance,二者没有混写。新 head 仍需用当前主干的 required checks 重新验证。
我的整体评价
设计与实现本身值得保留:它在正确的 presentation owner 中复用了现有 readback,精确版本失败关闭、异步清理、安全文本渲染和窄屏体验都有针对性证据;没有发现第二套 authority、隐式 adoption、domain-specific 控制面文案或不必要框架。未来向 semantic diff 扩展也不应进入这一 PR,当前纯 helper 边界已经足够。
结论仍是 REQUEST_CHANGES,原因仅是当前 exact head 无法与最新 main 无冲突集成且 required-check rollup 非绿。请 rebase + regenerate packaged assets 后,以新 SHA 触发一次完整 exact-head 复审;现有功能证据可作为线索,但不继承结论。
English verdict: REQUEST_CHANGES - The exact-version comparison is well-designed and passes focused, source-browser, packaged-browser, and canary validation, but this exact head is DIRTY against current main with two generated chat-asset conflicts and a failed required-check rollup. Rebase, regenerate the packaged bundle/retention set together, and rerun validation on the new head.
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
…tory Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
huangruiteng
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
Exact head reviewed: 708d6294f7a798edfa843cdc78aa198a5a30c70f
动机
这个 head 已经把上一轮的“对照视图”补成一条完整、可用但不越权的阅读路径:配置后的 Goal 对话可以先看到已验收团队成果,选择后再按 operation/ref/SHA-256 重新核验正文;团队执行详情则允许把指定版本依据与本次产物并排阅读。旧路径要求用户打开执行详情、阅读原始产物并在页面间记忆版本,随着成果和依赖增多,导航成本与误读新版本为旧依据的风险都会累积。
更小的“只放链接”仍保留跨页面记忆成本;把 JSON 自动改写成叙述或引入 semantic-diff 框架又会扩大语义承诺。这里复用现有 inventory/readback、惰性 Markdown renderer、lineage 与 exact-version 字段,是一个独立有用、可回滚的展示增量。它明确不宣称 Goal 已完成、协调员已采用、模型已执行或整队已停止。
改动思路
入口一是 PersonalWorkspacePage -> GoalTeamResults:只在可写、已配置的 Codex Goal 对话中加载团队 inventory;列表只纳入 accepted、非 recovery 且带 artifact 的行。点击后才读取正文,并要求 inventory 中选择的 ref 在 readback 中唯一且 SHA-256 未变化,失败或变化都会先清除旧报告。
入口二是 GoalTeamEvidence -> GoalTeamComparison:用户显式选择 dependency 后复用同一个 read operation;comparisonSource 对 state、operation、accepted/recovery/error、ref、digest 和唯一性全部 fail closed。generation fence 会丢弃旧异步响应,重试前清空旧选择,避免旧成功内容残留在新错误状态。
权威边界没有搬到前端。协作 owner 仍决定 accepted/current/adopted 语义;前端只做精确绑定核验和可丢弃的阅读选择。Markdown 继续由既有 inert renderer 直接构造 React node,report 模式只新增表格;普通 chat 的 parser 行为保持不变,JSON/其他文本保留原值,原始 Markdown 可显式切换查看。
具体改动
关键代码讲解
goal-team-results.tsx:6的GoalTeamResults是原 Goal 对话中的只读入口。inventory 只取可展示的已验收行,正文必须在点击后重新核验 operation/ref/hash;page_readback_complete=false被诚实呈现为“部分工作无法核验”,不会把有界页面当成全量不存在。team-artifact-content.tsx:8的TeamArtifactContent/TeamArtifactReport统一主报告和对照视图。.md/.markdown默认走安全可读渲染,其余格式仍是精确<pre>;raw toggle 保留原文,不会修改 JSON 数值或解释 HTML/image/embed。team-artifact-comparison.ts:6的三个纯函数分别负责阅读默认、exact-version 唯一匹配和非语义 changed range。同名优先/同类型次优只影响右侧默认选择,不参与来源正确性判断。goal-team-comparison.tsx:19的compare复用现有 read API,通过 generation fence、防陈旧 selection、显式 error/retry 保持失败状态诚实;所有状态都是 React 本地投影,没有外部 effect。markdown.tsx:44的表格分支只在report=true时启用,要求 header/separator 列数一致,cell 仍走原有 inert inline renderer;普通对话保持原行为。
此外,已存在的文本压缩规则收敛到 compactWorkspaceText,completed task card 只压缩卡片 copy,详情仍保留完整事实;打包资产由同一 build 重新生成,重新执行 build 后 worktree 仍只有预先存在的未跟踪 uv.lock。
对主干的风险
我重点反证了“artifact 身份没变但内容变了仍被展示”这一高信任风险。当前实现要求 inventory 选择的 ref 唯一且 digest 相等;dependency 对照还要求 operation、accepted/no-recovery/no-error、ref、digest、cardinality 全部成立。changed report/source 的 browser route 都证明旧内容会被清空,新字节不会出现。literal <script> 保持文本,Markdown link 安全打开且没有 image/remote embed;开发态和 committed packaged 入口均通过同一场景。
本轮实际验证:
npm run smoke:team-artifact-comparison:exact/mismatch/duplicate/equal/insert/remove 通过;npm run smoke:team-report:可读表格、raw fidelity、安全链接、惰性 HTML 与普通 chat parity 通过;npm run build:TypeScript 与两个 Vite build 通过,只有既有 chunk-size advisory;- development 与 packaged
team-evidencebrowser scenario 均通过,覆盖报告选择、表格/raw、hash 变化清空、对照、移动端、重试、反馈与 zero model-turn; - desktop/mobile/result/comparison 截图已检查,窄屏无横向溢出;
git diff --check通过; - 对当前
origin/main的git merge-tree无冲突,GitHub 状态已从上一轮的DIRTY改为BEHIND。
远端仍不是可合并状态:当前 exact head 有 23 个成功检查和 7 个失败。失败具体落在 quota JSON 输出预算与 deferred-selection recovery 等控制面测试,并不在本 PR 的 UI/docs/bundle diff 中;当前 main 已包含后续修复提交。因此这不是本轮实现 finding,但必须更新到最新 main、重新生成/核验打包资产并让 required checks 在新 head 重新跑绿,不能把本次 APPROVE 当作 merge-readiness 结论。
语义与 CI 对齐
该变更复用既有 DelegationInventory、DelegationReadback、DelegationDependency、accepted/current/adoption vocabulary,没有新增状态值、协议、CLI、持久化或 authority。机器强制的是 operation/ref/hash/状态/唯一性核验;“变化范围不代表正确或已采用”是解释性 guidance,二者没有混写。默认变化只发生在已配置、可写的 Codex Goal 对话和已有 evidence dialog,未配置/只读/无 accepted artifact 的路径保持原状;inventory 加载不会读取正文、inspect member 或启动模型。
我的整体评价
结论是 APPROVE。上一轮的真实 blocker——旧 main 与生成资产冲突——已经通过集成 main 和同源重建消除;新增的可读成果入口与原对照切片共享一个 artifact renderer,也比复制展示规则更利于后续维护。没有发现第二套协作 authority、隐式 adoption、prose substring 状态分类、domain-specific 控制面文案或不必要的 diff 框架。
未来向 semantic diff、实时流式结果或完整 first-use 资格扩展都不应塞进这个 PR;当前 read-only、exact-version、fail-closed 的展示边界已经足够。唯一剩余动作属于 merge readiness:更新到当前 main 后在新 SHA 重跑 required checks,再由仓库策略决定合并。
English verdict: APPROVE - The exact-head implementation now delivers a cohesive read-only journey for accepted reports and exact-version source comparison, reusing the existing collaboration authority and inert renderer. Focused smokes, full build, development and packaged browser scenarios, visual checks, diff hygiene, and conflict-free current-main integration passed. The head is still BEHIND and its stale rollup contains unrelated control-plane failures, so update to current main and requalify required checks before merge; this approval does not grant merge authority.
Configured Goal conversations currently require opening execution details and reading raw artifacts to understand returned work. This change brings accepted reports into the original conversation and lets a user compare the exact dependency version with the result, preferring the same artifact name/type.
Markdown uses the existing inert renderer with readable tables and a source toggle. JSON keeps its original values. Failed or changed evidence clears the old report; showing a result does not assert Goal completion, requester adoption, or whole-team stopping. Completed task cards use the existing compact text rule while their details retain full task content. No new model call, API authority or scheduler is added.
The branch integrates current main, including #4814, and rebuilds packaged assets while retaining the prior main generation. Bilingual roadmap/domain checkpoints place dual-audience Lark confirmation at the optional request entry; real dual-card acceptance remains separate.
Validation: dashboard typecheck/build; report and comparison smokes; nine workspace browser scenarios; final packaged evidence/report scenario; demo-readiness base and home browser; exact-version failure, source safety, mobile/keyboard, idempotent feedback and scoped pause checks. Existing chunk-size advisory remains. Visual review uses synthetic browser fixtures; real-model execution, two continuing cycles and whole-team cancellation are not claimed by this presentation change.
Reuse/refactor: one inert artifact renderer across the main report and comparison; reused text compaction without changing canonical task facts. Maintainer merge required.