@tea-agent/loop-agent 0.52.0-next.1 → 0.52.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -21
- package/dist/build-stamp.json +3 -3
- package/dist/cli/command-definitions.js +1 -75
- package/dist/cli/help.js +1 -1
- package/dist/cli/program.js +1 -28
- package/dist/commands/init-accepted-merge.js +46 -0
- package/dist/commands/init-upgrade.js +114 -2
- package/dist/commands/init.js +79 -12
- package/dist/shared/operator/capabilities.js +0 -122
- package/dist/shared/update/npm-client.js +14 -3
- package/dist/task/config-types.js +5 -10
- package/dist/task/read-model.js +0 -4
- package/dist/task/runtime.js +0 -1
- package/dist/worker/console/chat/api-workbench-core.js +17 -6
- package/dist/worker/console/chat/api-workbench.js +2 -0
- package/dist/worker/console/chat/chat-event-projection.js +2 -0
- package/dist/worker/console/chat/chat-event-store.js +32 -2
- package/dist/worker/console/chat/chat-references.js +4 -0
- package/dist/worker/console/chat/pi-runtime/custom-tools/apiworkbench-tools.js +65 -3
- package/dist/worker/console/chat/pi-runtime/sdk-bindings.js +4 -0
- package/dist/worker/console/chat/pi-runtime.js +274 -94
- package/dist/worker/console/chat/repo-browser.js +5 -2
- package/dist/worker/console/chat/repo-preview-kind.js +16 -6
- package/dist/worker/console/chat/routes.js +295 -25
- package/dist/worker/console/chat/subagents/jobs.js +115 -4
- package/dist/worker/console/chat/terminal-sessions.js +36 -2
- package/dist/worker/console/chat/tool-exposure-catalog.js +1 -1
- package/dist/worker/console/chat/tool-preview.js +22 -0
- package/dist/worker/console/chat/turn-process.js +52 -0
- package/dist/worker/console/chat/vcp-prompt.js +14 -9
- package/dist/worker/console/chat/workspace-changes.js +137 -0
- package/dist/worker/console/console-update-runtime.js +5 -1
- package/dist/worker/console/operator-actions.js +7 -6
- package/dist/worker/console/operator-user-error.js +5 -1
- package/dist/worker/console/routes.js +1 -1
- package/dist/worker/console/server.js +89 -5
- package/dist/worker/console/static/assets/FilePreviewDocx-ybM3ZqSl.js +9 -0
- package/dist/worker/console/static/assets/abnfDiagram-N423BO3Z-CM5ocMUs.js +1 -0
- package/dist/worker/console/static/assets/{arc-Bkf_oc0_.js → arc-CDapwdTN.js} +1 -1
- package/dist/worker/console/static/assets/architectureDiagram-T3A2C74G-Ogy4GOqS.js +36 -0
- package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-D62uVvbI.js → blockDiagram-VBNYF7ZC-DsiaOIgU.js} +1 -1
- package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-Iq0Y8Afx.js → c4Diagram-5PPSVZJV-B84hhgSe.js} +1 -1
- package/dist/worker/console/static/assets/channel-BCVzSVXD.js +1 -0
- package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-D1TxRE3k.js → chunk-2GRJ4B5K-SPqOhMla.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-BE-DHkAO.js → chunk-2Q5K7J3B-BL0Q4ZV3.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5RXB4S5H-t0iYO8Cc.js → chunk-5RXB4S5H-CJpOcFAh.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5VM5RSS4-Clo2nExi.js → chunk-5VM5RSS4-DQC6vqVW.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-C7bSpo-3.js → chunk-6Q2QTUOP-D4dq_L0l.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-GF5L2VYU-DorZaymh.js → chunk-GF5L2VYU-DVNZmiVo.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-JWPE2WC7-Ch_4HvyJ.js → chunk-JWPE2WC7-B1yOfAhr.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-KBJHAD2P-yaSoFe-3.js → chunk-KBJHAD2P-BEPc1N6N.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-RYQCIY6F-QpjaXecS.js → chunk-RYQCIY6F-Da_-gMwh.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-XXDRQBXY-B3t6cycg.js → chunk-XXDRQBXY-C75eW9DT.js} +1 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-BRlRsJR0.js +1 -0
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-BRlRsJR0.js +1 -0
- package/dist/worker/console/static/assets/cose-bilkent-JH36ORCC-C4Gn7eYB.js +1 -0
- package/dist/worker/console/static/assets/{cynefin-VYW2F7L2-CP8LtrOl.js → cynefin-VYW2F7L2-BIFL8KrA.js} +1 -1
- package/dist/worker/console/static/assets/cynefinDiagram-MW4NZA55--CBwVt18.js +62 -0
- package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-BK0ua9V8.js → dagre-VZM6K2ZE-B8dBxboB.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-7IWD3JNH-t9-HP13j.js → diagram-7IWD3JNH-hKtlE0w-.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-L5Sg9jMD.js → diagram-B4RE2ZJO-BKirx0F3.js} +1 -1
- package/dist/worker/console/static/assets/diagram-LBJQPF4R-bkx-oUrD.js +24 -0
- package/dist/worker/console/static/assets/diagram-Q27KOJAE-D7sFtSjr.js +24 -0
- package/dist/worker/console/static/assets/diagram-UB23O5K3-BPjzGBV_.js +41 -0
- package/dist/worker/console/static/assets/docx-preview-CAbT0VNs.js +23 -0
- package/dist/worker/console/static/assets/docxPreview-D_T4B7qe.js +1 -0
- package/dist/worker/console/static/assets/ebnfDiagram-BXEA7PRR-DODv-GbM.js +1 -0
- package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-CNOuj3BO.js → erDiagram-JOGREHBK-DbfVp5uI.js} +1 -1
- package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-h_Cyayai.js → flowDiagram-UKHOOZJN-BHWWThbx.js} +1 -1
- package/dist/worker/console/static/assets/ganttDiagram-PKOTCBZU-SWY_8oU3.js +292 -0
- package/dist/worker/console/static/assets/gitGraphDiagram-DS77QQ5N-CJdhHY-i.js +106 -0
- package/dist/worker/console/static/assets/infoDiagram-6WML65LV-CLC4mTWX.js +2 -0
- package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-DAdf5lHp.js → ishikawaDiagram-WSZJBQD7-CiJDWOmX.js} +1 -1
- package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-BQbGtg66.js → journeyDiagram-NVQOT4AX-eIQfMD0f.js} +1 -1
- package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-CetLubYc.js → kanban-definition-27J2QSJJ-3d6r1cG7.js} +1 -1
- package/dist/worker/console/static/assets/{linear-DLZOjaVz.js → linear-BjbmxxDk.js} +1 -1
- package/dist/worker/console/static/assets/main-B9ZnQejR.css +1 -0
- package/dist/worker/console/static/assets/main-D4knTr0R.js +644 -0
- package/dist/worker/console/static/assets/{mermaid.core-B_xZl_gM.js → mermaid.core-CD2GFYrr.js} +5 -5
- package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-Dzo3dzp0.js → mindmap-definition-FAOFIHXS-D0ORXhx-.js} +1 -1
- package/dist/worker/console/static/assets/pegDiagram-VL7TDLO6-BqNbcp7_.js +1 -0
- package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-Cp3YrVzQ.js → pieDiagram-7S7Q4E2Y-CGO0Y13N.js} +1 -1
- package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-4tI5mUgW.js → quadrantDiagram-CIZ2JOQS-vH4fdvTV.js} +1 -1
- package/dist/worker/console/static/assets/railroadDiagram-AXF67PYL-B_sbmiFS.js +1 -0
- package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-DY-0JqdT.js → requirementDiagram-LRYGKXZP-DbHtPigL.js} +1 -1
- package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-DuJIzRKC.js → sankeyDiagram-W5VNT64P-BcqNS0Ko.js} +1 -1
- package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-BTbVJ85l.js → sequenceDiagram-SI44F4Z6-5Zf3xJfg.js} +1 -1
- package/dist/worker/console/static/assets/{sheet-workbook-BPPh1uLw.js → sheet-workbook-Bvq6WFll.js} +2 -2
- package/dist/worker/console/static/assets/sizeCapture-X5ZJPWSS-BoO7GXeG.js +1 -0
- package/dist/worker/console/static/assets/stateDiagram-OKZ733FA-3suojNXT.js +1 -0
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-Bq6cg1c9.js +1 -0
- package/dist/worker/console/static/assets/swimlanes-SLNWSIFB-B5CyFSLq.js +2 -0
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-VvJzDuB_.js +8 -0
- package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-GR6lxokn.js → timeline-definition-Z64GVDOM-BuZ_HcXz.js} +1 -1
- package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-DEkwyzsF.js → vennDiagram-T6HMQDX7-CJ_IDS7Q.js} +1 -1
- package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-W5jnvEJ3.js → wardleyDiagram-T6FBY63Y-BpKLb-Su.js} +1 -1
- package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-cqsloioo.js → xychartDiagram-ELKLHX3M-Mdo6gaIk.js} +1 -1
- package/dist/worker/console/static/docx-preview.html +25 -0
- package/dist/worker/console/static/index.html +3 -2
- package/dist/worker/console/static/vcp/fonts/README.md +28 -0
- package/dist/worker/console/static/vcp/vendor/vcp-engine-v1.js +4 -4
- package/dist/worker/console/static-src/operator-chat/StateDot.js +17 -0
- package/dist/worker/console/static-src/operator-chat/chat-font-size.js +90 -0
- package/dist/worker/console/static-src/operator-chat/chat-session-order.js +96 -0
- package/dist/worker/console/static-src/operator-chat/chat-sse-events.js +8 -1
- package/dist/worker/console/static-src/operator-chat/details-rail-surfaces.js +2 -0
- package/dist/worker/console/static-src/operator-chat/file-touch.js +107 -0
- package/dist/worker/console/static-src/operator-chat/open-preview-in-browser.js +44 -0
- package/dist/worker/console/static-src/operator-chat/reference-display.js +7 -1
- package/dist/worker/console/static-src/operator-chat/tasks-auto-open.js +100 -0
- package/dist/worker/console/static-src/operator-chat/tasks-layout-tween.js +103 -0
- package/dist/worker/console/static-src/operator-chat/tasks-model.js +657 -0
- package/dist/worker/console/static-src/operator-chat/tasks-view-glide.js +96 -0
- package/dist/worker/console/static-src/operator-chat/turn-group-equality.js +1 -0
- package/dist/worker/console/static-src/operator-chat/use-auto-animate.js +61 -0
- package/dist/worker/console/static-src/operator-chat/useChatSessions.js +194 -47
- package/dist/worker/console/static-src/operator-chat/useChatStream.js +4 -0
- package/dist/worker/console/static-src/operator-chat/useChatThread.js +18 -0
- package/dist/worker/console/static-src/operator-chat/useRepoBrowser.js +111 -21
- package/dist/worker/console/static-src/operator-chat/useRuntimeControls.js +91 -47
- package/dist/worker/console/static-src/operator-chat/useVcpPreferences.js +1 -1
- package/dist/worker/console/static-src/operator-chat/vcp-fonts.js +180 -22
- package/dist/worker/console/static-src/operator-chat/vcp-frame.js +3 -3
- package/dist/worker/console/static-src/shell/console-update-progress.js +16 -0
- package/dist/worker/console/static-src/shell/console-update-reload.js +4 -1
- package/dist/worker/console/static-src/shell/workspace-route.js +0 -2
- package/dist/worker/console/vite.config.js +5 -1
- package/dist/worker/console/workspace-registry.js +62 -19
- package/dist/worker/observe/static/operator-chrome.js +0 -1
- package/dist/workflows/dag/backend-test-scenario-param.js +60 -4
- package/dist/workflows/dag/dynamic-runtime/reduction.js +7 -2
- package/dist/workflows/dag/frontend-test-framework-adapters.js +11 -2
- package/dist/workflows/script/windows/guest.js +13 -2
- package/dist/workflows/script/windows/native.js +21 -3
- package/docs/architecture/dag-execution.md +2 -13
- package/docs/architecture/facts-and-state.md +2 -3
- package/docs/architecture/runtime-boundaries.md +2 -2
- package/package.json +5 -3
- package/resource-catalog.v1.json +6 -6
- package/skills/loop-agent/references/command-reference.md +2 -41
- package/skills/loop-agent/references/harness-policy.md +3 -30
- package/skills/loop-agent/references/long-running-loop.md +6 -54
- package/dist/application/loop/run-action.js +0 -19
- package/dist/commands/dag-workflow-compile.js +0 -93
- package/dist/commands/dag-workflow-plan.js +0 -132
- package/dist/commands/dag-workflow-validate.js +0 -68
- package/dist/commands/loop-benchmark.js +0 -74
- package/dist/commands/loop.js +0 -251
- package/dist/commands/workflow.js +0 -259
- package/dist/infrastructure/harness/loop-store.js +0 -41
- package/dist/worker/console/static/assets/abnfDiagram-N423BO3Z-FQePHM07.js +0 -1
- package/dist/worker/console/static/assets/architectureDiagram-T3A2C74G-p_mwm8cd.js +0 -36
- package/dist/worker/console/static/assets/channel-CIBAg8WF.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-B4xQrSmv.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-B4xQrSmv.js +0 -1
- package/dist/worker/console/static/assets/cose-bilkent-JH36ORCC-BPXf8ZYr.js +0 -1
- package/dist/worker/console/static/assets/cynefinDiagram-MW4NZA55-CNsL9N2-.js +0 -62
- package/dist/worker/console/static/assets/diagram-LBJQPF4R-BipWFRgs.js +0 -24
- package/dist/worker/console/static/assets/diagram-Q27KOJAE-T2p4xa38.js +0 -24
- package/dist/worker/console/static/assets/diagram-UB23O5K3-CVwz6LVu.js +0 -41
- package/dist/worker/console/static/assets/ebnfDiagram-BXEA7PRR-CybQrGSA.js +0 -1
- package/dist/worker/console/static/assets/ganttDiagram-PKOTCBZU-D411_55h.js +0 -292
- package/dist/worker/console/static/assets/gitGraphDiagram-DS77QQ5N-DpVtzs9z.js +0 -106
- package/dist/worker/console/static/assets/index-B7cwOTL9.js +0 -649
- package/dist/worker/console/static/assets/index-CATbSkPc.css +0 -1
- package/dist/worker/console/static/assets/infoDiagram-6WML65LV-D74Uvx6K.js +0 -2
- package/dist/worker/console/static/assets/pegDiagram-VL7TDLO6-CSwoBOpM.js +0 -1
- package/dist/worker/console/static/assets/railroadDiagram-AXF67PYL-n0Mt3Yia.js +0 -1
- package/dist/worker/console/static/assets/sizeCapture-X5ZJPWSS-Dmf1pC7B.js +0 -1
- package/dist/worker/console/static/assets/stateDiagram-OKZ733FA-4-jdPUHD.js +0 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-DojWfYnC.js +0 -1
- package/dist/worker/console/static/assets/swimlanes-SLNWSIFB-DNhjjaAU.js +0 -2
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-CJo4AKWH.js +0 -8
- package/dist/worker/console/static/vcp/fonts/Lanxi-/345/217/257/345/256/213.woff2 +0 -0
- package/dist/worker/console/static/vcp/fonts/Lanxi-/346/234/227/345/256/213.woff2 +0 -0
- package/dist/worker/console/static/vcp/fonts/Lanxi-/350/266/205/347/262/227/351/273/221.woff2 +0 -0
- package/dist/workflows/dynamic/compile.js +0 -371
- package/dist/workflows/dynamic/compileTypes.js +0 -1
- package/dist/workflows/dynamic/errors.js +0 -5
- package/dist/workflows/dynamic/profiles.js +0 -156
- package/dist/workflows/dynamic/spec.js +0 -115
- package/dist/workflows/dynamic/validate.js +0 -275
- package/dist/workflows/loop/actions/dag-action.js +0 -129
- package/dist/workflows/loop/actions/pi-review.js +0 -267
- package/dist/workflows/loop/actions/shared.js +0 -157
- package/dist/workflows/loop/actions/shell-verify.js +0 -82
- package/dist/workflows/loop/actions/types.js +0 -1
- package/dist/workflows/loop/actions/workflow-action.js +0 -255
- package/dist/workflows/loop/actions.js +0 -160
- package/dist/workflows/loop/benchmark.js +0 -513
- package/dist/workflows/loop/closeout.js +0 -135
- package/dist/workflows/loop/context.js +0 -47
- package/dist/workflows/loop/events.js +0 -26
- package/dist/workflows/loop/hash.js +0 -32
- package/dist/workflows/loop/index.js +0 -8
- package/dist/workflows/loop/paths.js +0 -17
- package/dist/workflows/loop/policy/auto-policy.js +0 -112
- package/dist/workflows/loop/policy/path-patterns.js +0 -13
- package/dist/workflows/loop/rounds.js +0 -81
- package/dist/workflows/loop/signals.js +0 -52
- package/dist/workflows/loop/state.js +0 -116
- package/dist/workflows/loop/templates.js +0 -54
- package/dist/workflows/loop/types.js +0 -28
- /package/dist/workflows/{dynamic/artifacts.js → dag/dynamic-runtime/reduction-artifacts.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,35 +4,82 @@
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
### 重点更新
|
|
8
|
+
|
|
9
|
+
- 移除了用 JSON 描述工作流并编译运行的旧命令,包括 `dag workflow-plan`、`dag workflow-validate`、`dag workflow-compile` 以及 `workflow save|run|diff|replay`。脚本工作流改用 JavaScript workflow,任务执行仍用 Agent DAG。
|
|
10
|
+
- 移除了任务级 `loop` 与 `loop-benchmark` 命令。持续目标改在对话里用 `/goal` 推进,不再使用单独的 loop 状态。
|
|
11
|
+
|
|
7
12
|
### 改进
|
|
8
13
|
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
14
|
+
- Console 更新为较慢的依赖安装预留更多时间,失败后区分原因并提供明确重试入口;修复进度一直停在 0% 的问题,并按更新阶段显示百分比与用时。有对话、DAG 或 Worker 正在执行时,可确认中断风险后继续更新。
|
|
15
|
+
|
|
16
|
+
- 对话详情在历史无新事件时优先复用投影检查点,长对话二次打开和切换更迅速。
|
|
17
|
+
- 重命名或归档会话立即在列表中生效,不再因后台网络刷新延迟而闪烁旧标题。
|
|
18
|
+
- 工作区切换和首次加载文件目录时复用本地缓存并合并并发请求,浏览和选择项目更快。
|
|
19
|
+
- 新建对话后模型栏和上下文概览立即显示,不再等待插件加载完成,点开后可以直接输入。
|
|
20
|
+
- 右侧栏任务管理可按树状或拓扑图查看子代理,拓扑图的连线从主会话卡片底部成扇形连到各子代理,穿过卡片的部分由卡片遮挡,不再有线条挤在列间缝隙里。
|
|
21
|
+
- 任务管理底部的后台任务列表改为单行显示,每行依次是状态点、终端类型、任务名、状态和耗时;运行中的任务显示数量并用强调色标出。
|
|
22
|
+
- 点击后台任务会打开可拖动、可缩放的输出窗口,按终端配色显示完整输出,可复制、跟随最新输出,运行中的任务还能在窗口内终止;窗口可随时关闭。
|
|
23
|
+
- 子代理详情改为顶部概览、可滚动正文和底部输入三段式,连续调用的同类工具折叠显示,长内容可以上下滚动。
|
|
24
|
+
- 子代理运行中可以停止,第一次点击变为「确认停止」,三秒内再次点击才真正停止,避免误触。
|
|
25
|
+
- 会话中出现子代理时右侧栏自动打开任务管理;已经打开的侧栏不会被接管,窗口宽度小于 768 像素时不会自动打开。设置中新增「侧边栏」分区可以分别关闭这些行为。
|
|
26
|
+
- 对话正文和右侧栏的字号统一为一套层级,正文不再比代码更大;文件路径按等宽字体显示,鼠标移上去才高亮。
|
|
27
|
+
- 右侧栏打开的文件在模型改动后会显示最新内容;预览顶部新增重新读取按钮,用外部工具改完文件也能立刻看到。
|
|
28
|
+
- 会话的调用记录不再固定占用一个标签页,需要时可在洞察页点「查看调用记录」打开。
|
|
29
|
+
- 顶层回复完成后展示已编辑文件汇总卡片,并可直接在右侧栏定位和预览改动。
|
|
30
|
+
- 侧边栏的文件预览现在能直接打开 Word 文档(`.docx`),按页显示正文、标题、表格、图片、页眉页脚和脚注。打开后在预览里划词选中一段文字,就能像引用源码和表格那样把它连同评论一起引用到对话里。旧版 `.doc` 格式仍不在支持范围。
|
|
31
|
+
- 视觉卡片不再使用超粗的展示字体。标题与数据默认改用系统字体,字重限制在常规与半粗之间,之前那种糊成一团的黑字不会再出现。
|
|
32
|
+
- 视觉卡片可以按需选用系统宋体、楷体和等宽字体,macOS 与 Windows 都能直接显示,不必再为不同系统分别指定字体。
|
|
33
|
+
- 视觉卡片的字体文件从 5 个减到 3 个,随包体积减少约 4.5 MB;移除的字体不再随安装包下载。
|
|
18
34
|
|
|
19
35
|
### 修复
|
|
20
36
|
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
37
|
+
- 修复在未安装 Python 的环境下后端测试参数无法自动修正的问题。
|
|
38
|
+
- 修复会话列表因历史遗留的已删除工作区而变慢的问题,打开和刷新列表更快。
|
|
39
|
+
- 修复任务管理把已收起的子代理仍然画在图上,导致聚合卡片和成员卡片同时出现、连线交叉杂乱的问题。
|
|
40
|
+
- 修复点击子代理详情后跳到仓库文件页而不是子代理内容的问题。
|
|
24
41
|
|
|
25
|
-
-
|
|
26
|
-
- 修复浏览器工具在元素引用过期时未提供恢复线索的问题;现在会返回当前可用快照与具体失效原因,避免调用方盲目重试。
|
|
27
|
-
- 修复因上游依赖包导出变更导致后台服务启动时偶发崩溃的问题。
|
|
28
|
-
- 修复前端任务因验证职责误判、并行检查重名、已有测试命令未识别、工具依赖过多或计划文件过大而无法继续的问题。重试会复用已完成步骤并保留完整计划读取材料,无效入口路径可在检查时修正。
|
|
29
|
-
- 初始化更新会保留有效的项目调度配置,不再因此反复要求合并配置文件。
|
|
30
|
-
- 需求检查失败时保留逐条判定和审核理由,并准确区分未解决条款与背景说明,便于定位阻塞原因。
|
|
31
|
-
|
|
32
|
-
## [0.52.0-next.1] - 2026-10-17
|
|
42
|
+
## [0.52.0-next.3] - 2026-10-19
|
|
33
43
|
|
|
34
44
|
本预发布快照记录构建时已整理的待发布变化,不表示相对上一构建全部新增。
|
|
35
45
|
|
|
46
|
+
### 重点更新
|
|
47
|
+
|
|
48
|
+
- 移除了用 JSON 描述工作流并编译运行的旧命令,包括 `dag workflow-plan`、`dag workflow-validate`、`dag workflow-compile` 以及 `workflow save|run|diff|replay`。脚本工作流改用 JavaScript workflow,任务执行仍用 Agent DAG。
|
|
49
|
+
- 移除了任务级 `loop` 与 `loop-benchmark` 命令。持续目标改在对话里用 `/goal` 推进,不再使用单独的 loop 状态。
|
|
50
|
+
|
|
51
|
+
### 改进
|
|
52
|
+
|
|
53
|
+
- Console 更新为较慢的依赖安装预留更多时间,失败后区分原因并提供明确重试入口;修复进度一直停在 0% 的问题,并按更新阶段显示百分比与用时。有对话、DAG 或 Worker 正在执行时,可确认中断风险后继续更新。
|
|
54
|
+
|
|
55
|
+
- 对话详情在历史无新事件时优先复用投影检查点,长对话二次打开和切换更迅速。
|
|
56
|
+
- 重命名或归档会话立即在列表中生效,不再因后台网络刷新延迟而闪烁旧标题。
|
|
57
|
+
- 工作区切换和首次加载文件目录时复用本地缓存并合并并发请求,浏览和选择项目更快。
|
|
58
|
+
- 新建对话后模型栏和上下文概览立即显示,不再等待插件加载完成,点开后可以直接输入。
|
|
59
|
+
- 右侧栏任务管理可按树状或拓扑图查看子代理,拓扑图的连线从主会话卡片底部成扇形连到各子代理,穿过卡片的部分由卡片遮挡,不再有线条挤在列间缝隙里。
|
|
60
|
+
- 任务管理底部的后台任务列表改为单行显示,每行依次是状态点、终端类型、任务名、状态和耗时;运行中的任务显示数量并用强调色标出。
|
|
61
|
+
- 点击后台任务会打开可拖动、可缩放的输出窗口,按终端配色显示完整输出,可复制、跟随最新输出,运行中的任务还能在窗口内终止;窗口可随时关闭。
|
|
62
|
+
- 子代理详情改为顶部概览、可滚动正文和底部输入三段式,连续调用的同类工具折叠显示,长内容可以上下滚动。
|
|
63
|
+
- 子代理运行中可以停止,第一次点击变为「确认停止」,三秒内再次点击才真正停止,避免误触。
|
|
64
|
+
- 会话中出现子代理时右侧栏自动打开任务管理;已经打开的侧栏不会被接管,窗口宽度小于 768 像素时不会自动打开。设置中新增「侧边栏」分区可以分别关闭这些行为。
|
|
65
|
+
- 对话正文和右侧栏的字号统一为一套层级,正文不再比代码更大;文件路径按等宽字体显示,鼠标移上去才高亮。
|
|
66
|
+
- 右侧栏打开的文件在模型改动后会显示最新内容;预览顶部新增重新读取按钮,用外部工具改完文件也能立刻看到。
|
|
67
|
+
- 会话的调用记录不再固定占用一个标签页,需要时可在洞察页点「查看调用记录」打开。
|
|
68
|
+
- 顶层回复完成后展示已编辑文件汇总卡片,并可直接在右侧栏定位和预览改动。
|
|
69
|
+
- 侧边栏的文件预览现在能直接打开 Word 文档(`.docx`),按页显示正文、标题、表格、图片、页眉页脚和脚注。打开后在预览里划词选中一段文字,就能像引用源码和表格那样把它连同评论一起引用到对话里。旧版 `.doc` 格式仍不在支持范围。
|
|
70
|
+
- 视觉卡片不再使用超粗的展示字体。标题与数据默认改用系统字体,字重限制在常规与半粗之间,之前那种糊成一团的黑字不会再出现。
|
|
71
|
+
- 视觉卡片可以按需选用系统宋体、楷体和等宽字体,macOS 与 Windows 都能直接显示,不必再为不同系统分别指定字体。
|
|
72
|
+
- 视觉卡片的字体文件从 5 个减到 3 个,随包体积减少约 4.5 MB;移除的字体不再随安装包下载。
|
|
73
|
+
|
|
74
|
+
### 修复
|
|
75
|
+
|
|
76
|
+
- 修复在未安装 Python 的环境下后端测试参数无法自动修正的问题。
|
|
77
|
+
- 修复会话列表因历史遗留的已删除工作区而变慢的问题,打开和刷新列表更快。
|
|
78
|
+
- 修复任务管理把已收起的子代理仍然画在图上,导致聚合卡片和成员卡片同时出现、连线交叉杂乱的问题。
|
|
79
|
+
- 修复点击子代理详情后跳到仓库文件页而不是子代理内容的问题。
|
|
80
|
+
|
|
81
|
+
## [0.51.0] - 2026-10-17
|
|
82
|
+
|
|
36
83
|
### 改进
|
|
37
84
|
|
|
38
85
|
- 控制台精简内置中文字体包并修复排版引擎的样式覆盖问题,保留常用核心字族,大幅降低安装包体积。
|
|
@@ -50,7 +97,6 @@
|
|
|
50
97
|
- 修复较长文件读取和搜索结果在上下文整理后丢失原文的问题;普通日志仍可压缩,精确文件修改会保留必要源码。
|
|
51
98
|
- 修复 provider 拒绝过大上下文时重复发送完整摘要请求的问题;现在优先使用 provider 摘要,超限时改用本地 checkpoint 继续恢复。
|
|
52
99
|
- 手动压缩不再因为保留窗口过大而拒绝已有少量历史的会话。
|
|
53
|
-
|
|
54
100
|
- 修复切换对话后停在顶部或回复中间的问题,默认显示最新助手回复末尾;主动上翻后,调整窗口宽度仍保留阅读位置。
|
|
55
101
|
- 修复浏览器工具在元素引用过期时未提供恢复线索的问题;现在会返回当前可用快照与具体失效原因,避免调用方盲目重试。
|
|
56
102
|
- 修复因上游依赖包导出变更导致后台服务启动时偶发崩溃的问题。
|
package/dist/build-stamp.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"version": "0.52.0-next.
|
|
4
|
-
"gitSha": "
|
|
5
|
-
"builtAt": "2026-10-
|
|
3
|
+
"version": "0.52.0-next.3",
|
|
4
|
+
"gitSha": "efc6c72c8ea89d7165092ee5b6e4c5e969edaeaa",
|
|
5
|
+
"builtAt": "2026-10-19T16:20:53.523Z"
|
|
6
6
|
}
|
|
@@ -29,9 +29,6 @@ import { readInitRuntimeActivity } from "./update/runtime-activity.js";
|
|
|
29
29
|
import { runRunDag } from "../commands/run-dag.js";
|
|
30
30
|
import { runDagInitHybrid } from "../commands/dag-init-hybrid.js";
|
|
31
31
|
import { runDagValidate } from "../commands/dag-validate.js";
|
|
32
|
-
import { runDagWorkflowValidate } from "../commands/dag-workflow-validate.js";
|
|
33
|
-
import { runDagWorkflowCompile } from "../commands/dag-workflow-compile.js";
|
|
34
|
-
import { runDagWorkflowPlan } from "../commands/dag-workflow-plan.js";
|
|
35
32
|
import { runDagApprove } from "../commands/dag-approve.js";
|
|
36
33
|
import { runDagArtifact } from "../commands/dag-artifact.js";
|
|
37
34
|
import { runDagReject } from "../commands/dag-reject.js";
|
|
@@ -48,11 +45,8 @@ import { runDagCloseoutDraft, runDagReport } from "../commands/dag-report.js";
|
|
|
48
45
|
import { runDagFinalVerification } from "../commands/dag-final-verification.js";
|
|
49
46
|
import { runDagContext } from "../commands/dag-context.js";
|
|
50
47
|
import { runKnowledge } from "../commands/knowledge.js";
|
|
51
|
-
import { runLoopBenchmark } from "../commands/loop-benchmark.js";
|
|
52
48
|
import { runPiReuseBenchmark } from "../commands/pi-reuse-benchmark.js";
|
|
53
49
|
import { runGoal } from "../commands/goal.js";
|
|
54
|
-
import { runLoop } from "../commands/loop.js";
|
|
55
|
-
import { runWorkflowCommand } from "../commands/workflow.js";
|
|
56
50
|
import { runReferenceIndex } from "../commands/reference-index.js";
|
|
57
51
|
import { runStudyInit } from "../commands/study-init.js";
|
|
58
52
|
export function formatSubcommandUsage(name, subcommands) {
|
|
@@ -129,9 +123,6 @@ const DAG_SUBCOMMANDS = [
|
|
|
129
123
|
"init-hybrid",
|
|
130
124
|
"execute",
|
|
131
125
|
"validate",
|
|
132
|
-
"workflow-plan",
|
|
133
|
-
"workflow-validate",
|
|
134
|
-
"workflow-compile",
|
|
135
126
|
"approve",
|
|
136
127
|
"reject",
|
|
137
128
|
"resume",
|
|
@@ -152,23 +143,6 @@ const DAG_SUBCOMMANDS = [
|
|
|
152
143
|
];
|
|
153
144
|
const TASK_SUBCOMMANDS = ["advance", "status", "source"];
|
|
154
145
|
const OPERATOR_SUBCOMMANDS = ["capabilities", "guide"];
|
|
155
|
-
const WORKFLOW_SUBCOMMANDS = [
|
|
156
|
-
"list",
|
|
157
|
-
"inspect",
|
|
158
|
-
"save",
|
|
159
|
-
"run",
|
|
160
|
-
"diff",
|
|
161
|
-
"replay",
|
|
162
|
-
];
|
|
163
|
-
const WORKFLOW_USAGE = "workflow <list|inspect|save|run|diff|replay> [name] [options]";
|
|
164
|
-
const LOOP_SUBCOMMANDS = [
|
|
165
|
-
"init",
|
|
166
|
-
"status",
|
|
167
|
-
"run",
|
|
168
|
-
"record-round",
|
|
169
|
-
"add-signal",
|
|
170
|
-
"closeout",
|
|
171
|
-
];
|
|
172
146
|
/** Order remains stable for compatibility; tiers provide the selection signal. */
|
|
173
147
|
export const COMMAND_DEFINITIONS = [
|
|
174
148
|
{
|
|
@@ -524,7 +498,7 @@ export const COMMAND_DEFINITIONS = [
|
|
|
524
498
|
name: "dag",
|
|
525
499
|
adapter: "required",
|
|
526
500
|
tier: "primary",
|
|
527
|
-
intent: "Generate, validate, inspect, recover, close out Agent DAG runs
|
|
501
|
+
intent: "Generate, validate, inspect, recover, and close out Agent DAG runs.",
|
|
528
502
|
usage: formatSubcommandUsage("dag", DAG_SUBCOMMANDS),
|
|
529
503
|
subcommands: [...DAG_SUBCOMMANDS],
|
|
530
504
|
handler: async ({ repoRoot, subcommand, rest }) => {
|
|
@@ -538,21 +512,6 @@ export const COMMAND_DEFINITIONS = [
|
|
|
538
512
|
await runDagValidate(repoRoot, validateArgs);
|
|
539
513
|
return;
|
|
540
514
|
}
|
|
541
|
-
if (subcommand === "workflow-validate") {
|
|
542
|
-
const validateArgs = rest.filter((arg) => Boolean(arg));
|
|
543
|
-
await runDagWorkflowValidate(repoRoot, validateArgs);
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
if (subcommand === "workflow-plan") {
|
|
547
|
-
const planArgs = rest.filter((arg) => Boolean(arg));
|
|
548
|
-
await runDagWorkflowPlan(repoRoot, planArgs);
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
if (subcommand === "workflow-compile") {
|
|
552
|
-
const compileArgs = rest.filter((arg) => Boolean(arg));
|
|
553
|
-
await runDagWorkflowCompile(repoRoot, compileArgs);
|
|
554
|
-
return;
|
|
555
|
-
}
|
|
556
515
|
if (subcommand === "approve") {
|
|
557
516
|
const approveArgs = rest.filter((arg) => Boolean(arg));
|
|
558
517
|
await runDagApprove(repoRoot, approveArgs);
|
|
@@ -654,28 +613,6 @@ export const COMMAND_DEFINITIONS = [
|
|
|
654
613
|
throw new Error(formatSubcommandUsageError("dag", DAG_SUBCOMMANDS));
|
|
655
614
|
},
|
|
656
615
|
},
|
|
657
|
-
{
|
|
658
|
-
name: "workflow",
|
|
659
|
-
adapter: "required",
|
|
660
|
-
tier: "experimental",
|
|
661
|
-
intent: "List, save, inspect, run, diff, and replay saved dynamic workflows.",
|
|
662
|
-
usage: WORKFLOW_USAGE,
|
|
663
|
-
subcommands: [...WORKFLOW_SUBCOMMANDS],
|
|
664
|
-
handler: async ({ repoRoot, subcommand, rest }) => {
|
|
665
|
-
await runWorkflowCommand(repoRoot, [subcommand, ...rest].filter((arg) => Boolean(arg)));
|
|
666
|
-
},
|
|
667
|
-
},
|
|
668
|
-
{
|
|
669
|
-
name: "loop",
|
|
670
|
-
adapter: "required",
|
|
671
|
-
tier: "experimental",
|
|
672
|
-
intent: "Manage durable long-running task loop state above Agent DAG rounds.",
|
|
673
|
-
usage: "loop <init|status|run|record-round|add-signal|closeout> <task-id> [options]",
|
|
674
|
-
subcommands: [...LOOP_SUBCOMMANDS],
|
|
675
|
-
handler: async ({ repoRoot, subcommand, rest }) => {
|
|
676
|
-
await runLoop(repoRoot, [subcommand, ...rest].filter((arg) => Boolean(arg)));
|
|
677
|
-
},
|
|
678
|
-
},
|
|
679
616
|
{
|
|
680
617
|
name: "cursor-prompt",
|
|
681
618
|
adapter: "none",
|
|
@@ -701,17 +638,6 @@ export const COMMAND_DEFINITIONS = [
|
|
|
701
638
|
await runPiReuseBenchmark(repoRoot, benchmarkArgs);
|
|
702
639
|
},
|
|
703
640
|
},
|
|
704
|
-
{
|
|
705
|
-
name: "loop-benchmark",
|
|
706
|
-
adapter: "required",
|
|
707
|
-
tier: "operator",
|
|
708
|
-
intent: "Generate deterministic loop convergence benchmark baseline evidence.",
|
|
709
|
-
usage: "loop-benchmark [--json|--markdown] [--output <path>]",
|
|
710
|
-
handler: async ({ repoRoot, subcommand, rest }) => {
|
|
711
|
-
const benchmarkArgs = [subcommand, ...rest].filter((arg) => Boolean(arg));
|
|
712
|
-
await runLoopBenchmark(repoRoot, benchmarkArgs);
|
|
713
|
-
},
|
|
714
|
-
},
|
|
715
641
|
];
|
|
716
642
|
export function toCommandManifestEntry(definition) {
|
|
717
643
|
const { handler: _handler, ...manifest } = definition;
|
package/dist/cli/help.js
CHANGED
|
@@ -27,7 +27,7 @@ export function formatCommandTierSummary(manifest = CODE_AGENT_COMMAND_MANIFEST)
|
|
|
27
27
|
" 2. review writeSet gate digest from JSON",
|
|
28
28
|
" 3. task advance <task-id> --approve-gate write-set-review:<digest> --json",
|
|
29
29
|
" 4. task status <task-id> --json # optional read-only",
|
|
30
|
-
"Advanced DAG authoring/forensics: dag validate|execute|report
|
|
30
|
+
"Advanced DAG authoring/forensics: dag validate|execute|report (not the standard happy path)",
|
|
31
31
|
`Primary commands: ${primary}`,
|
|
32
32
|
`Operator commands: ${operator}`,
|
|
33
33
|
compatibility ? `Legacy compatibility commands: ${compatibility}` : "",
|
package/dist/cli/program.js
CHANGED
|
@@ -21,9 +21,6 @@ import { runDagReject } from "../commands/dag-reject.js";
|
|
|
21
21
|
import { runDagCloseoutDraft, runDagReport } from "../commands/dag-report.js";
|
|
22
22
|
import { runDagResume } from "../commands/dag-resume.js";
|
|
23
23
|
import { runDagValidate } from "../commands/dag-validate.js";
|
|
24
|
-
import { runDagWorkflowCompile } from "../commands/dag-workflow-compile.js";
|
|
25
|
-
import { runDagWorkflowPlan } from "../commands/dag-workflow-plan.js";
|
|
26
|
-
import { runDagWorkflowValidate } from "../commands/dag-workflow-validate.js";
|
|
27
24
|
import { runDelegate } from "../commands/delegate.js";
|
|
28
25
|
import { runDocsArchive } from "../commands/docs-archive.js";
|
|
29
26
|
import { runDocsAudit } from "../commands/docs-audit.js";
|
|
@@ -41,8 +38,6 @@ import { runInspect } from "../commands/inspect.js";
|
|
|
41
38
|
import { runInspectNext } from "../commands/inspect-next.js";
|
|
42
39
|
import { runInstructions } from "../commands/instructions.js";
|
|
43
40
|
import { runKnowledge } from "../commands/knowledge.js";
|
|
44
|
-
import { runLoop } from "../commands/loop.js";
|
|
45
|
-
import { runLoopBenchmark } from "../commands/loop-benchmark.js";
|
|
46
41
|
import { runTaskAdvance, TASK_ADVANCE_USAGE } from "../commands/task-advance.js";
|
|
47
42
|
import { runTaskStatus, TASK_STATUS_USAGE } from "../commands/task-status.js";
|
|
48
43
|
import { runTaskSourcePrepare, TASK_SOURCE_PREPARE_USAGE, } from "../commands/task-source-prepare.js";
|
|
@@ -56,7 +51,6 @@ import { runRunDag } from "../commands/run-dag.js";
|
|
|
56
51
|
import { runSpine } from "../commands/spine.js";
|
|
57
52
|
import { runStats } from "../commands/stats.js";
|
|
58
53
|
import { runStudyInit } from "../commands/study-init.js";
|
|
59
|
-
import { runWorkflowCommand } from "../commands/workflow.js";
|
|
60
54
|
import { runWorktreeCreate } from "../commands/worktree-create.js";
|
|
61
55
|
import { runWorktreeList } from "../commands/worktree-list.js";
|
|
62
56
|
import { runWorktreeRemove } from "../commands/worktree-remove.js";
|
|
@@ -227,18 +221,9 @@ async function runCommanderAction(ctx, command, subcommand, rest) {
|
|
|
227
221
|
case "dag":
|
|
228
222
|
await runDagAction(ctx.repoRoot, subcommand, rest);
|
|
229
223
|
return;
|
|
230
|
-
case "workflow":
|
|
231
|
-
await runWorkflowCommand(ctx.repoRoot, compactArgs([subcommand, ...rest]));
|
|
232
|
-
return;
|
|
233
|
-
case "loop":
|
|
234
|
-
await runLoop(ctx.repoRoot, compactArgs([subcommand, ...rest]));
|
|
235
|
-
return;
|
|
236
224
|
case "pi-reuse-benchmark":
|
|
237
225
|
await runPiReuseBenchmark(ctx.repoRoot, compactArgs([subcommand, ...rest]));
|
|
238
226
|
return;
|
|
239
|
-
case "loop-benchmark":
|
|
240
|
-
await runLoopBenchmark(ctx.repoRoot, compactArgs([subcommand, ...rest]));
|
|
241
|
-
return;
|
|
242
227
|
default:
|
|
243
228
|
throw new Error(`commander command is not wired to an action: ${command}`);
|
|
244
229
|
}
|
|
@@ -324,15 +309,6 @@ async function runDagAction(repoRoot, subcommand, rest) {
|
|
|
324
309
|
case "validate":
|
|
325
310
|
await runDagValidate(repoRoot, args);
|
|
326
311
|
return;
|
|
327
|
-
case "workflow-validate":
|
|
328
|
-
await runDagWorkflowValidate(repoRoot, args);
|
|
329
|
-
return;
|
|
330
|
-
case "workflow-plan":
|
|
331
|
-
await runDagWorkflowPlan(repoRoot, args);
|
|
332
|
-
return;
|
|
333
|
-
case "workflow-compile":
|
|
334
|
-
await runDagWorkflowCompile(repoRoot, args);
|
|
335
|
-
return;
|
|
336
312
|
case "approve":
|
|
337
313
|
await runDagApprove(repoRoot, args);
|
|
338
314
|
return;
|
|
@@ -397,7 +373,7 @@ async function runDagAction(repoRoot, subcommand, rest) {
|
|
|
397
373
|
throw new Error("usage: dag decision <inspect|validate> --run-id <id> [--node-id <node-id>]");
|
|
398
374
|
}
|
|
399
375
|
default:
|
|
400
|
-
throw new Error("usage: dag <init-hybrid|execute|validate|
|
|
376
|
+
throw new Error("usage: dag <init-hybrid|execute|validate|approve|reject|resume|status|doctor|report|closeout-draft|reconcile-run|request-interrupt|rerun|rerun-task|reconcile-tasks|final-verification|context|artifact|decision> ...");
|
|
401
377
|
}
|
|
402
378
|
}
|
|
403
379
|
function compactArgs(args) {
|
|
@@ -554,9 +530,6 @@ function addDagCommand(program, defaultRepoRoot) {
|
|
|
554
530
|
const dag = new Command("dag").description("Agent DAG commands");
|
|
555
531
|
addRawSubcommands(dag, [
|
|
556
532
|
"init-hybrid",
|
|
557
|
-
"workflow-plan",
|
|
558
|
-
"workflow-validate",
|
|
559
|
-
"workflow-compile",
|
|
560
533
|
"approve",
|
|
561
534
|
"reject",
|
|
562
535
|
"resume",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accepted-merge normalization for `harness.json`.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from `init.ts` so the edge-following rule can be tested directly:
|
|
5
|
+
* a wrong rule here does not fail loudly, it silently forces every
|
|
6
|
+
* `init upgrade` run back into the same merge task forever.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Actions that rewrite `harness.json` in place.
|
|
10
|
+
*
|
|
11
|
+
* `migrate-harness-governance-root` and `migrate-harness-model-fields` were
|
|
12
|
+
* missing here. A legacy project receives the governance-root migration and
|
|
13
|
+
* the structural reconciliation in the same apply-safe batch, so the first
|
|
14
|
+
* action moves the file off the accepted hash and the second no longer
|
|
15
|
+
* matches it. The chain then stopped at the original hash, the recorded
|
|
16
|
+
* acceptance never matched the on-disk file, and every run regenerated the
|
|
17
|
+
* same merge task.
|
|
18
|
+
*
|
|
19
|
+
* Any future action that rewrites `harness.json` must be registered here.
|
|
20
|
+
*/
|
|
21
|
+
export const HARNESS_REWRITE_ACTIONS = new Set([
|
|
22
|
+
"migrate-harness-governance-root",
|
|
23
|
+
"migrate-harness-model-fields",
|
|
24
|
+
"reconcile-harness-structure",
|
|
25
|
+
]);
|
|
26
|
+
/**
|
|
27
|
+
* Follow exact controller normalization edges, never infer acceptance from
|
|
28
|
+
* shape equality.
|
|
29
|
+
*
|
|
30
|
+
* A receipt advances the chain only when it targets `harness.json`, is a
|
|
31
|
+
* registered rewrite action, and its `beforeSha256` equals the hash reached
|
|
32
|
+
* so far. Receipts without a `beforeSha256` cannot be proven consecutive and
|
|
33
|
+
* are ignored rather than trusted.
|
|
34
|
+
*/
|
|
35
|
+
export function normalizedAcceptedHarnessHash(acceptedHash, actions) {
|
|
36
|
+
let current = acceptedHash;
|
|
37
|
+
for (const action of actions) {
|
|
38
|
+
if (action.path === "harness.json" &&
|
|
39
|
+
HARNESS_REWRITE_ACTIONS.has(action.type) &&
|
|
40
|
+
action.beforeSha256 === current &&
|
|
41
|
+
action.afterSha256) {
|
|
42
|
+
current = action.afterSha256;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return current;
|
|
46
|
+
}
|
|
@@ -545,6 +545,62 @@ function runDirectory(repoRoot, runId) {
|
|
|
545
545
|
throw new Error("invalid init upgrade run id");
|
|
546
546
|
return path.join(runRoot(repoRoot), runId);
|
|
547
547
|
}
|
|
548
|
+
/**
|
|
549
|
+
* Pick the single interrupted run for `--continue` when `--run-id` is absent.
|
|
550
|
+
*
|
|
551
|
+
* Repeated interrupted attempts leave several directories under
|
|
552
|
+
* `.harness/init-upgrades`, and asking the user to copy a run id out of a
|
|
553
|
+
* state file is both error-prone and pointless when only one run can be
|
|
554
|
+
* resumed. This never guesses among candidates: two live runs mean the caller
|
|
555
|
+
* must decide, so the error lists them instead of picking the newest.
|
|
556
|
+
*
|
|
557
|
+
* Only `in-progress` runs qualify; a `failed` run stays opt-in so a broken
|
|
558
|
+
* run cannot be resumed by accident.
|
|
559
|
+
*/
|
|
560
|
+
/**
|
|
561
|
+
* Decide which interrupted run `--continue` should resume.
|
|
562
|
+
*
|
|
563
|
+
* Exported as a pure decision so the 0/1/many cases are testable without
|
|
564
|
+
* building a fixture repository. Never guesses: two live runs mean the caller
|
|
565
|
+
* must choose, and a `failed` run stays opt-in.
|
|
566
|
+
*/
|
|
567
|
+
export function selectInterruptedRun(candidates) {
|
|
568
|
+
if (candidates.length === 0) {
|
|
569
|
+
return {
|
|
570
|
+
error: "init upgrade --continue found no interrupted run; run `loop-agent init upgrade` to start one, or pass --run-id",
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
if (candidates.length === 1)
|
|
574
|
+
return { runId: candidates[0].runId };
|
|
575
|
+
const sorted = [...candidates].sort((left, right) => String(right.updatedAt ?? "").localeCompare(String(left.updatedAt ?? "")));
|
|
576
|
+
const listed = sorted
|
|
577
|
+
.map((candidate) => ` ${candidate.runId}${candidate.phase ? ` (${candidate.phase})` : ""}${candidate.updatedAt ? ` updated ${candidate.updatedAt}` : ""}`)
|
|
578
|
+
.join("\n");
|
|
579
|
+
return {
|
|
580
|
+
error: `init upgrade --continue found ${candidates.length} interrupted runs; pass --run-id with one of:\n${listed}`,
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
async function resolveInterruptedRunId(repoRoot) {
|
|
584
|
+
const root = runRoot(repoRoot);
|
|
585
|
+
const entries = await readdir(root, { withFileTypes: true }).catch(() => []);
|
|
586
|
+
const candidates = [];
|
|
587
|
+
for (const entry of entries) {
|
|
588
|
+
if (!entry.isDirectory() || !validRunId(entry.name))
|
|
589
|
+
continue;
|
|
590
|
+
const state = await readState(repoRoot, entry.name).catch(() => undefined);
|
|
591
|
+
if (!state || state.status !== "in-progress")
|
|
592
|
+
continue;
|
|
593
|
+
candidates.push({
|
|
594
|
+
runId: entry.name,
|
|
595
|
+
...(typeof state.phase === "string" ? { phase: state.phase } : {}),
|
|
596
|
+
...(typeof state.updatedAt === "string" ? { updatedAt: state.updatedAt } : {}),
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
const selection = selectInterruptedRun(candidates);
|
|
600
|
+
if ("error" in selection)
|
|
601
|
+
throw new Error(selection.error);
|
|
602
|
+
return selection.runId;
|
|
603
|
+
}
|
|
548
604
|
async function exists(filePath) {
|
|
549
605
|
return Boolean(await stat(filePath).catch(() => undefined));
|
|
550
606
|
}
|
|
@@ -1182,6 +1238,46 @@ async function assertSafeMergePath(repoRoot, relativePath) {
|
|
|
1182
1238
|
throw new Error(`init upgrade merge realpath escapes repo: ${normalized}`);
|
|
1183
1239
|
}
|
|
1184
1240
|
}
|
|
1241
|
+
/**
|
|
1242
|
+
* Directories whose contents never participate in the merge guard.
|
|
1243
|
+
*
|
|
1244
|
+
* The guard exists to prove that a merge touched only its declared paths, so
|
|
1245
|
+
* it only needs the governance surface. Walking dependency trees and build
|
|
1246
|
+
* output turned `DISCOVER` into a multi-minute scan on real projects (a
|
|
1247
|
+
* `node_modules` alone is tens of thousands of entries), which surfaced as an
|
|
1248
|
+
* external timeout with the run stuck in `DISCOVER`.
|
|
1249
|
+
*
|
|
1250
|
+
* Matching is by directory *name* only, so a file such as `src/dist.ts` or
|
|
1251
|
+
* `src/node_modules.ts` is still hashed normally. Skipping a directory also
|
|
1252
|
+
* excludes the directory entry itself from the snapshot, so no baseline bloat.
|
|
1253
|
+
*/
|
|
1254
|
+
const SNAPSHOT_SKIP_DIRECTORY_NAMES = new Set(["node_modules",
|
|
1255
|
+
"dist",
|
|
1256
|
+
"build",
|
|
1257
|
+
"coverage",
|
|
1258
|
+
".next",
|
|
1259
|
+
".nuxt",
|
|
1260
|
+
".turbo",
|
|
1261
|
+
".cache",
|
|
1262
|
+
".venv",
|
|
1263
|
+
"venv",
|
|
1264
|
+
"__pycache__",
|
|
1265
|
+
".pytest_cache",
|
|
1266
|
+
".mypy_cache",
|
|
1267
|
+
"target",
|
|
1268
|
+
".gradle",
|
|
1269
|
+
"vendor",
|
|
1270
|
+
]);
|
|
1271
|
+
/**
|
|
1272
|
+
* Whether a directory entry should be pruned from the workspace snapshot.
|
|
1273
|
+
*
|
|
1274
|
+
* Matches by directory name so `src/node_modules.ts` is still hashed. Exported
|
|
1275
|
+
* for direct testing: the guard's correctness depends on this staying narrow,
|
|
1276
|
+
* and an over-broad rule would silently stop protecting real files.
|
|
1277
|
+
*/
|
|
1278
|
+
export function shouldSkipSnapshotDirectory(entry) {
|
|
1279
|
+
return entry.isDirectory() && SNAPSHOT_SKIP_DIRECTORY_NAMES.has(entry.name);
|
|
1280
|
+
}
|
|
1185
1281
|
async function snapshotWorkspace(repoRoot) {
|
|
1186
1282
|
const snapshot = {};
|
|
1187
1283
|
async function visit(directory) {
|
|
@@ -1200,6 +1296,10 @@ async function snapshotWorkspace(repoRoot) {
|
|
|
1200
1296
|
continue;
|
|
1201
1297
|
if (relative === RUN_ROOT || relative.startsWith(`${RUN_ROOT}/`))
|
|
1202
1298
|
continue;
|
|
1299
|
+
// Prune dependency/build directories before recording or descending,
|
|
1300
|
+
// so neither their entry nor their contents enter the baseline.
|
|
1301
|
+
if (shouldSkipSnapshotDirectory(entry))
|
|
1302
|
+
continue;
|
|
1203
1303
|
if (entry.isSymbolicLink()) {
|
|
1204
1304
|
snapshot[relative] = `symlink:${await readlink(absolute)}`;
|
|
1205
1305
|
continue;
|
|
@@ -3594,7 +3694,19 @@ async function executeUpgrade(directory, state, input) {
|
|
|
3594
3694
|
});
|
|
3595
3695
|
}
|
|
3596
3696
|
export async function runInitUpgrade(input) {
|
|
3597
|
-
|
|
3697
|
+
// Canonicalize exactly once, the same way the decision-resume authority and
|
|
3698
|
+
// the controller anchor do. `path.resolve` alone keeps the Windows 8.3
|
|
3699
|
+
// short form (`MICROS~1`) that `realpath` expands, so the repo root
|
|
3700
|
+
// recorded into a pending decision never matched the one checked on
|
|
3701
|
+
// resume — the run then failed as "resume authority does not match
|
|
3702
|
+
// pending actions" even though every other field agreed.
|
|
3703
|
+
// Canonicalize exactly once, the same way the decision-resume authority and
|
|
3704
|
+
// the controller anchor do. `path.resolve` alone keeps the Windows 8.3
|
|
3705
|
+
// short form (`MICROS~1`) that `fs.promises.realpath` expands, so the repo
|
|
3706
|
+
// root recorded into a pending decision never matched the one checked on
|
|
3707
|
+
// resume — the run then failed as "resume authority does not match pending
|
|
3708
|
+
// actions" even though every other field agreed.
|
|
3709
|
+
const repoRoot = await realpath(path.resolve(input.repoRoot)).catch(() => path.resolve(input.repoRoot));
|
|
3598
3710
|
const mode = input.mode ?? "start";
|
|
3599
3711
|
if (input.decisionFile && mode !== "continue") {
|
|
3600
3712
|
throw new Error("init upgrade --decision-file requires --continue and --run-id");
|
|
@@ -3621,7 +3733,7 @@ export async function runInitUpgrade(input) {
|
|
|
3621
3733
|
};
|
|
3622
3734
|
}
|
|
3623
3735
|
const runId = mode === "continue"
|
|
3624
|
-
? input.runId
|
|
3736
|
+
? input.runId ?? (await resolveInterruptedRunId(repoRoot))
|
|
3625
3737
|
: input.runId ??
|
|
3626
3738
|
`init-upgrade-${new Date().toISOString().replace(/[-:.TZ]/g, "").slice(0, 14)}-${randomUUID().slice(0, 8)}`;
|
|
3627
3739
|
if (!runId)
|