Repository navigation
Read complete native decisions in archived Goal executions - #9128
loopx-agent wants to merge 4 commits into
Conversation
Signed-off-by: LoopX Agent <[email protected]>
Signed-off-by: LoopX Agent <[email protected]>
Signed-off-by: LoopX Agent <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.1-sol · OpenAI (runtime_reported, low)
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
[P2] 保留别名来源中决策正文的原始 Goal 身份
当两个来源使用相同 native Goal id、其中一个通过 workspace_goal_id 区分时,SourceRunHistory 直接把 status 中的 run.agent_vision 作为“完整原始记录”交给 GoalStrategyDocument。但上游 projectGoalSourceStatus 会递归将整个 status 中匹配原始 id 的 goal_id 改为 workspace alias,包含 agent_vision 和未知嵌套字段。旁边显示 original Goal 标签并不能还原正文。
在本 head 上用实际 projection → runRecordSchema.parse → GoalStrategyDocument SSR 串联验证:native id original-solver、alias case-a;未使用 alias 的对照正文与 native 输入一致,使用 alias 后正文的 goal_id 和 future_field.goal_id 均为 case-a,native 输入仍为 original-solver。页面仍输出“Complete original record and source”。这会让用户复制或核对一份已被改写、却被标记为原始决策的记录。新消费点
递归重写器原本就存在;本 PR 的新增行为是开始保留、渲染它改写后的决策正文,所以这里报告的是新展示路径的来源保真缺陷。请在投影边界保留不可变的 native decision payload,或经原始 namespace/Goal 获取原始记录;仅将 workspace 路由字段映射为别名。增加通过真实 projection、schema 和 renderer 的 alias/non-alias 配对测试,并覆盖未知嵌套 goal_id。
动机 / Motivation
目标是让来源 Goal 的执行历史能读到完整原始 Agent 决策,包括未知字段和原始语言,而不只看到 checkpoint 或重新编写的摘要。这可以减少用户从多个工具拼接证据的成本。本 PR 不承担完整父目标或安装发布验收。只显示摘要无法满足原始记录的核查任务;复用已有 Markdown 和策略文档展示器是合理的小步交付。
验收依据为 frontend delivery 的来源连接约定,spec_revision 2000c395dbf564f0982a76efeeba5c298a5691b6。该约定明确 workspace alias 只用于本地路由,native Goal、Task/run 身份及历史分析范围保留原始 id。本次映射:source-original-identity 未满足,证据见上面的 alias 配对;source-read-only 的静态路径已检查,新抽屉移除了来源历史的会话操作,但真实后端权限负例未独立重跑;original-decision-content 的正常 schema/SSR 渲染通过,alias 内容保真失败;source-switch-recovery 静态检查有 scope 绑定和错误/重试状态,实际浏览器失败恢复仍未独立验证。以上标识是本次对该段无编号要求的映射,不是新创设产品门槛。
改动思路 / Approach
status schema 保留可选决策字段;dashboard 把来源 Goal 的 recent runs 映射到 workspace model;抽屉使用同一个 GoalStrategyDocument 显示原生决策。相比另建摘要 owner,这条路径避免重复定义决策语义。策略面板将加载快照与 Goal/source URL 绑定,可以在来源切换时立即隐藏旧内容。
最强的反对理由是:直接暴露 status 投影并不自动得到原始决策。现有 projectGoalSourceStrategies 从来源历史读取原始内容,而 status 路径会做路由投影。两者必须在来源身份上达成一致后,才能把新增路径称为完整原始记录。不需要扩大为新历史服务或重写控制面。
具体改动 / Changes
精确 head a87ad0d92fedde181584d2f9da31dfefdd4a866d;9 个文件,+187/-44。覆盖 schema、workspace model、dashboard 映射、抽屉、策略 renderer、双语文案、样式、测试及 package script。
runRecordSchema:增加agent_id、turn_instance_id、agent_vision、vision_checkpoint;可选字段通过 nullish/catch 保持旧记录兼容,未知 decision 字段保留在 record 中。基础兼容和中英文 SSR 测试已独立执行通过。SourceRunHistory:以时间、turn、checkpoint 和完整决策组织已有 recent runs;来源信息只读。recent仍是 status 当前提供的有界历史,不是全量历史下载承诺。新增消费点没有验证正文仍属于 native 身份。GoalStrategyDocument/NativeDecisionFields:复用 Markdown 展示、递归保留对象和数组、提供原记录 disclosure;不从字符串内容推断执行权限。SSR 确认未知字段进入输出,但这不能弥补上游重写。GoalSourceStrategies:按来源 scope 绑定快照,静态看能避免切换后先显示上一来源正文;真实异步竞态、503、键盘和窄屏体验没有在本次独立复验。
验证:PASS:本 head 的 native-decision-read.test.mjs 经 Vite SSR 构建后执行,输出兼容、完整字段与双语 provenance 通过;PASS:独立 projection/schema/renderer 探针完成运行。探针中正常身份对照保真;FAIL:alias 条件的原始身份保真。最初探针对整个 status 不可变的断言过宽,因为 owner 会给外层 status 添加来源元数据;改为只比较原始 native payload 后重跑通过,并保留上述失败事实。构建存在 lucide use client SSR 提示,未作为产品错误。
对主干的风险 / Risks
风险集中在多个来源同名 Goal 的来源保真;不是写入权限扩大。静态检查中普通 Goal 不会进入 sourceRunHistory 分支,新增 schema 字段为可选,未看到 scheduler、quota 或持久化权限的新增路径。来源开关关闭时的完整浏览器/真实 backend parity、本地完整构建、packaged/installed App、真实来源错误恢复及整个 test suite 未独立执行,因此不宣称全链路交付或 feature-off 全面验证。按配置未查询、轮询或等待 CI;CI 不明不作为本次 blocker。
本轮没有独立检查真实首屏,作者提供的截图、503 和来源隔离说明仍是待复验的作者证据。不会把 SSR 等同于桌面或窄屏验收。已有 repository experience 中“先检查首个有用用户旅程”的建议适用于这次来源阅读;本轮落实为真实投影到 renderer 的数据路径检查,尚未形成完整视觉验收。
我的整体评价 / Verdict
交付方向与原始决策阅读目标一致,复用现有 renderer 的规模合理,也没有要求本 PR 完成整个父目标。但 alias 正是来源连接支持的合法场景,这条新路径会把改写的身份展示成原始记录,需先修复。其余未独立验证项保持 UNVERIFIED,不据此额外编造具体功能缺陷。修复后重跑 alias/non-alias 配对及未知字段保真,并补齐真实来源切换/失败恢复和首屏证据,再重新评审该 head。未执行 merge。
English verdict: REQUEST_CHANGES. Head a87ad0d92fedde181584d2f9da31dfefdd4a866d misrepresents aliased decision payloads as original records. Native schema/SSR test passes; the real projection-to-renderer counterexample confirms the provenance defect. Browser and packaged acceptance remain unverified.
| {run.vision_checkpoint ? <code>{run.vision_checkpoint.decision}</code> : t("drawer.sourceRunUnrecorded")} | ||
| </dd></div> | ||
| </dl> | ||
| {run.agent_vision ? <GoalStrategyDocument executionRecord value={run.agent_vision} |
There was a problem hiding this comment.
[P2] 当 source link 使用 workspace alias 时,上游 projectGoalSourceStatus 已递归改写 agent_vision 中的 goal_id(包括未知嵌套字段)。这里把该投影交给标为“完整原始记录”的 renderer,正文因此不再等于 native 决策。实际 projection → schema → SSR 配对中,original-solver/case-a 产生 bodyMatchesNative=false,非 alias 对照为 true。请保留 native payload 或读取原始 source-qualified 记录,并用真实投影路径覆盖 alias + 未知嵌套 goal_id。
Signed-off-by: LoopX Agent <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Gemini · Google DeepMind · self_reported
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)
复审说明:上一轮 alias 来源保真 [P2] 已在精确 head 71a232523b 修复
针对上一轮在 a87ad0d92f 上提出并挂在 apps/presentation/dashboard/src/features/personal-workspace/context-drawer.tsx#L85 的未解决线程(PRRT_kwDOStEbEs653P63):已在 71a232523bd20275580344fa6a181097aa7d4914 独立核验 loopx/control_plane/presentation/goal_source_links.ts#L105-L107 与 apps/presentation/dashboard/src/features/personal-workspace/native-decision-read.test.mjs#L27-L52。projectGoalSourceStatus 现已将 agent_vision 作为不透明原生文档整块保留(外层 run.goal_id、goal.id 与 goal_filter 仍映射为 workspace_goal_id),实测 original-solver / case-a 配对 SSR 渲染未再将别名写入决策正文或未知嵌套 future_field.goal_id。因本轮为只读复审且不操作他人线程,该未解决线程仍保持原状等待作者或权限方收口。
[P2] GoalStrategyDocument 中的 NativeDecisionFields 重复渲染已有文本节点,导致 smoke:runtime-source-workspace 浏览器回归失败
- 触发条件与路径:
apps/presentation/dashboard/src/features/personal-workspace/goal-source-strategies.tsx#L168-L191中,共享组件GoalStrategyDocument先以结构化段落渲染vision_patch.vision_summary等核心字段(#L170-L181),随后又新增<details><summary>完整决策字段</summary><NativeDecisionFields value={value}/></details>(#L182-L184),而NativeDecisionFields(#L195-L200)对整个value递归调用<MarkdownText>生成相同的<p>节点(即使<details>处于折叠状态也会进入 DOM)。 - 基线对比与实测失败证据:在 PR 共同基线
2000c395dbf564f0982a76efeeba5c298a5691b6上执行npm --prefix apps/presentation/dashboard run build && npm --prefix apps/presentation/dashboard run smoke:runtime-source-workspacePASS(runtime source workspace browser smoke: ok)。在精确 head71a232523bd20275580344fa6a181097aa7d4914上执行同一命令 FAIL:在examples/personal-workspace-browser/runtime-source-workspace-browser-smoke.mjs#L203(策略历史区域检查字体大小)抛出locator.evaluate: Error: strict mode violation: getByRole('region', { name: '策略历史', exact: true }).getByText('Retained original objective 22', { exact: true }) resolved to 2 elements(且后续 #L210/#L213/#L215/#L217/#L230/#L242 存在同型定位)。 - 实际影响:直接破坏仓库既有的研究来源浏览器端到端回归套件
smoke:runtime-source-workspace;同时用户在展开“完整决策字段”查看future_field等额外字段时,也会再次读到上方已完整展示过的所有已知段落(而完整原始 JSON 已在下方“完整原始记录与来源”<pre>中提供)。 - 最小修复与回归验证:建议在
GoalStrategyDocument中让<details>仅通过NativeDecisionFields渲染尚未在上方结构化章节展示的未映射字段/子键(保持“完整原始记录与来源”提供全部原始 JSON),或若确实保留全量value渲染则同步调整examples/personal-workspace-browser/runtime-source-workspace-browser-smoke.mjs的语义定位范围并保留其字体与正文断言;修复后重新执行npm --prefix apps/presentation/dashboard run build && npm --prefix apps/presentation/dashboard run smoke:runtime-source-workspace与npm --prefix apps/presentation/dashboard run test:native-decision-read。
动机 / Motivation
受影响的调用方为在工作台通过只读来源链接查看归档 Benchmark Goal 或源策略历史的用户与维护者。
修改前,来源 Goal 的执行历史抽屉仅暴露检查点标签而不展示保留的原生 Agent 决策正文,且策略历史切换来源时旧快照可能短暂残留;同时在 a87ad0d 阶段存在 workspace alias 递归改写 agent_vision 内部 goal_id 的来源保真问题。修改后,ContextDrawer 通过 SourceRunHistory 复用 GoalStrategyDocument 渲染最近执行记录与未知决策字段,GoalSourceStrategies 按来源 scope 绑定快照,且 projectGoalSourceStatus 将 agent_vision 视为不透明原生文档保留原始 goal_id。
在精确 head 71a2325 上,已验证别名与非别名投影到 SSR 渲染链路的原始身份保真(test:native-decision-read 与 goal_source_links.test.ts 全过)、完整前端构建与 18 项 canary premerge 通过;但新增的 NativeDecisionFields 在 GoalStrategyDocument 内对所有已知字段再次输出了相同文本 DOM 节点,导致仓库既有浏览器回归 smoke:runtime-source-workspace 在对照基线通过的断言处因 strict mode 匹配到 2 个元素而失败。
本 PR 不改变后端只读权限或引入执行控制,不实现完整的案例研究交付、artifact 解析或正式桌面 App 安装验收。
不修复该功能无法在工作台直观核对归档 Goal 执行记录的决策原文;在现有来源投影与 GoalStrategyDocument 之间补全消费契约属于最小可行方案。
改动思路 / Approach
本 PR 在状态 schema(apps/presentation/dashboard/src/data/status.ts)放开可选的 agent_id、turn_instance_id、vision_checkpoint 与 agent_vision(通过 .nullish().catch(null) 保持历史畸形数据兼容),并在 dashboard-page.tsx 为带 source_access 的 Goal 填充 sourceRunHistory;抽屉(context-drawer.tsx 中的 SourceRunHistory)和策略历史(goal-source-strategies.tsx)统一消费抽出后的 GoalStrategyDocument,且 GoalSourceStrategies 通过 scope 将已加载快照绑定到当前 goalId:originalGoalId:sourceUrl,确保切换来源时旧内容立即可见消失。控制面 projectGoalSourceStatus 在 71a232523b 修复为跳过 agent_vision 子树,使路由别名仅作用于外层包装字段。
复用 GoalStrategyDocument 作为策略历史与归档执行记录的共享只读渲染器,并在 projectGoalSourceStatus 边界保留 agent_vision 原始载荷,避免在前端重新同步状态或复制策略渲染语义;但 NativeDecisionFields 无差别重绘已展示的字段导致 DOM 重复文本节点,破坏了同一共享组件下游既有浏览器测试契约。
当前改动严格限定在只读状态 schema、来源路由投影不透明边界与前端抽屉/策略展示层;在保留共享渲染器的同时,需消除 NativeDecisionFields 对既有结构化正文的 DOM 文本重复(或同步更新既有浏览器 smoke 选择器)并通过完整浏览器回归。
具体改动 / Changes
本次精确 head 71a232523bd20275580344fa6a181097aa7d4914 共修改 10 个文件(+218/-44),涵盖控制面投影(goal_source_links.ts +3/-0)、仪表盘数据层与模型(status.ts、personal-workspace-model.ts、dashboard-page.tsx)、UI 与样式文案(context-drawer.tsx、goal-source-strategies.tsx、i18n.tsx、personal-workspace.css)以及测试/脚本(native-decision-read.test.mjs、package.json)。规范依据为 docs/development/frontend-delivery.md(spec_revision 2000c395dbf564f0982a76efeeba5c298a5691b6)中的来源连接约定:
source-original-identity:implemented(loopx/control_plane/presentation/goal_source_links.ts#L105-L107与native-decision-read.test.mjs#L27-L52验证通过)。source-read-only:implemented(SourceRunHistory与ContextDrawer对sourceRunGoal隐藏执行按钮与会话控制,仅保留只读标签与记录)。original-decision-content:not_met(虽然未知字段与别名文本已正确渲染,但NativeDecisionFields在GoalStrategyDocument内重复输出已渲染正文,导致既有浏览器验收测试smoke:runtime-source-workspace失败)。source-switch-recovery:implemented(GoalSourceStrategies的scope绑定通过构建与静态核验,smoke:status-source-switch-browser通过;GoalSourceStrategies全量浏览器开关切换在smoke:runtime-source-workspace中因第 203 行阻断未能执行至后半段)。
关键代码讲解
projectGoalSourceStatus(loopx/control_plane/presentation/goal_source_links.ts#L91-L123):在route(value, key)中增加if (key === "agent_vision") return value;(#L107),使agent_vision及其任意深度的嵌套字段(如future_field.goal_id)不再被重写为workspace_goal_id,而外层run.goal_id、goal.id与goal_filter仍映射为本地路由别名,保证dashboard-page.tsx#L1153的goal.latest_runs.filter(run => run.goal_id === goal.id)正常匹配。SourceRunHistory(apps/presentation/dashboard/src/features/personal-workspace/context-drawer.tsx#L60-L94):展示来源标签、只读标识、原 Goal id 与最近记录计数;每条记录展开后显示classification、turn_instance_id、vision_checkpoint.decision,若有agent_vision则调用GoalStrategyDocument渲染,否则明示“这条执行记录未保留完整决策正文”。同时ContextDrawer在selection.kind === "run"且命中sourceRunGoal时隐藏本地执行会话页签与高级诊断。GoalStrategyDocument与NativeDecisionFields(apps/presentation/dashboard/src/features/personal-workspace/goal-source-strategies.tsx#L150-L200):抽离共享只读组件并新增executionRecord标识以区分“执行记录身份”与“版本”;但在结构化章节后无条件追加<details><summary>完整决策字段</summary><NativeDecisionFields value={value}/></details>,在渲染未知字段的同时也复制了已展示的正文 DOM 节点。GoalSourceStrategies(apps/presentation/dashboard/src/features/personal-workspace/goal-source-strategies.tsx#L54-L81):将snapshot升级为{scope, value}结构,仅当loaded?.scope === scope时返回快照,切换goalId/originalGoalId/sourceUrl时同步清零旧快照,避免错源闪现。runRecordSchema(apps/presentation/dashboard/src/data/status.ts#L535-L545):使用.nullish().catch(null)宽容接收agent_id、turn_instance_id、agent_vision与vision_checkpoint,确保畸形历史字段降级为null而非打断整份 status 解析。
对主干的风险 / Risks
- 回归与负面路径分析:
- 既有共享组件消费回归(P2):
GoalStrategyDocument引入重复正文 DOM 节点直接破坏smoke:runtime-source-workspace(基线2000c395dbPASS -> head71a232523bFAIL atruntime-source-workspace-browser-smoke.mjs#L203)。 - 浏览器无关预存失败归因:
smoke:workspace-scope-packaged在workspace-scope-browser-smoke.mjs#L135(等待“添加图片”按钮超时)于基线2000c395db与 head71a232523b上产生完全一致的失败签名,且本 PR 未修改对话附件逻辑,归类为pre_existing_unrelated,不作为本 PR 的 blocker。 - feature-off / 普通本地 Goal 隔离:
dashboard-page.tsx#L1151-L1154仅在goal.source_access存在时生成sourceRunHistory,context-drawer.tsx#L398-L400与#L940对本地 Goal 保持原有personal-goal-session与runDetails路径,静态与构建验证未受影响。
- 既有共享组件消费回归(P2):
- 本地验证摘要(CI 未参考 /
wait_for_ci: false):npm --prefix apps/presentation/dashboard run test:native-decision-read(含71a232523b别名/非别名 SSR 配对):PASS。node --experimental-strip-types --test tests/control_plane_ts/goal_source_links.test.ts:PASS(15/15 passed)。npm --prefix apps/presentation/dashboard run build(tsc --noEmit && vite build && build:chat)与check:css-custom-properties:PASS。smoke:research-analysis-read、smoke:presentation-surface-schema、smoke:status-projection-contract、smoke:status-source-switch-browser:PASS。loopx canary premerge --from-git-diff --git-diff-base origin/main(standard 档,10 catalog canaries + 8 risk-profile smokes):PASS(18/18 passed)。npm --prefix apps/presentation/dashboard run smoke:runtime-source-workspace:FAIL(P2 PR 回归:基线2000c395dbPASS,head71a232523b在第 203 行因重复文本节点报 strict mode violation)。npm --prefix apps/presentation/dashboard run smoke:workspace-scope-packaged:FAIL(归因为pre_existing_unrelated,基线2000c395db同位置同签名失败)。
我的整体评价 / Verdict
本 PR 在精确 head 71a232523bd20275580344fa6a181097aa7d4914 上圆满修复了上一轮 a87ad0d92f 的 alias 决策正文改写缺陷,跨语种可选字段兼容、source-scope 快照隔离与 18 项 premerge 门禁均表现扎实;在无头 Playwright 上对打包后的 71a232523b SourceRunHistory 抽屉进行了桌面端(1440px 默认折叠与展开态)及窄屏(390px 展开态,scrollWidth <= innerWidth)实景核验,并对照了作者在 a87ad0d92f 提供的两张裁剪截图(a87ad0d92f..71a232523b 无 UI/CSS 改动),层级清晰、缺省“未保留完整决策正文”状态明确且无执行越权入口。但 GoalStrategyDocument 新增 NativeDecisionFields 时重复输出了上方已展示的决策文本节点,直接导致仓库既有浏览器回归 smoke:runtime-source-workspace 在对照基线通过的断言处失败(observable_semantics 发生回归)。未引入新协议词汇(沿用既有 agent_vision / source_access 模型)。需消除 GoalStrategyDocument 重复 DOM 文本节点(或合理收口并验证 smoke:runtime-source-workspace 全量通过)后再予批准。在打包产物上使用无头 Playwright 对 71a2325 的 SourceRunHistory 抽屉执行了桌面 1440px(默认折叠与展开态)与窄屏 390px(展开态,无横向溢出)实景截屏检查,并复核了作者在 a87ad0d 提供的 ANN/Codec 抽屉截图(a87ad0d92f..71a2325 无 TSX/CSS 变更);但 GoalSourceStrategies 在既有浏览器回归 smoke:runtime-source-workspace 第 203 行失败。 未验证范围:GoalSourceStrategies 在 smoke:runtime-source-workspace 第 203 行之后被阻断的策略切换与错误重试浏览器路径。
English verdict: REQUEST_CHANGES — the prior alias-provenance P2 is verified fixed at exact head 71a2325, but NativeDecisionFields inside GoalStrategyDocument duplicates prose DOM nodes and breaks the existing smoke:runtime-source-workspace browser check at line 203 (passes on base 2000c39, fails on head).
Archived benchmark Goals previously exposed checkpoint labels without the retained agent decision body. The execution drawer now reads the original source's recent records, renders complete decisions with the shared strategy document, and retains every original field in an expandable view. Missing decision bodies stay explicitly unknown. Source identity and read-only boundaries remain visible; switching sources cannot display the previous source's snapshot.
The optional parser fields tolerate malformed historical entries. Existing strategy documents keep their original raw provenance record. The shared renderer replaces duplicated presentation; no backend authority or execution controls were added.
Review correction
Workspace aliases previously rewrote
goal_idinside native agent decisions, including unknown nested fields. The source-status owner now treats the existingagent_visiondocument as opaque: the enclosing run still routes by workspace alias while the original body retains its native identity.At
71a232523b, the new real projection → schema → English/Chinese renderer regression reproduces the alias failure on the preceding implementation and passes with the correction, including nested objects/arrays and unchanged native input. All 15 existing source-link tests pass. The paired no-alias case preserves existing behavior. No UI layout or new protocol vocabulary is introduced.The current correction has not repeated the full packaged/browser/premerge checks below; those remain evidence for the earlier tested revision. Reused local dependency packages for the focused SSR build; no package installation or formal App change.
Earlier validation (
a87ad0d92f)Visual evidence
Tested revision:
a87ad0d92fon verifiedmainbase2000c395db. Packaged dashboard with the real retained-data backend, not installed native App acceptance. Crops show the actual first drawer viewport and remove surrounding private workspace; desktop ANN then narrow Codec.Visual evidence — packaged candidate with real retained benchmark data; surrounding private workspace cropped.


Remaining boundaries
The prior head received a source-provenance finding; the fix at
71a232523bawaits independent re-review. This slice does not claim complete case-study delivery: execution package/artifact resolution, parent comparison and formal App adoption remain open. No merge, installation or service switch is included.