@tea-agent/loop-agent 0.16.22 → 0.16.24
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 +28 -11
- package/dist/executors/shell-presets.js +27 -26
- package/dist/executors/shell-verification.js +2 -0
- package/dist/task/config-types.js +15 -3
- package/dist/workflows/dag/backend-test-analysis-contract.js +21 -8
- package/dist/workflows/dag/backend-test-contract-envelope.js +40 -2
- package/dist/workflows/dag/dynamic-runtime/map.js +129 -22
- package/dist/workflows/dag/init-hybrid.js +328 -259
- package/dist/workflows/dag/runner.js +5 -0
- package/dist/workflows/dag/types.js +7 -0
- package/docs/local-development-environment.md +4 -0
- package/docs/templates/backend-test-dag.json +1 -1
- package/docs/templates/frontend-test-case-checklist.md +25 -0
- package/docs/templates/frontend-test-dag.json +4 -3
- package/package.json +1 -1
|
@@ -469,6 +469,11 @@ async function executeDagCheckpoint(input) {
|
|
|
469
469
|
}
|
|
470
470
|
break;
|
|
471
471
|
}
|
|
472
|
+
// Stop heartbeats before terminal archive. A late heartbeat writing
|
|
473
|
+
// state.json under completed/ trips the completed-facts write guard and
|
|
474
|
+
// makes run-dag exit non-zero after every node already finished.
|
|
475
|
+
clearInterval(heartbeatTimer);
|
|
476
|
+
await stateWriteQueue;
|
|
472
477
|
state.finishedAt = new Date().toISOString();
|
|
473
478
|
const runDirBeforeTransfer = runDir;
|
|
474
479
|
await writeBudgetLedgerArtifacts(runDir, state.budgetLedger);
|
|
@@ -201,6 +201,13 @@ export const dagDynamicExpansionSchema = z.object({
|
|
|
201
201
|
maxTotalTokens: z.number().int().positive().optional(),
|
|
202
202
|
})
|
|
203
203
|
.optional(),
|
|
204
|
+
/**
|
|
205
|
+
* When true, map child ERROR/auth/timeout is recorded as case-level
|
|
206
|
+
* failed/blocked evidence and the map barrier still succeeds (frontend-test).
|
|
207
|
+
* Default false: any non-budget child failure fails the map aggregate
|
|
208
|
+
* (sharded migration and other map_agent workflows).
|
|
209
|
+
*/
|
|
210
|
+
tolerateChildFailures: z.boolean().optional(),
|
|
204
211
|
});
|
|
205
212
|
export const dagDynamicReductionSchema = z.object({
|
|
206
213
|
type: z.literal("verified_findings_report"),
|
|
@@ -45,6 +45,10 @@ git config commit.gpgsign false
|
|
|
45
45
|
|
|
46
46
|
该设置只用于本地开发和测试稳定性,不应写入仓库代码、模板或发布包配置。
|
|
47
47
|
|
|
48
|
+
## Windows clean Shell 与用户级 Python
|
|
49
|
+
|
|
50
|
+
DAG Shell/verification 默认使用安全的 clean environment,不继承完整宿主环境。在 Windows 上,clean baseline 会保留 `APPDATA`,使 Python/pip 能按标准规则定位 `%APPDATA%/Python/PythonXY/site-packages` 中的用户级安装,同时 token、credential 与其他未授权变量仍被过滤。不要在仓库中硬编码用户目录、盘符、Python 版本或 `site-packages` 路径;业务环境变量仍应通过任务/DAG 的显式 `envAllowlist` 授权。
|
|
51
|
+
|
|
48
52
|
## 维护规则
|
|
49
53
|
|
|
50
54
|
- 仅把可复现、会反复影响开发或验证的环境问题写入本文。
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"artifacts/**"
|
|
91
91
|
],
|
|
92
92
|
"outputContract": "Pure JSON envelope {analysis: Backend Test Analysis v2, execution: Backend Test Execution Contract v1}; no prose or writes.",
|
|
93
|
-
"subtask_prompt": "Read the task source materials and return exactly one JSON object matching Backend Test Analysis v2.\n\nDo not wrap it in explanatory prose. A single fenced json block is tolerated, but pure JSON is preferred.\n\nCopy the sourceBinding object exactly from the JSON block below; do not infer, add, remove, or reclassify source paths.\n\nOnly kind=reference sources belong in referencePaths; kind=constraint sources MUST NOT be included in referencePaths.\n\n## Exact Backend Test Analysis sourceBinding JSON\n\n{\n \"taskId\": \"backend-test-template\",\n \"requirementPath\": \"source/需求.md\",\n \"requirementSha256\": \"e33ab9d1d3d6a785b8f429d8581d015a299adc093b0c9a7c0f9057f968a71837\",\n \"referencePaths\": [],\n \"requirementIds\": [\n \"AC-001\"\n ]\n}\n\nFor every endpoint, explicitly set responseBody.kind=array|object|scalar|empty|unknown and ordering=specified|unspecified|not-applicable. Add itemSchemaRef for arrays when documented.\n\nFor response fields, use comparison=exact|parseable-only|semantic when the source defines assertion semantics; date-time fields whose precision is unspecified should use parseable-only, not string equality.\n\nEndpoint sourceRefs and field sourceRefs must cite only requirement/reference evidence actually read. Empty sourceRefs are allowed only when normalizing legacy v1 input; newly generated v2 should cite evidence.\n\nUse empty arrays for categories not documented. Never include credentials, tokens, private keys, or secret values.\n\nRequired top-level keys: schemaVersion=2, sourceBinding, acceptanceCriteria, endpoints, dataModels, businessRules, stateTransitions, boundaryConstraints, externalDependencies, risks, evidenceGaps.\n\nRead-only: do not modify code, docs, artifacts, or repository files.\n\n## Task source: 需求.md\n\n# Backend test\n- AC-001 proof\n\n## Task config summary\n\n- taskId: backend-test-template\n\n- flow: auto\n\n- complexity: medium\n\n- contextProfile: full\n\n- allowedPaths: testcase/**, docs/test-reports/**\n\n- forbiddenPaths: (none)\n\n- Pi DAG nodes are read-only unless toolProfile=\"write\" is explicitly selected for a bounded writer node.\n\n- Agent DAG read-only nodes must not write root artifacts/**; root artifacts/ is not a per-node scratchpad.\n\n- source/references/* are immutable user/source facts; source/需求.md is the derived execution contract.\n\nAlso perform the read-only environment discovery described by Backend Test Execution Contract v1. Return exactly one JSON envelope with top-level keys analysis and execution; analysis must satisfy v2 and execution must satisfy v1.",
|
|
93
|
+
"subtask_prompt": "Read the task source materials and return exactly one JSON object matching Backend Test Analysis v2.\n\nDo not wrap it in explanatory prose. A single fenced json block is tolerated, but pure JSON is preferred.\n\nCopy the sourceBinding object exactly from the JSON block below; do not infer, add, remove, or reclassify source paths.\n\nOnly kind=reference sources belong in referencePaths; kind=constraint sources MUST NOT be included in referencePaths.\n\n## Exact Backend Test Analysis sourceBinding JSON\n\n{\n \"taskId\": \"backend-test-template\",\n \"requirementPath\": \"source/需求.md\",\n \"requirementSha256\": \"e33ab9d1d3d6a785b8f429d8581d015a299adc093b0c9a7c0f9057f968a71837\",\n \"referencePaths\": [],\n \"requirementIds\": [\n \"AC-001\"\n ]\n}\n\nFor every endpoint, explicitly set responseBody.kind=array|object|scalar|empty|unknown and ordering=specified|unspecified|not-applicable. Add itemSchemaRef for arrays when documented.\n\nFor response fields, use comparison=exact|parseable-only|semantic when the source defines assertion semantics; date-time fields whose precision is unspecified should use parseable-only, not string equality.\n\nEndpoint sourceRefs and field sourceRefs must cite only requirement/reference evidence actually read. Empty sourceRefs are allowed only when normalizing legacy v1 input; newly generated v2 should cite evidence.\n\nFor externalDependencies and risks, emit canonical items with exactly description plus optional name and sourceRef. For a dependency target, put the target value in name. Do not emit type, target, kind, required, severity, mitigation, level, impact, sourceRefs, or custom keys in newly generated v2 output.\n\nUse empty arrays for categories not documented. Never include credentials, tokens, private keys, or secret values.\n\nRequired top-level keys: schemaVersion=2, sourceBinding, acceptanceCriteria, endpoints, dataModels, businessRules, stateTransitions, boundaryConstraints, externalDependencies, risks, evidenceGaps.\n\nRead-only: do not modify code, docs, artifacts, or repository files.\n\n## Task source: 需求.md\n\n# Backend test\n- AC-001 proof\n\n## Task config summary\n\n- taskId: backend-test-template\n\n- flow: auto\n\n- complexity: medium\n\n- contextProfile: full\n\n- allowedPaths: testcase/**, docs/test-reports/**\n\n- forbiddenPaths: (none)\n\n- Pi DAG nodes are read-only unless toolProfile=\"write\" is explicitly selected for a bounded writer node.\n\n- Agent DAG read-only nodes must not write root artifacts/**; root artifacts/ is not a per-node scratchpad.\n\n- source/references/* are immutable user/source facts; source/需求.md is the derived execution contract.\n\nAlso perform the read-only environment discovery described by Backend Test Execution Contract v1. Return exactly one JSON envelope with top-level keys analysis and execution; analysis must satisfy v2 and execution must satisfy v1.",
|
|
94
94
|
"retryPolicy": {
|
|
95
95
|
"maxAttempts": 3,
|
|
96
96
|
"backoff": "exponential",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Frontend-test case blocking checklist
|
|
2
|
+
|
|
3
|
+
Shared mechanical rules for `frontend-case-checklist-shell` and generate prompts.
|
|
4
|
+
LLM review (when `frontendTest.reviewMode=blocking`) must not invent blocking rules outside this list.
|
|
5
|
+
|
|
6
|
+
## Blocking (fail closed)
|
|
7
|
+
|
|
8
|
+
| ruleId | Rule |
|
|
9
|
+
|---|---|
|
|
10
|
+
| `open-prefix` | Each case body includes `playwright-cli open --browser=chrome --headed <absolute-http(s)-url>` |
|
|
11
|
+
| `production-url` | Open URL must not look like a production host |
|
|
12
|
+
| `ac-mapping` | Manifest entry has non-empty `acIds` |
|
|
13
|
+
| `case-file-missing` | `casePath` exists |
|
|
14
|
+
| `no-test-source` | Case text must not introduce pytest / Playwright test source (`pytest`, `playwright.test`, `@playwright/test`) |
|
|
15
|
+
|
|
16
|
+
## Non-blocking (notes only)
|
|
17
|
+
|
|
18
|
+
- Preferred extra evidence filenames not required by generate
|
|
19
|
+
- Style / wording preferences
|
|
20
|
+
- Additional network envelope proofs beyond capability matrix
|
|
21
|
+
|
|
22
|
+
## Pipeline vs quality
|
|
23
|
+
|
|
24
|
+
- **Pipeline acceptance**: final `testcase/frontend/reports/frontend-test-retrospect-*.md` exists after result materialize
|
|
25
|
+
- **Quality**: `frontend-test-result-v1.outcome=passed` with 0 blocked/failed (opt-in via `frontendTest.strictOutcomeGate`)
|
|
@@ -7,14 +7,15 @@
|
|
|
7
7
|
"agentRuntime": "pi-only",
|
|
8
8
|
"repairWriterProtocol": "explicit-node-v1"
|
|
9
9
|
},
|
|
10
|
-
"objective": "Build a frontend test RAG package, generate Markdown cases, execute each case serially through playwright-cli, and
|
|
10
|
+
"objective": "Build a frontend test RAG package, generate Markdown cases, mechanically checklist them (LLM review optional), execute each case serially through playwright-cli, materialize frontend-test-result-v1, and write retrospect report (pipeline acceptance).",
|
|
11
11
|
"globalConstraints": [
|
|
12
12
|
"Do not generate pytest or Playwright source code.",
|
|
13
13
|
"Only use declared isolated test environments; production URLs and real credentials are blocked.",
|
|
14
14
|
"Every generated browser start command is playwright-cli open --browser=chrome --headed <resolved-base-url> (from task source config.md when present, else http://localhost:5173); subsequent commands stay in that default session and must not use unverified named-session flags.",
|
|
15
|
-
"A frontend case review must emit VERDICT: pass before manifest materialization; request-revision blocks browser execution.",
|
|
16
15
|
"Case children execute serially. Persist each case result, logs and browser evidence before the next child starts.",
|
|
17
|
-
"A token threshold is a post-case stop check, not a model hard token cap; unstarted cases must be recorded as blocked: token-budget-exhausted."
|
|
16
|
+
"A token threshold is a post-case stop check, not a model hard token cap; unstarted cases must be recorded as blocked: token-budget-exhausted.",
|
|
17
|
+
"Default pipeline acceptance is the final retrospect report under testcase/frontend/reports/; case full green is optional quality (frontendTest.strictOutcomeGate).",
|
|
18
|
+
"Default frontendTest.reviewMode=off uses mechanical checklist-shell before materialize; set reviewMode=blocking for legacy dual LLM review gate."
|
|
18
19
|
],
|
|
19
20
|
"tasks": [
|
|
20
21
|
{
|