@tea-agent/loop-agent 0.16.1 → 0.16.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 +27 -0
- package/dist/executors/dag-pi-executor.js +4 -2
- package/dist/executors/pi-sdk-executor.js +66 -3
- package/dist/executors/shell-executor.js +239 -29
- package/dist/executors/shell-presets.js +12 -2
- package/dist/executors/shell-write-guard.js +20 -1
- package/dist/shared/git-progress.js +9 -2
- package/dist/worker/observability/read-model.js +56 -0
- package/dist/worker/observe/server.js +6 -3
- package/dist/workflows/dag/backend-test-analysis-contract.js +87 -30
- package/dist/workflows/dag/backend-test-case-manifest.js +71 -8
- package/dist/workflows/dag/backend-test-execution-contract.js +63 -11
- package/dist/workflows/dag/backend-test-repair-contract.js +94 -0
- package/dist/workflows/dag/backend-test-result-contract.js +6 -4
- package/dist/workflows/dag/backend-test-semantic-review-contract.js +36 -0
- package/dist/workflows/dag/dynamic-runtime/condition.js +1 -1
- package/dist/workflows/dag/dynamic-runtime/shared.js +42 -0
- package/dist/workflows/dag/failure-routing.js +1 -1
- package/dist/workflows/dag/frontend-implementation-contract.js +32 -16
- package/dist/workflows/dag/frontend-worktree-diff.js +127 -0
- package/dist/workflows/dag/init-hybrid.js +616 -120
- package/dist/workflows/dag/lifecycle.js +33 -2
- package/dist/workflows/dag/scheduler.js +87 -17
- package/dist/workflows/dag/types.js +31 -0
- package/dist/workflows/dag/validate.js +20 -14
- package/docs/templates/agent-dag.schema.json +25 -2
- package/docs/templates/backend-test-analysis.schema.json +9 -16
- package/docs/templates/backend-test-dag.json +493 -197
- package/docs/templates/backend-test-dag.review-cases.prompt.md +10 -4
- package/docs/templates/backend-test-execution.schema.json +6 -1
- package/package.json +1 -1
- package/skills/frontend-review/SKILL.md +6 -2
- package/skills/loop-agent/references/hybrid-dag.md +4 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Purpose
|
|
4
4
|
|
|
5
|
-
Use this prompt for a read-only **backend test case review** node: `executor: "pi"`, `role: "reviewer"`, `writePolicy: "read-only"`. The reviewer audits generated backend functional test cases for completeness, format compliance, and traceability to source requirements.
|
|
5
|
+
Use this prompt for a read-only **backend test case review** node: `executor: "pi"`, `role: "reviewer"`, `writePolicy: "read-only"`. The reviewer audits generated backend functional test cases for completeness, format compliance, and traceability to source requirements. A first review may return `request-revision` to drive a single `revise-backend-cases-pi` pass; **final** review (`review-backend-cases-final-pi`) must emit `VERDICT: pass` before `generate-backend-pytest-pi`.
|
|
6
6
|
|
|
7
7
|
Do **not** create `executor: reviewer`. Reviewer is a **role** on `executor: pi`.
|
|
8
8
|
|
|
@@ -56,7 +56,9 @@ Do NOT re-read source documents. Use the validated analysis artifact, case manif
|
|
|
56
56
|
| **Boundary conditions** | Edge cases (empty input, max length, edge values) | Important |
|
|
57
57
|
| **State transitions** | Illegal state changes covered | Important |
|
|
58
58
|
| **Requirement traceability** | Each acceptance criterion (AC-xxx) maps to at least one test case ID (manifest coverageSummary or evidenceGaps) | Critical |
|
|
59
|
-
| **Manifest consistency** | Markdown
|
|
59
|
+
| **Manifest consistency** | Markdown case bodies **and** any AC matrix list the **same full** `BE-*` ids as Case Manifest v1 `caseId`→`acIds`. Never claim "all cases" / "全部用例" cover an AC unless every case maps that AC. | Critical |
|
|
60
|
+
| **Planned automation** | Missing `test_*.py` before generate-pytest is **Informational only**, not Critical | Informational |
|
|
61
|
+
| **Out-of-scope ACs** | Flyway / frontend e2e / `mvn test` etc. already in manifest `evidenceGaps` must not be treated as uncovered Critical | Informational |
|
|
60
62
|
| **Case structure** | Each case has: ID, Title, Precondition, Steps, Expected Result | Important |
|
|
61
63
|
| **No duplicate IDs** | All test case IDs are unique across files | Critical |
|
|
62
64
|
|
|
@@ -77,7 +79,11 @@ Do NOT re-read source documents. Use the validated analysis artifact, case manif
|
|
|
77
79
|
|
|
78
80
|
### Output Shape (after verdict line)
|
|
79
81
|
|
|
80
|
-
1. **Coverage Assessment** — table mapping each AC to covering test case IDs (or "uncovered").
|
|
82
|
+
1. **Coverage Assessment** — table mapping each AC to covering **full** test case IDs (or "uncovered" / gap).
|
|
81
83
|
2. **Findings** — bullet list tagged `Critical`, `Important`, or `Informational`.
|
|
82
84
|
3. **Statistics** — total case count, positive/negative/boundary breakdown, module distribution.
|
|
83
|
-
4. **Required revisions** (only when `request-revision`) — numbered
|
|
85
|
+
4. **Required revisions** (only when `request-revision` on the **first** review) — numbered, concrete MD edits for `revise-backend-cases-pi` (fix matrices, acIds, full BE-* ids).
|
|
86
|
+
|
|
87
|
+
### Final review note
|
|
88
|
+
|
|
89
|
+
When this prompt is used for `review-backend-cases-final-pi` after revision, still use the same checklist. Remaining Critical issues must yield `request-revision` (final gate will stop the DAG). Do not pass with unresolved MD↔manifest AC mismatches.
|
|
@@ -69,7 +69,12 @@
|
|
|
69
69
|
"additionalProperties": false,
|
|
70
70
|
"required": ["path", "description"],
|
|
71
71
|
"properties": {
|
|
72
|
-
"path": {
|
|
72
|
+
"path": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"minLength": 1,
|
|
75
|
+
"pattern": "^/(?!/)(?!.*(?:^|/)\\.{1,2}(?:/|$))(?!.*//)(?!.*\\\\)[^?#]*$",
|
|
76
|
+
"description": "HTTP URL path on the target service for readiness probes (e.g. /api/health). Not a repository file path; must start with one /, use POSIX separators, and must not include duplicate slashes, dot segments, query, fragment, or scheme. Runtime trims surrounding whitespace before validating and materializing the normalized path."
|
|
77
|
+
},
|
|
73
78
|
"description": { "type": "string", "minLength": 1 }
|
|
74
79
|
}
|
|
75
80
|
}
|
package/package.json
CHANGED
|
@@ -12,8 +12,12 @@ references:
|
|
|
12
12
|
Use for `frontend-review-pi`; read the findings guide first. Required inputs are
|
|
13
13
|
original task/reference material, contract/constraints, Mock assessment, original and
|
|
14
14
|
revised/confirmed plan, final design verdict, implementation summary, actual diff,
|
|
15
|
-
and static/behavior/optional Mock shell evidence.
|
|
16
|
-
|
|
15
|
+
and static/behavior/optional Mock shell evidence. The actual diff is the run-owned
|
|
16
|
+
`frontend-worktree-diff-shell` artifacts: `contracts/frontend-worktree-diff.json` and
|
|
17
|
+
`artifacts/diff_patch.patch` under the current DAG run directory. When those artifacts
|
|
18
|
+
exist, treat them as the authoritative actual diff—do not request revision solely for
|
|
19
|
+
"missing diff". Only force revision for a missing actual diff when both artifacts are
|
|
20
|
+
absent; never invent a diff from an implementation summary alone.
|
|
17
21
|
|
|
18
22
|
## Verdict Contract
|
|
19
23
|
|
|
@@ -18,7 +18,10 @@
|
|
|
18
18
|
|
|
19
19
|
前端专用链在 `frontend-scout-pi` 后加入只读 `frontend-mock-assess-pi` 和确定性 contract gate,根据接口契约、后端就绪度、生成期能力 seed 与固化验证入口选择 `native|browser-intercept|request-adapter|not-needed|blocked`。策略直接传给 plan、两阶段 design review、唯一 writer、实现 review 和 closeout;真实请求保持默认,缺少契约、生产隔离、注释真实请求或显式 required 合同不完整时 gate 阻塞。可选 `frontendMock` 配置声明 `auto|required|disabled`、既有服务目录与专项命令;默认 `auto` 下没有已确认 Mock 能力时跳过 Mock 继续实现并保留真实联调缺口,不安全或不完整的显式 required 合同只生成无 writer 的评估链,有可信命令时才增加 `frontend-mock-verify-shell`。Mock-backed 证据只证明前端状态;跳过 Mock 且未调用后端时 closeout 报告 `Frontend status: locally-validated` 与 `Real integration: pending`。
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
> Backend-test vNext:Analysis v2 明确 responseBody shape、ordering、field comparison/precision 与 sourceRefs,并兼容归一化 v1;pytest 生成后 traceability 会按真实 symbol 更新 generated Manifest 和 global/in-scope/cross-domain coverage,随后执行结构化语义 review,最多一次 testcase-only revision,final pass 后才运行 initial pytest。Observe snapshot 投影 initial/classification/repair/final/effective facts。
|
|
23
|
+
|
|
24
|
+
显式专用 `taskKind` 保持兼容并优先于任务源分类。`backend-test` 选择固定 **24 个真实顶层节点**的后端测试 DAG:intake 双合同、cases+manifest、单次 case revision、pytest 生成与 semantic review、单次 semantic revision、initial execute+parse、classification+eligibility、单次 TestBug repair、final/effective Result、retrospective 和 outcome gate。三条可选分支由 fail-closed `runIf` 控制,不通过动态子节点隐藏数量;所有原有 contracts/JUnit/Result/traceability/repair safety artifacts 继续保留。`knowledge-sync` 与 `knowledge-graph-bootstrap` 继续通过各自显式 taskKind 选择知识回写/图谱开荒 DAG。治理等级仍由 `minimal|standard|reviewed|supervised` 推断。
|
|
22
25
|
|
|
23
26
|
### DAG workflow 层级
|
|
24
27
|
|