@tea-agent/loop-agent 0.51.0-next.1 → 0.51.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 +33 -1
- package/dist/application/task-lifecycle/advance.js +6 -0
- package/dist/build-stamp.json +3 -3
- package/dist/commands/init.js +12 -3
- package/dist/executors/dag-pi/plan/facts.js +18 -4
- package/dist/executors/dag-pi/plan/record-tools.js +34 -3
- package/dist/executors/dag-pi/sessions/scout-parallel.js +11 -2
- package/dist/executors/dag-pi/sessions/segmented-plan.js +170 -16
- package/dist/executors/dag-pi/tools/contract-read-tool.js +34 -0
- package/dist/executors/dag-pi/tools/scout-evidence-tools.js +9 -7
- package/dist/executors/dag-pi-executor.js +82 -82
- package/dist/shared/pi-context-pressure/checkpoint.js +22 -4
- package/dist/shared/pi-context-pressure/compaction-policy.js +5 -1
- package/dist/shared/pi-context-pressure/extension.js +64 -5
- package/dist/shared/pi-context-pressure/sift-bridge.js +2 -1
- package/dist/shared/pi-context-pressure/telemetry.js +4 -0
- package/dist/shared/pi-context-pressure/tool-result-pruner.js +8 -3
- package/dist/task/source-prepare/completeness.js +2 -2
- package/dist/task/source-prepare/diagnostic.js +76 -0
- package/dist/task/source-prepare/ledger-reconciliation.js +65 -9
- package/dist/task/source-prepare/ledger-review.js +18 -2
- package/dist/task/source-prepare/ledger.js +3 -1
- package/dist/task/source-prepare/prepare.js +23 -3
- package/dist/task/source-prepare/source-fidelity-pi.js +12 -1
- package/dist/task/source-prepare/types.js +1 -1
- package/dist/worker/console/chat/chat-event-projection.js +13 -0
- package/dist/worker/console/chat/chat-event-store.js +1 -0
- package/dist/worker/console/chat/compaction-errors.js +1 -1
- package/dist/worker/console/chat/context-accounting.js +58 -0
- package/dist/worker/console/chat/context-insights.js +131 -22
- package/dist/worker/console/chat/context-usage.js +57 -1
- package/dist/worker/console/chat/pi-runtime/context-edit.js +91 -0
- package/dist/worker/console/chat/pi-runtime.js +36 -3
- package/dist/worker/console/chat/routes.js +3 -0
- package/dist/worker/console/chat/terminal-routes.js +12 -0
- package/dist/worker/console/chat/terminal-sessions.js +6 -0
- package/dist/worker/console/chat/vcp-prompt.js +28 -15
- package/dist/worker/console/recovery-error-copy.js +4 -1
- package/dist/worker/console/static/assets/{abnfDiagram-N423BO3Z-DUtUeeEa.js → abnfDiagram-N423BO3Z-GerMJfMU.js} +1 -1
- package/dist/worker/console/static/assets/{arc-Cs0DSwTY.js → arc-DHRoAcBA.js} +1 -1
- package/dist/worker/console/static/assets/{architectureDiagram-T3A2C74G-C80FSNgl.js → architectureDiagram-T3A2C74G-Bna7kqEi.js} +1 -1
- package/dist/worker/console/static/assets/{blockDiagram-VBNYF7ZC-DFgOZUzn.js → blockDiagram-VBNYF7ZC-B8yw7WTX.js} +1 -1
- package/dist/worker/console/static/assets/{c4Diagram-5PPSVZJV-CB9nkTjT.js → c4Diagram-5PPSVZJV-BaUWiyqi.js} +1 -1
- package/dist/worker/console/static/assets/channel-CLhtAowh.js +1 -0
- package/dist/worker/console/static/assets/{chunk-2GRJ4B5K-DbjpoOrh.js → chunk-2GRJ4B5K-D4iZ2ZNv.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-2Q5K7J3B-BsWVWnWY.js → chunk-2Q5K7J3B-BtQpibwB.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5RXB4S5H-BwwP_1AG.js → chunk-5RXB4S5H-ez-kfSyS.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-5VM5RSS4-DDEzW9MV.js → chunk-5VM5RSS4-6L4-OV-3.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-6Q2QTUOP-D-fLZDni.js → chunk-6Q2QTUOP-CPUweABC.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-GF5L2VYU-DY9q3jMo.js → chunk-GF5L2VYU-6DTw-5Ov.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-JWPE2WC7-rkUPkzPh.js → chunk-JWPE2WC7-DFAS-DH8.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-KBJHAD2P-Ci9ZksX4.js → chunk-KBJHAD2P-Du7LoER5.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-RYQCIY6F-DKU-3Ef6.js → chunk-RYQCIY6F-D9UugPlg.js} +1 -1
- package/dist/worker/console/static/assets/{chunk-XXDRQBXY-A-xOwXvl.js → chunk-XXDRQBXY-BLh5yptc.js} +1 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-DB7nfjpK.js +1 -0
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-DB7nfjpK.js +1 -0
- package/dist/worker/console/static/assets/{cose-bilkent-JH36ORCC-Bfs1rphL.js → cose-bilkent-JH36ORCC-DjmHXa8h.js} +1 -1
- package/dist/worker/console/static/assets/{cynefin-VYW2F7L2-BTlXtGR2.js → cynefin-VYW2F7L2-D5jbf1gi.js} +1 -1
- package/dist/worker/console/static/assets/{cynefinDiagram-MW4NZA55-D8c9vCCr.js → cynefinDiagram-MW4NZA55-BudjeLTi.js} +1 -1
- package/dist/worker/console/static/assets/{dagre-VZM6K2ZE-B-e-tfgY.js → dagre-VZM6K2ZE-6YP-wMO0.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-7IWD3JNH-CG_5dIVJ.js → diagram-7IWD3JNH-CA3LtUAB.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-B4RE2ZJO-CmP40HmK.js → diagram-B4RE2ZJO-BAjJeYaD.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-LBJQPF4R-RFt8vi9Y.js → diagram-LBJQPF4R-Dh4zb-ds.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-Q27KOJAE-CM5Sb2jB.js → diagram-Q27KOJAE-aMKj_Gkp.js} +1 -1
- package/dist/worker/console/static/assets/{diagram-UB23O5K3-Bm4zh0WJ.js → diagram-UB23O5K3-D_0_rqQ6.js} +1 -1
- package/dist/worker/console/static/assets/{ebnfDiagram-BXEA7PRR-b3GekSN4.js → ebnfDiagram-BXEA7PRR--C9HfGgB.js} +1 -1
- package/dist/worker/console/static/assets/{erDiagram-JOGREHBK-CFZh4C_o.js → erDiagram-JOGREHBK-BuqX0vmt.js} +1 -1
- package/dist/worker/console/static/assets/{flowDiagram-UKHOOZJN-CzxniD3z.js → flowDiagram-UKHOOZJN-IneEK8zO.js} +1 -1
- package/dist/worker/console/static/assets/{ganttDiagram-PKOTCBZU-Czp6xUXj.js → ganttDiagram-PKOTCBZU-DK2RiNlb.js} +1 -1
- package/dist/worker/console/static/assets/{gitGraphDiagram-DS77QQ5N-B66oX4sn.js → gitGraphDiagram-DS77QQ5N-CuN5z0rP.js} +1 -1
- package/dist/worker/console/static/assets/{index-BVMJjujb.css → index-CzfumEW1.css} +1 -1
- package/dist/worker/console/static/assets/{index-Bq_vMDO3.js → index-DS6dteCl.js} +159 -147
- package/dist/worker/console/static/assets/{infoDiagram-6WML65LV-rTveEtft.js → infoDiagram-6WML65LV-B6enpqSl.js} +1 -1
- package/dist/worker/console/static/assets/{ishikawaDiagram-WSZJBQD7-N2jiPnrD.js → ishikawaDiagram-WSZJBQD7-DepH_7eq.js} +1 -1
- package/dist/worker/console/static/assets/{journeyDiagram-NVQOT4AX-DtnLwtAE.js → journeyDiagram-NVQOT4AX-BftlRwcR.js} +1 -1
- package/dist/worker/console/static/assets/{kanban-definition-27J2QSJJ-t9D_2QMN.js → kanban-definition-27J2QSJJ-CEIZMo9g.js} +1 -1
- package/dist/worker/console/static/assets/{linear-BP6ZG0tB.js → linear-DkgtGbsw.js} +1 -1
- package/dist/worker/console/static/assets/{mermaid.core-Cc5_ZtUy.js → mermaid.core-CIMKKPgL.js} +5 -5
- package/dist/worker/console/static/assets/{mindmap-definition-FAOFIHXS-zztwmHj8.js → mindmap-definition-FAOFIHXS-dzbp1VuW.js} +1 -1
- package/dist/worker/console/static/assets/{pegDiagram-VL7TDLO6-CmXQOyPH.js → pegDiagram-VL7TDLO6-C5b5i7KO.js} +1 -1
- package/dist/worker/console/static/assets/{pieDiagram-7S7Q4E2Y-BodwfpEp.js → pieDiagram-7S7Q4E2Y-Ugdko1lm.js} +1 -1
- package/dist/worker/console/static/assets/{quadrantDiagram-CIZ2JOQS-DIgybsTM.js → quadrantDiagram-CIZ2JOQS-B2s1OZu8.js} +1 -1
- package/dist/worker/console/static/assets/{railroadDiagram-AXF67PYL-CZb_4Cv2.js → railroadDiagram-AXF67PYL-BVafp-Z6.js} +1 -1
- package/dist/worker/console/static/assets/{requirementDiagram-LRYGKXZP-BvRNauBA.js → requirementDiagram-LRYGKXZP-BVxBjdbs.js} +1 -1
- package/dist/worker/console/static/assets/{sankeyDiagram-W5VNT64P-BQ30kRWi.js → sankeyDiagram-W5VNT64P-CorSImxl.js} +1 -1
- package/dist/worker/console/static/assets/{sequenceDiagram-SI44F4Z6-B7sGR3r3.js → sequenceDiagram-SI44F4Z6-eVj3geQV.js} +1 -1
- package/dist/worker/console/static/assets/{sheet-workbook-CK8pzw-q.js → sheet-workbook-DNnJDCal.js} +1 -1
- package/dist/worker/console/static/assets/{sizeCapture-X5ZJPWSS-1HZrTeyl.js → sizeCapture-X5ZJPWSS-OQWfzgrL.js} +1 -1
- package/dist/worker/console/static/assets/{stateDiagram-OKZ733FA-BKCXlJRS.js → stateDiagram-OKZ733FA-DJr_pPmG.js} +1 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-Cr-50jJB.js +1 -0
- package/dist/worker/console/static/assets/{swimlanes-SLNWSIFB-BhT8u6Vm.js → swimlanes-SLNWSIFB-CQG0Q9vK.js} +2 -2
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-kZpEmem6.js +8 -0
- package/dist/worker/console/static/assets/{timeline-definition-Z64GVDOM-Dnczuw3j.js → timeline-definition-Z64GVDOM-DxWuWIZ5.js} +1 -1
- package/dist/worker/console/static/assets/{vennDiagram-T6HMQDX7-PgJCj-16.js → vennDiagram-T6HMQDX7-BJt03ecs.js} +1 -1
- package/dist/worker/console/static/assets/{wardleyDiagram-T6FBY63Y-BjuszbFn.js → wardleyDiagram-T6FBY63Y-BB3rPfNJ.js} +1 -1
- package/dist/worker/console/static/assets/{xychartDiagram-ELKLHX3M-Dhtjuxrn.js → xychartDiagram-ELKLHX3M-aVR9TCu0.js} +1 -1
- package/dist/worker/console/static/index.html +2 -2
- package/dist/worker/console/static-src/operator-chat/useChatSessions.js +99 -16
- package/dist/worker/console/static-src/operator-chat/useChatThread.js +27 -5
- package/dist/worker/console/static-src/operator-chat/vcp-fonts.js +1 -6
- package/dist/worker/console/workspace-context.js +56 -1
- package/dist/worker/observe/static/dag-history-labels.js +2 -0
- package/dist/worker/observe/static/views/dag.js +28 -0
- package/dist/workflows/dag/frontend-durable-tools.js +5 -2
- package/dist/workflows/dag/frontend-implementation-contract.js +19 -6
- package/dist/workflows/dag/frontend-recovery-run.js +20 -1
- package/dist/workflows/dag/frontend-review-scopes.js +2 -2
- package/dist/workflows/dag/frontend-session-budget.js +1 -1
- package/dist/workflows/dag/frontend-writer-baseline-guard.js +11 -5
- package/dist/workflows/dag/hybrid/templates/frontend.js +35 -5
- package/dist/workflows/dag/prompt.js +8 -2
- package/dist/workflows/dag/rerun-plan.js +50 -3
- package/dist/workflows/dag/rerun-run.js +4 -0
- package/dist/workflows/dag/runner.js +11 -0
- package/package.json +6 -3
- package/dist/worker/console/static/assets/channel-BddnaJc4.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-JCYQIIEL-CqfGeesl.js +0 -1
- package/dist/worker/console/static/assets/classDiagram-v2-OCEON4UE-CqfGeesl.js +0 -1
- package/dist/worker/console/static/assets/stateDiagram-v2-UEYNNEHI-DzDcqZJM.js +0 -1
- package/dist/worker/console/static/assets/swimlanesDiagram-ULZ7WXOC-DgnnY3K8.js +0 -8
- package/dist/worker/console/static/vcp/fonts/Lanxi-GreatVibes.woff2 +0 -0
- package/dist/worker/console/static/vcp/fonts/Lanxi-MaShanZheng.woff2 +0 -0
- package/dist/worker/console/static/vcp/fonts/Lanxi-/347/202/271/351/273/221.woff2 +0 -0
- package/dist/worker/console/static/vcp/fonts/Lanxi-/351/235/231/351/273/221/350/266/205/347/273/206.woff2 +0 -0
- package/dist/worker/console/static/vcp/fonts/Lanxi-/351/261/274/345/260/276/350/241/214/344/271/246.woff2 +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -8,16 +8,23 @@
|
|
|
8
8
|
|
|
9
9
|
- 控制台精简内置中文字体包并修复排版引擎的样式覆盖问题,保留常用核心字族,大幅降低安装包体积。
|
|
10
10
|
- Console 默认采用启动环境中的代理,也可在设置中切换直连或手动代理;保存后新请求立即生效,无需重启,正在输出的回复可继续完成。
|
|
11
|
+
- 前端任务提前检查工作区规模和计划可读性,提交错误可当场修正;运行详情显示重试次数,并可跳转查看自动恢复的前后运行。
|
|
12
|
+
- 普通安全节点续跑可继承剩余硬预算;预算缺失、超限或不一致时会说明原因并停止。前端专用恢复仍使用原恢复入口。
|
|
11
13
|
- 正式版本的更新说明以「上一正式版本」为对比起点,说明这次升级带来的变化。
|
|
12
14
|
- 版本页缺少本版本说明时仍可查看历史;新发布版本可直接读取说明,较大的已发布包有更充足的查询时间,失败时会区分超时和内容缺失。预发布版本会保留该构建的待发布变化快照。
|
|
13
15
|
|
|
14
16
|
### 修复
|
|
15
17
|
|
|
18
|
+
- 修复读取较长工具结果时内容反复被压缩、导致任务耗尽请求额度的问题。
|
|
19
|
+
|
|
16
20
|
- 修复切换对话后停在顶部或回复中间的问题,默认显示最新助手回复末尾;主动上翻后,调整窗口宽度仍保留阅读位置。
|
|
17
21
|
- 修复浏览器工具在元素引用过期时未提供恢复线索的问题;现在会返回当前可用快照与具体失效原因,避免调用方盲目重试。
|
|
18
22
|
- 修复因上游依赖包导出变更导致后台服务启动时偶发崩溃的问题。
|
|
23
|
+
- 修复前端任务因验证职责误判、并行检查重名、已有测试命令未识别、工具依赖过多或计划文件过大而无法继续的问题。重试会复用已完成步骤并保留完整计划读取材料,无效入口路径可在检查时修正。
|
|
24
|
+
- 初始化更新会保留有效的项目调度配置,不再因此反复要求合并配置文件。
|
|
25
|
+
- 需求检查失败时保留逐条判定和审核理由,并准确区分未解决条款与背景说明,便于定位阻塞原因。
|
|
19
26
|
|
|
20
|
-
## [0.51.0-next.
|
|
27
|
+
## [0.51.0-next.3] - 2026-10-15
|
|
21
28
|
|
|
22
29
|
本预发布快照记录构建时已整理的待发布变化,不表示相对上一构建全部新增。
|
|
23
30
|
|
|
@@ -25,14 +32,39 @@
|
|
|
25
32
|
|
|
26
33
|
- 控制台精简内置中文字体包并修复排版引擎的样式覆盖问题,保留常用核心字族,大幅降低安装包体积。
|
|
27
34
|
- Console 默认采用启动环境中的代理,也可在设置中切换直连或手动代理;保存后新请求立即生效,无需重启,正在输出的回复可继续完成。
|
|
35
|
+
- 前端任务提前检查工作区规模和计划可读性,提交错误可当场修正;运行详情显示重试次数,并可跳转查看自动恢复的前后运行。
|
|
36
|
+
- 普通安全节点续跑可继承剩余硬预算;预算缺失、超限或不一致时会说明原因并停止。前端专用恢复仍使用原恢复入口。
|
|
28
37
|
- 正式版本的更新说明以「上一正式版本」为对比起点,说明这次升级带来的变化。
|
|
29
38
|
- 版本页缺少本版本说明时仍可查看历史;新发布版本可直接读取说明,较大的已发布包有更充足的查询时间,失败时会区分超时和内容缺失。预发布版本会保留该构建的待发布变化快照。
|
|
30
39
|
|
|
31
40
|
### 修复
|
|
32
41
|
|
|
42
|
+
- 修复读取较长工具结果时内容反复被压缩、导致任务耗尽请求额度的问题。
|
|
43
|
+
|
|
33
44
|
- 修复切换对话后停在顶部或回复中间的问题,默认显示最新助手回复末尾;主动上翻后,调整窗口宽度仍保留阅读位置。
|
|
34
45
|
- 修复浏览器工具在元素引用过期时未提供恢复线索的问题;现在会返回当前可用快照与具体失效原因,避免调用方盲目重试。
|
|
35
46
|
- 修复因上游依赖包导出变更导致后台服务启动时偶发崩溃的问题。
|
|
47
|
+
- 修复前端任务因验证职责误判、并行检查重名、已有测试命令未识别、工具依赖过多或计划文件过大而无法继续的问题。重试会复用已完成步骤并保留完整计划读取材料,无效入口路径可在检查时修正。
|
|
48
|
+
- 初始化更新会保留有效的项目调度配置,不再因此反复要求合并配置文件。
|
|
49
|
+
- 需求检查失败时保留逐条判定和审核理由,并准确区分未解决条款与背景说明,便于定位阻塞原因。
|
|
50
|
+
|
|
51
|
+
## [0.50.0] - 2026-10-13
|
|
52
|
+
|
|
53
|
+
### 重点更新
|
|
54
|
+
|
|
55
|
+
- 对话支持按上下文压力整理较长工具结果,压缩后仍保留可追溯的摘要和恢复信息。
|
|
56
|
+
- VCP 视觉卡片减少内置字体资源并修正样式覆盖,加载更轻,卡片排版更稳定。
|
|
57
|
+
|
|
58
|
+
### 改进
|
|
59
|
+
|
|
60
|
+
- Console 支持在设置中切换代理或直连,新请求立即使用最新选择。
|
|
61
|
+
- 切换对话后会恢复到最近阅读位置,继续查看最新回复更顺畅。
|
|
62
|
+
- 浏览器自动化默认关闭,需要时可通过明确配置启用。
|
|
63
|
+
|
|
64
|
+
### 修复
|
|
65
|
+
|
|
66
|
+
- 修复浏览器元素引用过期时缺少当前页面快照和恢复线索的问题。
|
|
67
|
+
- 修复切换会话后版本说明、工作区状态和对话滚动位置偶发丢失的问题。
|
|
36
68
|
|
|
37
69
|
## [0.49.0] - 2026-10-11
|
|
38
70
|
|
|
@@ -693,6 +693,7 @@ export async function advanceTaskLifecycle(input) {
|
|
|
693
693
|
...(sourceFidelity ? { sourceFidelity } : {}),
|
|
694
694
|
});
|
|
695
695
|
if (!prepareResult.ok) {
|
|
696
|
+
warnings.push(...(prepareResult.warnings ?? []).filter((warning) => warning.code === "SOURCE_PREPARE_DIAGNOSTIC_WRITE_FAILED"));
|
|
696
697
|
const gapCodes = (prepareResult.gaps ?? [])
|
|
697
698
|
.filter((gap) => gap.level === "blocking")
|
|
698
699
|
.map((gap) => gap.code);
|
|
@@ -799,6 +800,7 @@ export async function advanceTaskLifecycle(input) {
|
|
|
799
800
|
continue;
|
|
800
801
|
}
|
|
801
802
|
prepareResult = retry;
|
|
803
|
+
warnings.push(...(retry.warnings ?? []).filter((warning) => warning.code === "SOURCE_PREPARE_DIAGNOSTIC_WRITE_FAILED"));
|
|
802
804
|
// fall through with retry gaps
|
|
803
805
|
}
|
|
804
806
|
else {
|
|
@@ -873,6 +875,10 @@ export async function advanceTaskLifecycle(input) {
|
|
|
873
875
|
gaps: prepareResult.gaps,
|
|
874
876
|
outcome: prepareResult.outcome,
|
|
875
877
|
softIntake: softIntakeAfter,
|
|
878
|
+
...(prepareResult.diagnosticPath ? {
|
|
879
|
+
diagnosticPath: prepareResult.diagnosticPath,
|
|
880
|
+
diagnosticSummary: prepareResult.diagnosticSummary,
|
|
881
|
+
} : {}),
|
|
876
882
|
},
|
|
877
883
|
});
|
|
878
884
|
break;
|
package/dist/build-stamp.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"version": "0.51.0-next.
|
|
4
|
-
"gitSha": "
|
|
5
|
-
"builtAt": "2026-10-
|
|
3
|
+
"version": "0.51.0-next.3",
|
|
4
|
+
"gitSha": "70fdc60ee57703e2b0c68bb23cf4930d1c158811",
|
|
5
|
+
"builtAt": "2026-10-14T17:25:52.531Z"
|
|
6
6
|
}
|
package/dist/commands/init.js
CHANGED
|
@@ -6,6 +6,7 @@ import { fileURLToPath } from "node:url";
|
|
|
6
6
|
import { GITIGNORE_BLOCK_END, GITIGNORE_BLOCK_START, buildManagedGitignoreBlock, extractGitignoreManagedBlock, mergeGitignoreManagedBlock, } from "../shared/gitignore-managed-block.js";
|
|
7
7
|
import { isInitRuntimeActive, } from "../shared/runtime-activity.js";
|
|
8
8
|
import { loadHarnessManifest } from "../governance/harness.js";
|
|
9
|
+
import { workerPolicySchema } from "../governance/manifest-types.js";
|
|
9
10
|
import { OPENCODE_CONTEXT_OVERFLOW_COMPACT_PLUGIN_PATH, OPENCODE_TRANSIENT_RETRY_PLUGIN_PATH, PI_CONTEXT_OVERFLOW_EXTENSION_PATH, PI_PROJECT_SETTINGS_PATH, applyProjectPiSettingsMerge, buildOpenCodeContextOverflowCompactPluginSource, buildProjectPiSettingsSource, buildOpenCodeTransientRetryPluginSource, buildPiContextOverflowExtensionSource, inspectProjectPiSettings, } from "./client-recovery.js";
|
|
10
11
|
import { assessInitPiModelReadiness, discoverInitModelCatalog, validateInitModelMatrixAgainstCatalog, } from "./init-model-catalog.js";
|
|
11
12
|
import { auditLegacyInitSurface, findInitRetirementConsumers, inspectContainedRegularFile, legacyAuditReceipt, removeContainedRegularFileWithSha256Cas, } from "./init-legacy-audit.js";
|
|
@@ -1415,14 +1416,22 @@ function isPiModelRoutingPath(path) {
|
|
|
1415
1416
|
}
|
|
1416
1417
|
/**
|
|
1417
1418
|
* Attribute-set iteration comparison for harness.json: object key shapes must
|
|
1418
|
-
* agree at every level, except
|
|
1419
|
-
*
|
|
1420
|
-
* freely unless the key is structurally sensitive.
|
|
1419
|
+
* agree at every level, except for opaque project-owned Pi model routing and
|
|
1420
|
+
* schema-valid optional worker policy. Scalars and array contents may otherwise
|
|
1421
|
+
* differ freely unless the key is structurally sensitive.
|
|
1421
1422
|
*/
|
|
1422
1423
|
function harnessJsonShapeMatches(current, desired, path = []) {
|
|
1423
1424
|
if (isRecord(current) || isRecord(desired)) {
|
|
1424
1425
|
if (!isRecord(current) || !isRecord(desired))
|
|
1425
1426
|
return false;
|
|
1427
|
+
if (path.length === 0 &&
|
|
1428
|
+
"workerPolicy" in current &&
|
|
1429
|
+
!("workerPolicy" in desired)) {
|
|
1430
|
+
const { workerPolicy, ...managedCurrent } = current;
|
|
1431
|
+
if (!workerPolicySchema.safeParse(workerPolicy).success)
|
|
1432
|
+
return false;
|
|
1433
|
+
return harnessJsonShapeMatches(managedCurrent, desired);
|
|
1434
|
+
}
|
|
1426
1435
|
const filterKeys = (value) => Object.keys(value)
|
|
1427
1436
|
.filter((key) => !isPiModelRoutingPath(path) || !PI_MODEL_ROUTING_KEYS.has(key))
|
|
1428
1437
|
.sort();
|
|
@@ -104,6 +104,17 @@ export function collectFrontendPlanMissingFacts(input) {
|
|
|
104
104
|
}
|
|
105
105
|
return missing;
|
|
106
106
|
}
|
|
107
|
+
/** Reuse only explicit current policy decisions, never a finalize patch snapshot. */
|
|
108
|
+
export function hasCompleteFrontendPlanGlobalPolicy(input) {
|
|
109
|
+
const facts = input.committedFacts.map(committedFactFromPlanRecord).filter((fact) => Boolean(fact && fact.origin === "plan"));
|
|
110
|
+
const route = facts.filter(fact => fact.kind === "target-surface" && !fact.patch).at(-1);
|
|
111
|
+
const dependency = facts.filter(fact => fact.kind === "dependency").at(-1);
|
|
112
|
+
// As in the assembler, singleton policies are latest-wins. A missing or
|
|
113
|
+
// empty current value must not be rescued by an earlier valid decision.
|
|
114
|
+
return planFactStringList(route?.routes).length > 0 &&
|
|
115
|
+
(!input.dependencyPolicyRequired ||
|
|
116
|
+
typeof dependency?.policy === "string" && dependency.policy.trim().length > 0);
|
|
117
|
+
}
|
|
107
118
|
/** Completeness checks for phases whose facts are committed incrementally. */
|
|
108
119
|
export function collectFrontendPlanPhaseMissingFacts(input) {
|
|
109
120
|
const facts = input.committedFacts
|
|
@@ -152,12 +163,15 @@ export function collectFrontendPlanPhaseMissingFacts(input) {
|
|
|
152
163
|
}
|
|
153
164
|
return missing;
|
|
154
165
|
}
|
|
155
|
-
const
|
|
166
|
+
const latestMock = facts.filter(fact => fact.kind === "mock-api").at(-1)?.mockApi;
|
|
167
|
+
const hasMockApi = Boolean(latestMock && typeof latestMock === "object" &&
|
|
168
|
+
!Array.isArray(latestMock) && typeof latestMock.strategy === "string" &&
|
|
169
|
+
String(latestMock.strategy).trim());
|
|
156
170
|
const allInteractions = collectCanonicalStateFlowNames(input.committedFacts).interactionNames;
|
|
157
171
|
const liveInteractions = new Set([...collectCanonicalStateFlowNames(facts.filter(f => !planFactStringList(f.scopeRequirementIds).length || planFactScopeIntersects(f, new Set(input.requirementIds)))).interactionNames].filter(name => allInteractions.has(name)));
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
172
|
+
// record_data_flow accumulates by default and publishes a replacement
|
|
173
|
+
// snapshot for replace:true. Earlier membership cannot revive a removal.
|
|
174
|
+
const coveredInteractions = new Set(planFactStringList(facts.filter(fact => fact.kind === "data-flow").at(-1)?.interactions));
|
|
161
175
|
const missing = [];
|
|
162
176
|
if (!hasMockApi) {
|
|
163
177
|
missing.push({
|
|
@@ -53,7 +53,7 @@ export function buildPlanRecordTools(ctx) {
|
|
|
53
53
|
const recordComponentChoiceTool = defineTool({
|
|
54
54
|
name: "record_component_choice",
|
|
55
55
|
label: "record_component_choice",
|
|
56
|
-
description: "Record ONE component choice (origin=plan component-choice fact). One choice may cover MULTIPLE UI states/interactions via covers: [\"<state-or-interaction name>\", ...]; do not emit one row per interaction. For decision=new, pass sourceRequirementIds containing the frozen requirement ID(s) that mandate the component and sourceFragmentId selecting one frozen citation listed in the plan checklist; the runtime validates the relation and derives the exact PRD specReference. Do not read the PRD or invent a path/line. decision=reuse-existing is only for components that already exist in the repo and REQUIRES evidencePath: a repo-relative path to the existing file that proves the reuse — the runtime verifies the file exists (fresh evidence); a path with no existing file is greenfield and must use decision=new instead. Call up to 5 component choices per assistant message; never more than 5 per message. Optionally include stylingStrategy (set it once, on the first call). Example: {\"choice\": {\"purpose\": \"<interaction or UI state name>\", \"component\": \"<component name>\", \"decision\": \"new\", \"covers\": [\"<other interaction names this component also serves>\"]}, \"sourceRequirementIds\": [\"<AC-XXX mandating this component>\"], \"sourceFragmentId\": \"<REQ-SRC-...>\"} or {\"choice\": {\"purpose\": \"FocusQueuePanel\", \"component\": \"FocusQueuePanel\", \"decision\": \"reuse-existing\", \"evidencePath\": \"src/journal.ts\"}}",
|
|
56
|
+
description: "Record ONE component choice (origin=plan component-choice fact). One choice may cover MULTIPLE UI states/interactions via covers: [\"<state-or-interaction name>\", ...]; do not emit one row per interaction. For decision=specified, provide non-empty specReference.path and section citing the frozen task source, never an implementation file. For decision=new, pass sourceRequirementIds containing the frozen requirement ID(s) that mandate the component and sourceFragmentId selecting one frozen citation listed in the plan checklist; the runtime validates the relation and derives the exact PRD specReference. Do not read the PRD or invent a path/line. decision=reuse-existing is only for components that already exist in the repo and REQUIRES evidencePath: a repo-relative path to the existing file that proves the reuse — the runtime verifies the file exists (fresh evidence); a path with no existing file is greenfield and must use decision=new instead. Call up to 5 component choices per assistant message; never more than 5 per message. Optionally include stylingStrategy (set it once, on the first call). Example: {\"choice\": {\"purpose\": \"<interaction or UI state name>\", \"component\": \"<component name>\", \"decision\": \"new\", \"covers\": [\"<other interaction names this component also serves>\"]}, \"sourceRequirementIds\": [\"<AC-XXX mandating this component>\"], \"sourceFragmentId\": \"<REQ-SRC-...>\"} or {\"choice\": {\"purpose\": \"FocusQueuePanel\", \"component\": \"FocusQueuePanel\", \"decision\": \"reuse-existing\", \"evidencePath\": \"src/journal.ts\"}}",
|
|
57
57
|
promptSnippet: "Record 1-5 component choices (up to 5 per message).",
|
|
58
58
|
parameters: Type.Object({
|
|
59
59
|
choice: uiComponentChoiceSchema,
|
|
@@ -104,6 +104,12 @@ export function buildPlanRecordTools(ctx) {
|
|
|
104
104
|
...(citation.line !== undefined ? { line: citation.line } : {}),
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
+
const { checkComponentChoiceSourceReferences, deriveFrontendSourceBindingPathsFromRun } = await import("../../../workflows/dag/frontend-implementation-contract.js");
|
|
108
|
+
const citationFindings = checkComponentChoiceSourceReferences({ uiComponentChoices: [choice] }, await deriveFrontendSourceBindingPathsFromRun(input.runDir));
|
|
109
|
+
if (citationFindings.length) {
|
|
110
|
+
return planToolReceipt({ ok: false, kind: "component-choice",
|
|
111
|
+
error: citationFindings.map(finding => finding.message).join("; ") + "; re-submit record_component_choice with the same purpose and a frozen source citation; use reuse-existing with evidencePath only when reusing an existing component." });
|
|
112
|
+
}
|
|
107
113
|
if (choice.decision === "reuse-existing") {
|
|
108
114
|
// reuse-existing must cite a file that actually exists NOW (fresh
|
|
109
115
|
// existence evidence, same semantics as Scout pathEvidence.fresh).
|
|
@@ -660,7 +666,7 @@ export function buildPlanRecordTools(ctx) {
|
|
|
660
666
|
const recordPlanVerificationTargetTool = defineTool({
|
|
661
667
|
name: "record_plan_verification_target",
|
|
662
668
|
label: "record_plan_verification_target",
|
|
663
|
-
description: "Commit one plan verification target entry (origin=plan plan-verification-target fact). Reference a frozen verification command by commandId (see the frozen command directory in your prompt: static commands are project-wide checks traced by file and command only; behavior commands bind an existing affected test file; preserve its test names). For behavior targets, call once per distinct behavior, not mechanically once per requirement: one target may cover multiple related requirementIds. For a correction, re-submit the same id with replace=true; the ledger compiles the latest replacement. A target id identifies a contract entry only; never require it in test names. Results bind by frozen command and test file. Entry carries id, commandId, file, requirementIds, and uiStates; optional scope (unit | component | integration) is display-only. Free-form symbol text is not accepted. IMPORTANT: batch up to 4 record_* calls per assistant message; never batch more than 4 — a larger single message risks output truncation under a small output window. Example: {\"entry\": {\"id\": \"VT-DASHBOARD-SHELL\", \"commandId\": \"<frozen behavior command id>\", \"file\": \"<test file>\", \"requirementIds\": [\"AC-001\", \"AC-002\"], \"uiStates\": []}}" +
|
|
669
|
+
description: "Commit one plan verification target entry (origin=plan plan-verification-target fact). Reference a frozen verification command by commandId (see the frozen command directory in your prompt: EVERY static command must have a target, even when behavior tests are already covered; static commands are project-wide checks traced by a planned implementation file and command only; behavior commands bind an existing affected test file; preserve its test names). For behavior targets, call once per distinct behavior, not mechanically once per requirement: one target may cover multiple related requirementIds. For a correction, re-submit the same id with replace=true; the ledger compiles the latest replacement. A target id identifies a contract entry only; never require it in test names. Results bind by frozen command and test file. Entry carries id, commandId, file, requirementIds, and uiStates; optional scope (unit | component | integration) is display-only. Free-form symbol text is not accepted. IMPORTANT: batch up to 4 record_* calls per assistant message; never batch more than 4 — a larger single message risks output truncation under a small output window. Example: {\"entry\": {\"id\": \"VT-DASHBOARD-SHELL\", \"commandId\": \"<frozen behavior command id>\", \"file\": \"<test file>\", \"requirementIds\": [\"AC-001\", \"AC-002\"], \"uiStates\": []}}" +
|
|
664
670
|
(input.canonicalVerificationTargetIds &&
|
|
665
671
|
input.canonicalVerificationTargetIds.length > 0
|
|
666
672
|
? ` Frozen canonical behavior target ids (use exactly for behavior targets): ${input.canonicalVerificationTargetIds.join(", ")}.`
|
|
@@ -784,6 +790,17 @@ export function buildPlanRecordTools(ctx) {
|
|
|
784
790
|
// (r7: one full attempt lost to a single unknown UI state name).
|
|
785
791
|
const committedEvents = readCommittedEvents(session.store, session.attemptId);
|
|
786
792
|
const declaredUiStateNames = collectCanonicalStateFlowNames(committedEvents).uiStateNames;
|
|
793
|
+
const stateVocabulary = collectCanonicalStateFlowNames(committedEvents);
|
|
794
|
+
if (verifyDirectory.find(command => command.commandId === verificationCommandId)?.mode === "behavior") {
|
|
795
|
+
if (stringList(rawEntry.requirementIds).length === 0) {
|
|
796
|
+
return planToolReceipt({ ok: false, kind: "plan-verification-target",
|
|
797
|
+
error: `behavior verification target ${vtId} must reference at least one requirement; correct entry.requirementIds and resubmit` });
|
|
798
|
+
}
|
|
799
|
+
if (entry.uiStates.length === 0 && (stateVocabulary.uiStateNames.size > 0 || stateVocabulary.interactionNames.size > 0)) {
|
|
800
|
+
return planToolReceipt({ ok: false, kind: "plan-verification-target",
|
|
801
|
+
error: `behavior verification target ${vtId} must reference at least one declared UI state; correct entry.uiStates using [${[...stateVocabulary.uiStateNames].join(", ")}] and resubmit` });
|
|
802
|
+
}
|
|
803
|
+
}
|
|
787
804
|
const unknownUiStates = entry.uiStates.filter((name) => !declaredUiStateNames.has(name));
|
|
788
805
|
if (unknownUiStates.length > 0) {
|
|
789
806
|
return planToolReceipt({
|
|
@@ -824,7 +841,21 @@ export function buildPlanRecordTools(ctx) {
|
|
|
824
841
|
entry,
|
|
825
842
|
...(params?.replace === true ? { replaces: vtId } : {}),
|
|
826
843
|
});
|
|
827
|
-
|
|
844
|
+
const latestTargets = new Map();
|
|
845
|
+
for (const event of readCommittedEvents(session.store, session.attemptId)) {
|
|
846
|
+
const fact = event.fact;
|
|
847
|
+
if (fact.kind === "plan-verification-target" && isRecordObject(fact.entry)
|
|
848
|
+
&& typeof fact.entry.id === "string" && typeof fact.entry.commandId === "string") {
|
|
849
|
+
latestTargets.set(fact.entry.id, fact.entry.commandId);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
const coveredCommands = new Set(latestTargets.values());
|
|
853
|
+
const remainingStaticCommandIds = verifyDirectory
|
|
854
|
+
.filter(command => command.mode === "static" && !coveredCommands.has(command.commandId))
|
|
855
|
+
.map(command => command.commandId);
|
|
856
|
+
const receipt = { ...result, remainingStaticCommandIds,
|
|
857
|
+
...(remainingStaticCommandIds.length ? { nextAction: "Call record_plan_verification_target for each remaining static command, using a planned implementation file; behavior targets do not cover static commands." } : {}) };
|
|
858
|
+
return planToolReceipt(receipt);
|
|
828
859
|
},
|
|
829
860
|
});
|
|
830
861
|
// F1: bounded executable implementation slices. The plan owns the semantic
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { observeFrontendSession } from "../../../workflows/dag/frontend-session-budget.js";
|
|
4
4
|
import { createFrontendScoutEvidenceTools } from "../tools/scout-evidence-tools.js";
|
|
5
|
+
import { readCompleteScoutTargetSurface } from "../../../workflows/dag/frontend-committed-facts.js";
|
|
5
6
|
export function aggregateParallelPiResults(results) {
|
|
6
7
|
const first = results[0];
|
|
7
8
|
const failed = results.find((result) => !result.ok);
|
|
@@ -47,7 +48,8 @@ export async function runFrontendScoutParallelSessions(input) {
|
|
|
47
48
|
instruction: [
|
|
48
49
|
"PARALLEL SCOUT SHARD — target surface only.",
|
|
49
50
|
"Inspect routes, entrypoints, implementation ownership, data source, and existing test entrypoints. Inspect project source/config first; do not recursively explore dependency internals merely to reconfirm standard test-runner behavior. If a concrete required capability cannot be established from project evidence, report the precise gap.",
|
|
50
|
-
"
|
|
51
|
+
"For requested history, trends or aggregates, inspect whether existing storage/API contains the necessary samples. Compare this evidence with forbidden paths and read-only constraints. Report an infeasible required capability as a precise blocked gap; never invent historical samples or silently relax acceptance criteria.",
|
|
52
|
+
"Commit one accepted record_target_surface with the complete runtime-evidenced surface. If rejected, correct the reported errors and resubmit before ending. entrypoint is a single repository-relative path; route/mount relationships belong in routeOrMount. Do not call record_design_evidence.",
|
|
51
53
|
].join(" "),
|
|
52
54
|
},
|
|
53
55
|
{
|
|
@@ -63,8 +65,10 @@ export async function runFrontendScoutParallelSessions(input) {
|
|
|
63
65
|
const outcomes = await Promise.all(shards.map(async (shard) => {
|
|
64
66
|
const cacheKey = JSON.stringify([input.runDir, input.nodeId, shard.id, input.sessionOptions.modelConfig, input.observation?.model, input.observation?.sourceDigest, input.sourceDeclaredPaths]);
|
|
65
67
|
const cached = input.completedShards?.get(cacheKey);
|
|
66
|
-
if (cached)
|
|
68
|
+
if (cached && (shard.id !== "surface" || readCompleteScoutTargetSurface(cached.facts).ok))
|
|
67
69
|
return { shard, facts: cached.facts, result: { ...cached.result, durationMs: 0, tokensUsed: 0, parsedEvents: 0, attemptedModels: [], fallbackUsed: false } };
|
|
70
|
+
if (cached)
|
|
71
|
+
input.completedShards?.delete(cacheKey);
|
|
68
72
|
let shardTools;
|
|
69
73
|
let shardResult;
|
|
70
74
|
try {
|
|
@@ -108,6 +112,11 @@ export async function runFrontendScoutParallelSessions(input) {
|
|
|
108
112
|
}));
|
|
109
113
|
await shardTools.flush();
|
|
110
114
|
const facts = shardTools.committedFacts();
|
|
115
|
+
if (shard.id === "surface" && shardResult.ok) {
|
|
116
|
+
const check = readCompleteScoutTargetSurface(facts);
|
|
117
|
+
if (!check.ok)
|
|
118
|
+
shardResult = { ...shardResult, ok: false, failureCategory: "invalid-output", stderr: [shardResult.stderr, check.reason].filter(Boolean).join("\n") };
|
|
119
|
+
}
|
|
111
120
|
const expectedKind = shard.id === "design" ? "design-evidence" : "target-surface";
|
|
112
121
|
if (shardResult.ok && facts.some(record => { const fact = record.fact; return fact.kind === expectedKind && (shard.id !== "surface" || fact.completeness === "complete"); })) {
|
|
113
122
|
input.completedShards?.set(cacheKey, { result: structuredClone(shardResult), facts: structuredClone(facts) });
|