@tea-agent/loop-agent 0.28.13 → 0.29.1

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.
Files changed (48) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +73 -15
  3. package/dist/commands/client-recovery.js +56 -1
  4. package/dist/commands/init-upgrade.js +186 -21
  5. package/dist/commands/init.js +1 -1
  6. package/dist/executors/dag-pi-executor.js +52 -3
  7. package/dist/executors/pi-playwright-cli-tool.js +14 -8
  8. package/dist/executors/shell-executor.js +288 -0
  9. package/dist/task/config-types.js +21 -0
  10. package/dist/worker/console/app-data.js +132 -11
  11. package/dist/worker/console/chat/pi-runtime.js +24 -42
  12. package/dist/worker/console/chat/resource-loader.js +11 -20
  13. package/dist/worker/console/chat/routes.js +7 -8
  14. package/dist/worker/console/chat/runtime-context.js +1 -1
  15. package/dist/worker/console/chat/tools.js +67 -54
  16. package/dist/worker/console/operation-runner.js +15 -1
  17. package/dist/worker/console/operation-store.js +70 -49
  18. package/dist/worker/console/operator-actions.js +57 -1
  19. package/dist/worker/console/static/assets/index-Cwx-ZVEQ.js +29 -0
  20. package/dist/worker/console/static/favicon.svg +37 -0
  21. package/dist/worker/console/static/index.html +2 -1
  22. package/dist/workflows/dag/backend-test-scenario-param.js +846 -0
  23. package/dist/workflows/dag/backend-test-writer-completeness.js +418 -0
  24. package/dist/workflows/dag/frontend-test-case-checklist.js +94 -15
  25. package/dist/workflows/dag/frontend-test-case-manifest.js +104 -0
  26. package/dist/workflows/dag/frontend-test-html-report.js +106 -24
  27. package/dist/workflows/dag/frontend-test-result-contract.js +3 -0
  28. package/dist/workflows/dag/init-hybrid.js +187 -108
  29. package/dist/workflows/dag/node-execution.js +31 -2
  30. package/dist/workflows/dag/retry-policy.js +55 -18
  31. package/dist/workflows/dag/types.js +41 -0
  32. package/dist/workflows/dag/validate.js +42 -4
  33. package/docs/operations/README.md +1 -1
  34. package/docs/templates/README.md +2 -1
  35. package/docs/templates/agent-dag.schema.json +9 -4
  36. package/docs/templates/backend-test-dag.json +36 -11
  37. package/docs/templates/frontend-test-case-checklist.md +1 -1
  38. package/docs/templates/frontend-test-dag.generate-cases.prompt.md +9 -1
  39. package/docs/templates/frontend-test-dag.json +125 -267
  40. package/docs/templates/frontend-test-dag.retrieve-context.prompt.md +7 -1
  41. package/docs/templates/frontend-test-dag.review-cases.prompt.md +1 -1
  42. package/docs/templates/frontend-test-standard-scenarios.v1.json +114 -0
  43. package/docs/templates/init-managed-agents.md +1 -1
  44. package/harness.json +2 -2
  45. package/package.json +2 -1
  46. package/skills/playwright-cli/SKILL.md +1 -1
  47. package/skills/playwright-cli-case-generator/SKILL.md +1 -1
  48. package/dist/worker/console/static/assets/index-BfRgtLF4.js +0 -29
@@ -10,6 +10,12 @@ The preflight controller resolves and freezes one absolute browser base URL from
10
10
  - Never use production hosts or credentials.
11
11
  - Write `environmentProbe: pending`. The environment preflight shell will replace this with `reachable`, `unreachable`, or `curl-unavailable` plus a structured `blockedReason` (for example `frontend-base-url-unreachable`).
12
12
  - Include the exact browser start prefix using the supplied controller-frozen URL:
13
- `playwright-cli open --browser=chrome --headed <controller-frozen-base-url>`.
13
+ `playwright-cli open --browser=chrome --headless <controller-frozen-base-url>`.
14
14
 
15
15
  Do not claim the environment is reachable until preflight completes. Preflight does not start the application.
16
+
17
+
18
+ ## Standard scenario coverage
19
+
20
+ - Copy or reference `docs/templates/frontend-test-standard-scenarios.v1.json` into `testcase/frontend/rag/standard-scenarios.v1.json` when available.
21
+ - Add `## Standard scenario coverage` to coverage-map.md with planned/n/a for each must scenario.
@@ -2,4 +2,4 @@
2
2
 
3
3
  Read the RAG files and Markdown cases only. First line must be `VERDICT: pass` or `VERDICT: request-revision`. Report AC coverage, case independence, evidence completeness, unsafe environment/data dependencies, and manifest issues. This verdict is a deterministic safety gate: `request-revision` blocks manifest materialization and browser execution.
4
4
 
5
- Every case must retain the exact browser-start command prefix with the resolved absolute baseUrl from `testcase/frontend/rag/context.md` (prefer task source `config.md`, else `http://localhost:5173`): `playwright-cli open --browser=chrome --headed <resolved-base-url>`; session flags must not precede `open`, and subsequent commands must remain in its default session without `-s=` or assumed named-session binding. Verify every executable sub-scenario specifies fixture/reset, UI reset, fresh snapshot before element refs, a successful `playwright-cli find ...` semantic assertion after `open`, and an evidence write point. `snapshot`, `goto`, `screenshot`, `request`/`console`, and ordinary interactions cannot independently authorize passed. Verify each case requires both `execution.md` and `case-result.json` under its own evidence directory. The JSON result must contain matching `caseId`, `status` (`passed`, `failed`, or `blocked`) and `evidencePaths`; blocked cases must name a non-empty `blockedReason` and cannot count as passed.
5
+ Every case must retain the exact browser-start command prefix with the resolved absolute baseUrl from `testcase/frontend/rag/context.md` (prefer task source `config.md`, else `http://localhost:5173`): `playwright-cli open --browser=chrome --headless <resolved-base-url>`; session flags must not precede `open`, and subsequent commands must remain in its default session without `-s=` or assumed named-session binding. Verify every executable sub-scenario specifies fixture/reset, UI reset, fresh snapshot before element refs, a successful `playwright-cli find ...` semantic assertion after `open`, and an evidence write point. `snapshot`, `goto`, `screenshot`, `request`/`console`, and ordinary interactions cannot independently authorize passed. Verify each case requires both `execution.md` and `case-result.json` under its own evidence directory. The JSON result must contain matching `caseId`, `status` (`passed`, `failed`, or `blocked`) and `evidencePaths`; blocked cases must name a non-empty `blockedReason` and cannot count as passed.
@@ -0,0 +1,114 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "frontend-test-standard-scenarios-v1",
4
+ "scenarios": [
5
+ {
6
+ "id": "STD-FE-SMOKE-ENTRY",
7
+ "title": "入口可打开与壳层可见",
8
+ "category": "smoke",
9
+ "priority": "must",
10
+ "dimensionHint": "core",
11
+ "testPoints": ["冻结 baseUrl 可 open", "关键导航或页面壳可见"],
12
+ "minCases": 1
13
+ },
14
+ {
15
+ "id": "STD-FE-EMPTY-STATE",
16
+ "title": "列表空态",
17
+ "category": "empty",
18
+ "priority": "must",
19
+ "dimensionHint": "boundary",
20
+ "testPoints": ["无数据时空态文案或引导", "不白屏"],
21
+ "minCases": 1
22
+ },
23
+ {
24
+ "id": "STD-FE-LIST-PAGE",
25
+ "title": "列表渲染",
26
+ "category": "list",
27
+ "priority": "must",
28
+ "dimensionHint": "core",
29
+ "testPoints": ["表头/列或卡片列表可见", "有数据时行可渲染"],
30
+ "minCases": 1
31
+ },
32
+ {
33
+ "id": "STD-FE-PAGINATION",
34
+ "title": "分页或加载更多",
35
+ "category": "pagination",
36
+ "priority": "should",
37
+ "dimensionHint": "boundary",
38
+ "testPoints": ["翻页或加载更多可观察", "数据不足可 blocked 并写原因"],
39
+ "minCases": 0
40
+ },
41
+ {
42
+ "id": "STD-FE-CREATE-FORM-VALIDATION",
43
+ "title": "创建表单校验",
44
+ "category": "form",
45
+ "priority": "must",
46
+ "dimensionHint": "boundary",
47
+ "testPoints": ["必填/格式校验", "不提交明显脏数据"],
48
+ "minCases": 1
49
+ },
50
+ {
51
+ "id": "STD-FE-CREATE-SUCCESS",
52
+ "title": "创建成功反馈",
53
+ "category": "create",
54
+ "priority": "must",
55
+ "dimensionHint": "flow",
56
+ "testPoints": ["成功提示", "列表或详情可见新数据或等价反馈"],
57
+ "minCases": 1
58
+ },
59
+ {
60
+ "id": "STD-FE-VIEW-DETAIL",
61
+ "title": "详情查看",
62
+ "category": "detail",
63
+ "priority": "must",
64
+ "dimensionHint": "core",
65
+ "testPoints": ["从列表进入详情", "关键字段可读"],
66
+ "minCases": 1
67
+ },
68
+ {
69
+ "id": "STD-FE-UPDATE-OWNED",
70
+ "title": "更新归属数据",
71
+ "category": "update",
72
+ "priority": "should",
73
+ "dimensionHint": "flow",
74
+ "testPoints": ["仅可证明归属数据", "否则 blocked"],
75
+ "minCases": 0
76
+ },
77
+ {
78
+ "id": "STD-FE-DELETE-CONFIRM",
79
+ "title": "删除确认",
80
+ "category": "delete",
81
+ "priority": "should",
82
+ "dimensionHint": "flow",
83
+ "testPoints": ["确认框或等价保护", "归属规则"],
84
+ "minCases": 0
85
+ },
86
+ {
87
+ "id": "STD-FE-SEARCH-FILTER",
88
+ "title": "搜索筛选",
89
+ "category": "filter",
90
+ "priority": "must",
91
+ "dimensionHint": "core",
92
+ "testPoints": ["关键字或状态筛选结果变化"],
93
+ "minCases": 1
94
+ },
95
+ {
96
+ "id": "STD-FE-API-ERROR-TOAST",
97
+ "title": "后端错误可见反馈",
98
+ "category": "error",
99
+ "priority": "should",
100
+ "dimensionHint": "backend",
101
+ "testPoints": ["错误提示可观察", "可用 Mock"],
102
+ "minCases": 0
103
+ },
104
+ {
105
+ "id": "STD-FE-LOADING-DISABLED",
106
+ "title": "提交中防重复",
107
+ "category": "interaction",
108
+ "priority": "should",
109
+ "dimensionHint": "boundary",
110
+ "testPoints": ["loading 或按钮禁用"],
111
+ "minCases": 0
112
+ }
113
+ ]
114
+ }
@@ -136,7 +136,7 @@ agent-worker console serve --repo . --port 8790 # 兼容入口,等价于上
136
136
 
137
137
  live run 先用 `loop-agent dag status --run-id <run-id>` 看 lifecycle 与 liveness;用 `loop-agent dag report --run-id <run-id> --markdown` 读 facts;失败/paused 用 `loop-agent dag doctor --run-id <run-id> --markdown`。生命周期对齐先只读运行 `loop-agent dag reconcile-run --run-id <run-id>`;只有 runner 已停止且 operator 明确提供 `--action supersede|abandon --reason "..."` 时才允许变更。失败 run 用 `loop-agent dag closeout-draft --run-id <run-id>` 生成 failure handoff,不要写成成功 closeout。
138
138
 
139
- Operator 须持续监控 live run,直到 controller 报告 run 已结束(节点/流程终态如 `FINISHED`、`FAILED` 或 `partial_failed`),或 Decision Gate **需要 approve**;不要在节点仍运行时假定完成。判活须组合 runner heartbeat、session events 与 `dag doctor` liveness/provider meaningful progress;Runner heartbeat 只证明 lease,alone ≠ progress,不得仅凭运行时长结束节点。exclusive writer(如 `implement-pi` / `repair-pi`)运行期间:主会话与其他 writer **不得并发修改工作区**,以免 write-guard 错误归因;只读 status/doctor/report/observe 与 approve/reject/resume CLI 仍允许。恢复:status/doctor/report → classify → reconcile/replan → CLI 重跑 → shell verify。**禁止**把主会话直接 Edit 业务代码当作恢复手段。
139
+ Operator 须持续监控 live run,直到 controller 报告 run 已结束(节点/流程终态如 `FINISHED`、`FAILED` 或 `partial_failed`),或 Decision Gate **需要 approve**;不要在节点仍运行时假定完成。持续监视过程中,主会话可在合适节点(例如节点/rank 状态变化、进入 verify/closeout、出现 stall 嫌疑或需要 approve 时)向用户做简短进度汇报(当前节点、状态、是否有风险),避免长时间静默;汇报是告知,不是请求确认,不得因此停下流程。判活须组合 runner heartbeat、session events 与 `dag doctor` liveness/provider meaningful progress;Runner heartbeat 只证明 lease,alone ≠ progress,不得仅凭运行时长结束节点。exclusive writer(如 `implement-pi` / `repair-pi`)运行期间:主会话与其他 writer **不得并发修改工作区**,以免 write-guard 错误归因;只读 status/doctor/report/observe 与 approve/reject/resume CLI 仍允许。恢复:status/doctor/report → classify → reconcile/replan → CLI 重跑 → shell verify。**禁止**把主会话直接 Edit 业务代码当作恢复手段。
140
140
 
141
141
  ### 运行态与验证
142
142
 
package/harness.json CHANGED
@@ -81,8 +81,8 @@
81
81
  "pi": {
82
82
  "description": "Pi planning, review, diagnosis, and bounded writing when DAG toolProfile=write",
83
83
  "LOW": "minimax-m3",
84
- "MED": "gpt-5.6-terra",
85
- "HIGH": "gpt-5.6-sol"
84
+ "MED": { "model": "deepseek/deepseek-v4-flash", "thinking": "max" },
85
+ "HIGH": "grok-4.5"
86
86
  }
87
87
  }
88
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tea-agent/loop-agent",
3
- "version": "0.28.13",
3
+ "version": "0.29.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "loop-agent": "bin/loop-agent.js",
@@ -51,6 +51,7 @@
51
51
  "lint": "tsc --noEmit",
52
52
  "typecheck": "tsc --noEmit",
53
53
  "test": "node scripts/run-tests.mjs",
54
+ "test:host": "vitest run test/init-upgrade.test.ts --maxWorkers=1 -t \"records and reuses|controller-authorized semantic merge|authority-sensitive\"",
54
55
  "test:fast": "vitest run --config vitest.fast.config.ts",
55
56
  "test:integration": "vitest run --config vitest.integration.config.ts",
56
57
  "docs:dev": "npm --prefix website start",
@@ -58,7 +58,7 @@ request
58
58
  获取 snapshot,并只使用 snapshot 中可见的 ref 或已知安全 locator。
59
59
 
60
60
  ```text
61
- playwright-cli open --browser=chrome --headed http://localhost:5173
61
+ playwright-cli open --browser=chrome --headless http://localhost:5173
62
62
  playwright-cli snapshot
63
63
  playwright-cli find "Sign in"
64
64
  playwright-cli fill e1 "user@example.com"
@@ -41,7 +41,7 @@ description: 根据 FE-test RAG 知识包生成可由受限 playwright_cli runti
41
41
  `-s=<case-id>` 建立 named session。
42
42
  3. 可独立执行的命令序列:使用 RAG `context.md` 中已解析的绝对 `baseUrl`(优先来自任务源
43
43
  `config.md`;缺失时默认 `http://localhost:5173`),必须以
44
- `playwright-cli open --browser=chrome --headed` 后接解析出的具体 base URL 开始;不得保留
44
+ `playwright-cli open --browser=chrome --headless` 后接解析出的具体 base URL 开始;不得保留
45
45
  base-url 占位符,也不得使用 `-s=<case-id>` 或其他 named session;再按需登录、数据准备、
46
46
  `snapshot` 后优先使用元素引用和操作。每个拟通过场景必须在 `open` 后以成功的 `find` 作为
47
47
  唯一结构化 UI 语义断言,再由 controller 执行 post-execution cleanup。`snapshot`、`goto`、