@tea-agent/loop-agent 0.29.2 → 0.30.0
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 +56 -24
- package/bin/agent-worker.js +0 -0
- package/dist/commands/client-recovery.js +2 -10
- package/dist/commands/init.js +1 -1
- package/dist/executors/dag-pi-executor.js +15 -4
- package/dist/executors/pi-executor.js +5 -3
- package/dist/executors/pi-playwright-cli-tool.js +9 -14
- package/dist/executors/pi-sdk-executor.js +16 -0
- package/dist/shared/operator/capabilities.js +9 -9
- package/dist/shared/pi-retry-settings.js +23 -0
- package/dist/worker/console/chat/pi-runtime.js +167 -41
- package/dist/worker/console/chat/routes.js +21 -2
- package/dist/worker/console/chat/runtime-context.js +50 -8
- package/dist/worker/console/chat/tool-preview.js +90 -0
- package/dist/worker/console/chat/turn-process.js +178 -0
- package/dist/worker/console/chat/usage.js +144 -16
- package/dist/worker/console/night-aux-ticker.js +141 -0
- package/dist/worker/console/operation-runner.js +21 -4
- package/dist/worker/console/operator-user-error.js +12 -0
- package/dist/worker/console/recovery-cta.js +6 -6
- package/dist/worker/console/routes.js +61 -0
- package/dist/worker/console/server.js +7 -0
- package/dist/worker/console/static/assets/index-D9gnJn_l.js +29 -0
- package/dist/worker/console/static/assets/index-rajoXwkM.css +1 -0
- package/dist/worker/console/static/index.html +2 -2
- package/dist/worker/console/static-src/night-prepare-result.js +118 -0
- package/dist/worker/scheduler/clock-install/win32-schtasks.js +70 -15
- package/dist/workflows/dag/backend-test-writer-completeness.js +398 -26
- package/dist/workflows/dag/dynamic-runtime/map.js +10 -4
- package/dist/workflows/dag/frontend-test-case-checklist.js +3 -3
- package/dist/workflows/dag/init-hybrid.js +247 -239
- package/dist/workflows/dag/node-execution.js +13 -2
- package/dist/workflows/dag/types.js +21 -7
- package/docs/templates/backend-test-dag.json +664 -460
- package/docs/templates/frontend-test-case-checklist.md +1 -1
- package/docs/templates/frontend-test-dag.generate-cases.prompt.md +1 -1
- package/docs/templates/frontend-test-dag.json +1 -1
- package/docs/templates/frontend-test-dag.retrieve-context.prompt.md +1 -1
- package/docs/templates/frontend-test-dag.review-cases.prompt.md +1 -1
- package/docs/templates/init-managed-agents.md +6 -3
- package/harness.json +2 -2
- package/package.json +1 -1
- package/skills/playwright-cli/SKILL.md +1 -1
- package/skills/playwright-cli-case-generator/SKILL.md +1 -1
- package/dist/worker/console/static/assets/index-Cwx-ZVEQ.js +0 -29
- package/dist/worker/console/static/assets/index-Yyn3ynVv.css +0 -1
|
@@ -1,462 +1,666 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
"subtask_prompt": "This is a required file-generation node. After reading the bounded inputs, immediately use write/edit tools to create testcase/md/README.md and the module Markdown files. Do not end after analysis or planning, and do not return before a non-empty bounded diff exists.\n\nOutput budget protocol (hard, max output <=16K per turn): Never paste full Matrix, case bodies, or source text into assistant chat. Each write/edit tool call touches at most one file. Order: README.md (Scope+Matrix+module index only) → one module file per turn → short IMPLEMENTATION_OUTCOME. Splitting modules preserves every in-scope rule/TP; it must not drop coverage. Compact tables/lists are required; omitting required sections or in-scope variants is forbidden. If a Completeness Gate / OUTPUT_LIMIT_RECOVERY retry is injected, continue only listed target paths.\n\nThe first non-empty response line must be exactly IMPLEMENTATION_OUTCOME: changed after the required files have been written, or IMPLEMENTATION_OUTCOME: blocked when precise missing evidence prevents safe generation. already-satisfied is not valid for this node.\n\nRead the upstream environment report. Generate a Markdown-first backend test strategy and cases under testcase/md/**.\n\nWrite human-readable content in Simplified Chinese by default. Keep English only for machine-readable IDs and technical literals such as Case/AC/REQ/BR IDs, HTTP methods, paths, field names, enum values, commands, filenames, code symbols and exact source citations.\n\nCreate testcase/md/README.md as the concise entry page: test objective, target/environment, isolation/cleanup, module summary and a linked case index table with Case ID, Chinese case name, scenario type, endpoint and expected status/result. Avoid repeating every case body in README.\n\nBefore the Coverage Matrix, write a mandatory machine-readable `## Coverage Scope` section in README using exactly `| Field | Value |`, immediately followed by the separator row `|---|---|`, and these six unique rows: `Change Classification`, `Coverage Policy`, `Affected Operations`, `Affected Rule Keys`, `Regression Floor`, `Scope Evidence`. Classify from authoritative task/reference evidence, not merely whether a route already exists. Use only these pairs: `new-operation` → `full-contract`; `contract-change` → `affected-contract-full`; `behavior-change` → `affected-behavior-full`; `bugfix` → `reproduction-plus-neighbors`; `implementation-optimization` → `change-focused-plus-regression-floor`. List affected operations exactly as `METHOD /path`, stable rule keys separated by semicolons, and precise source pointers as Scope Evidence.\n\nCoverage depth follows the declared change scope. For `new-operation`, fully cover every documented status, request/response field rule, requiredness, enum, boundary, format, auth and business state of each affected new operation, but do not re-test unrelated existing operations. For contract/behavior changes, fully cover the changed contract or behavior and its directly affected operations. For bugfix, cover exact reproduction, adjacent boundary/equivalence cases and a normal path. For `implementation-optimization`, cover explicit ACs, deterministic affected operations and a minimum regression floor; do not exhaustively regenerate unrelated POST/PUT/GET/DELETE rules. Every non-new classification must include `main-success-path` and `unchanged-response-shape`; contract changes also include `changed-contract-boundaries`, behavior changes `affected-state-transition`, and bugfixes `defect-reproduction` plus `adjacent-boundary`. Inspect shared validator/helper/DTO/query builder evidence and expand Affected Operations when the same changed path can affect them; unresolved impact stays visible as GAP/CONFLICT.\n\nBefore writing cases, build the mandatory machine-readable Coverage Matrix inside `testcase/md/README.md` itself. Its section heading line must be exactly `## Coverage Matrix` with no numeric prefix/suffix; never place the canonical Matrix only in a module file. Use this exact header: `| Rule Key | Priority | Source | Endpoint/Field | Dimension | Rule | Required Test Points | Case IDs | Status |`. Every data row must contain exactly 9 pipe-delimited cells and must never omit `Dimension`; use concise dimensions such as requirement, operation, response-status, requiredness, enum, boundary, format, business-state or error. Use only P0/P1/P2 and COVERED/PARTIAL/GAP/CONFLICT. Use stable `TP-<UPPERCASE-HYPHENATED-ID>` test points separated by semicolons.\n\nEach Rule Key must appear in exactly one Matrix row. Preserve each AC/REQ/BR Rule Key as one row; if one product rule spans multiple dimensions, use a concise composite Dimension in that single row instead of duplicating the key. Derive OpenAPI Rule Keys exactly as the deterministic analyzer does: operation token is `<HTTP-METHOD>-<PATH>` with braces removed and every non-alphanumeric run replaced by a hyphen, uppercase (for example POST `/api/resource-notes` → `POST-API-RESOURCE-NOTES`); response statuses use `API-<OPERATION>-RESPONSE-STATUS`; body/parameter fields use `API-<OPERATION>-<FIELD>-REQUIRED|ENUM|MIN-LENGTH|MAX-LENGTH|MINIMUM|MAXIMUM|PATTERN|FORMAT`. Do not invent aliases such as API-CREATE-FIELDS when a deterministic key applies.\n\nCoverage priority is strict inside the declared scope: P0 product requirements/task hard constraints always remain in scope; P1 exhaustively supplements documented operations, fields, business rules, statuses and errors only for Affected Operations; P2 adds bounded protocol robustness only when it is relevant to the change and does not invent product behavior. Coverage percentages describe the declared affected scope, never whole-API completeness unless every operation is explicitly listed. Conflicts or undefined expectations must stay visible as GAP/CONFLICT with precise source pointers, never guessed.\n\nFor uniqueness/lifecycle rules cover absent, active-existing, deleted-existing, create-delete-recreate, restore-then-recreate and documented scope/case-normalization states. For every enum cover every valid value plus bounded invalid equivalence classes (unknown, case variant, whitespace, empty, null/missing and wrong types as applicable). For every length/number rule cover min-1, min, nominal, max and max+1. For format rules cover each allowed class separately plus a valid mixed value, and representative forbidden classes including uppercase, internal/leading/trailing whitespace, tab/newline, unsupported punctuation, slash, emoji or control characters when the source contract supports that expectation.\n\nWrite each module as readable case cards. Every case starts with `## BE-<MODULE>-<NNN>|<中文用例名称>`. `<NNN>` is exactly three zero-padded digits (`001`, `002`, ...), never two digits (`01`), a bare number, or an alphabetic suffix such as `011A`. Every case must include `### 覆盖规则`, `### 测试点`, `### 场景类型`, `### 前置条件`, `### 操作步骤`, `### 预期结果`, and `### 自动化映射`; `覆盖规则` and `测试点` must reference exact Matrix Rule Keys/Test Points. Add `测试目的`, `验收标准`, `需求依据`, and `测试数据` for readable evidence. The `验收标准` section must list the exact applicable `AC-...` IDs, and every explicit task AC must appear in at least one Case. Every automatable case explicitly names its target pytest script and exactly one primary symbol so traceability scans only that script/symbol.\n\nName each module file with a stable lowercase business stem such as `testcase/md/health.md` or `testcase/md/resource_notes.md`. Do not use Case-ID-like module filenames such as `BE-HEALTH.md` or `BE-NOTES.md`. For every automatable case, `自动化映射` must name exactly `testcase/test_<module>.py`, where <module> is that Markdown filename without `.md`, lowercased, with non-alphanumeric characters replaced by underscores. Example: `testcase/md/health.md` → `testcase/test_health.py`; `testcase/md/resource_notes.md` → `testcase/test_resource_notes.py`. Never invent a different pytest path in Markdown than the module stem implies.\n\nEvery Case must keep at least one numbered executable line under `### 操作步骤`; a compact variant/result table may follow but must not replace the numbered action anchor. Keep numbered/bulleted independently assertable results under `### 预期结果`. The exact `### 操作步骤` and `### 预期结果` headings must remain present for every Case, including compact/table-based Cases; never compress later Cases by dropping required headings. Every result must name the observable HTTP status, response field/value, state transition or membership condition, never vague wording such as ‘符合预期’.\n\nIn every `自动化映射`, use exactly these machine-readable list labels: `脚本`, `primary symbol`, `变体测试点`, `场景断言测试点`, `横切证据测试点`. Each Test Point from `### 测试点` must appear in exactly one binding list, and every Test Point named in any binding list must also be declared in that Case's `### 测试点`; write `无` for an empty list. A variant Test Point is atomic: one exact endpoint/input/precondition/outcome row equals one exact pytest item and one exact TP ID. If a parameter table has five rows, declare five distinct variant TP IDs in Markdown; never declare one family TP and append row suffixes only in pytest. Classify as `variant` only when endpoint, request input, precondition business state, or expected outcome genuinely changes and therefore needs an independent pytest parameter item. Classify CRUD checkpoints, status/body/header/schema assertions and multiple checks over the same response/journey as `assertion`; classify shared HTTP logging/redaction/truncation evidence as `cross-cutting`. Never create a Test Point merely to parameterize a checkpoint. Every non-cross-cutting TP ID is owned by exactly one Case; when the same response/schema/error assertion is needed in different Cases, use distinct Case-specific TP IDs instead of reusing one assertion TP across Cases. Keep the script path identical to the module one-to-one path and declare exactly one primary symbol named with the canonical Case prefix, for example `BE-RN-003` → `test_BE_RN_003_<description>`; non-Case-prefixed primary symbols are forbidden because parameterized item association must remain deterministic. For redaction scenarios, list sensitive header/field key names only. Never write any header-name-and-value pair, credential placeholder, fake token, anti-example, or other secret-shaped literal in Markdown; state only that a test-only value is supplied at runtime and omitted. Put implementation-only restrictions in a concise `<details>` block rather than dominating the main case flow. Before finalizing Markdown, calculate the predicted collected-item count as `sum(max(1, number of variant Test Points in each Case))`. If the task declares an item budget, the prediction must not exceed it. Reduce excess only by removing duplicate execution and converting same-request checkpoints to assertions; never drop required rules, boundaries, enums, operation-specific inputs, or business states. Record the prediction in README. Use only environment-supported fixtures/targets/isolation, record evidence gaps in Chinese, and do not emit JSON, pytest, or execute commands.\n\n## Derived task contract: 需求.md\n\n# Backend test\n- AC-001 proof\n\n## Authoritative reference index\n\n[]\n\nFor each index entry, use `readPath` for Pi read-tool calls and copy `path` exactly into Markdown Source References. Bound files under .harness/tasks/<taskId>/source/** are read-only inputs: reading them is allowed even though writing .harness/** is forbidden. Never resolve `path` relative to the repository root, search for substitutes, or fall back to docs/** when a bound read fails.\n\nRead only precise indexed references needed for AC/API/field/rule evidence; references remain authoritative over derived text."
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
2
|
+
"version": 4,
|
|
3
|
+
"title": "Backend test DAG: Backend test template",
|
|
4
|
+
"runtimeContract": {
|
|
5
|
+
"schemaVersion": 1,
|
|
6
|
+
"agentRuntime": "pi-only",
|
|
7
|
+
"repairWriterProtocol": "explicit-node-v1"
|
|
8
|
+
},
|
|
9
|
+
"outputLanguage": "zh-CN",
|
|
10
|
+
"objective": "- AC-001 proof",
|
|
11
|
+
"successCriteria": [
|
|
12
|
+
"contract-pi produces an auditable read-only implementation contract for backend-test-template",
|
|
13
|
+
"scout-src and scout-tests complete parallel read-only reconnaissance without file writes",
|
|
14
|
+
"plan-pi returns a read-only implementation plan aligned with constraints",
|
|
15
|
+
"the implementation writer changes only paths declared in writeSet",
|
|
16
|
+
"verify-pi returns read-only verification strategy and residual risks",
|
|
17
|
+
"closeout-pi returns read-only handoff summary without writing artifacts/docs"
|
|
18
|
+
],
|
|
19
|
+
"globalConstraints": [
|
|
20
|
+
"Do not commit runtime traces under .harness/dag-runs/",
|
|
21
|
+
"Do not enable cross-node Pi runtime reuse by default",
|
|
22
|
+
"Preserve CODE_AGENT_PI_BACKEND=cli-only rollback for Pi nodes",
|
|
23
|
+
"Same-rank exclusive writeSet entries must be disjoint",
|
|
24
|
+
"Every task must explicitly declare executor; defaults.executor is schema-only and not a runtime fallback",
|
|
25
|
+
"Prefer same-rank parallel read-only scouts over serial chains when outputs are independent",
|
|
26
|
+
"If the DAG is a single linear chain, challenge whether read-only work can run in parallel ranks",
|
|
27
|
+
"Read-only DAG nodes must not write repository files, including root artifacts/**; return findings in node output only",
|
|
28
|
+
"Root artifacts/ is reserved for explicit exclusive write nodes, not read-only scout/reviewer output",
|
|
29
|
+
"exclusive implementer nodes must use narrow, concrete writeSet paths; never keep ** or repo root",
|
|
30
|
+
"Replace REPLACE/WITH/NARROW/IMPLEMENT/PATHS/** with concrete paths before executing the implementation writer",
|
|
31
|
+
"backend-test-dag uses exactly 16 real top-level tasks: Markdown cases are sharded via a README plan + manifest shell + map_agent barrier (one child per module, each with its own 16K Pi budget), and pytest is likewise sharded via a shared-asset plan + manifest shell + map_agent barrier. Pytest collection runs once on the green path and at most twice only when one bounded pre-execution repair is eligible; business pytest test bodies execute exactly once over safe scripts explicitly mapped by final Markdown cases.",
|
|
32
|
+
"Model nodes produce Markdown and pytest assets, never backend-test business JSON envelopes.",
|
|
33
|
+
"Environment, advisory Markdown validation/coverage, collection initial/effective facts, advisory traceability/correspondence, pre-execution scenario-param consistency (with at most one deterministic param repair), canonical manifest, pytest-html, HTML, failure-analysis and execution facts are deterministic evidence. Node 6 quality findings stay advisory; nodes 10/12 form the fail-closed collection authorization; node 13 traceability/scenario-param findings stay advisory by default; node 14 partial/unavailable manifest does not block node 15 when effective collection remains fresh.",
|
|
34
|
+
"Only Markdown case generation/review may read source facts; pytest generation must not read source/**.",
|
|
35
|
+
"Functional case IDs use canonical BE-<MODULE>-<NNN> with exactly three digits and no alphabetic suffix. Every Test Point has exactly one variant/assertion/cross-cutting binding; only variant bindings create pytest parameter items. Production code/config, skip/xfail, execution-result repair and business pytest rerun are forbidden; pre-execution repairs are limited to one collection-proven generated-test asset repair and one scenario-param payload repair (deterministic preferred).",
|
|
36
|
+
"Writer nodes must obey multi-file output-budget protocol under 16K max tokens: one file per write/edit, no chat dumps; Completeness Gate may trigger bounded incomplete-write-set recovery without lowering coverage quality."
|
|
37
|
+
],
|
|
38
|
+
"defaults": {
|
|
39
|
+
"executor": "pi",
|
|
40
|
+
"piBackend": "sdk-first",
|
|
41
|
+
"contextProfile": "full",
|
|
42
|
+
"skills": [
|
|
43
|
+
"ai-engineering-context"
|
|
44
|
+
],
|
|
45
|
+
"writePolicy": "read-only"
|
|
46
|
+
},
|
|
47
|
+
"skillsByRole": {
|
|
48
|
+
"planner": [
|
|
49
|
+
"loop-agent"
|
|
50
|
+
],
|
|
51
|
+
"scout": [],
|
|
52
|
+
"implementer": [
|
|
53
|
+
"test-driven-development",
|
|
54
|
+
"verification-before-completion"
|
|
55
|
+
],
|
|
56
|
+
"reviewer": [
|
|
57
|
+
"requesting-code-review",
|
|
58
|
+
"code-review-core"
|
|
59
|
+
],
|
|
60
|
+
"verifier": [
|
|
61
|
+
"verification-before-completion",
|
|
62
|
+
"systematic-debugging"
|
|
63
|
+
],
|
|
64
|
+
"closeout": [
|
|
65
|
+
"loop-agent",
|
|
66
|
+
"verification-before-completion"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"executorModels": {
|
|
70
|
+
"pi": {
|
|
71
|
+
"LOW": "gpt-5.3-codex-spark",
|
|
72
|
+
"MED": "gpt-5.5",
|
|
73
|
+
"HIGH": "gpt-5.5"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"tasks": [
|
|
77
|
+
{
|
|
78
|
+
"id": "validate-backend-test-environment-shell",
|
|
79
|
+
"depends_on": [],
|
|
80
|
+
"role": "verifier",
|
|
81
|
+
"executor": "shell",
|
|
82
|
+
"complexity": "LOW",
|
|
83
|
+
"writePolicy": "read-only",
|
|
84
|
+
"allowedPaths": [
|
|
85
|
+
"testcase/**",
|
|
86
|
+
"docs/test-reports/**"
|
|
87
|
+
],
|
|
88
|
+
"forbiddenPaths": [
|
|
89
|
+
".harness/**",
|
|
90
|
+
".harness/dag-runs/**",
|
|
91
|
+
"artifacts/**"
|
|
92
|
+
],
|
|
93
|
+
"outputContract": "Run-owned reports/backend-test-environment.md with PASS/FAIL runtime, bounded project discovery, fixture and HTML-renderer facts; no secret values.",
|
|
94
|
+
"subtask_prompt": "Fail fast before model work when Python/pytest cannot run in the clean shell. Inspect only bounded common config, conftest, test-root and server-entry candidates; never read .env values or credentials.",
|
|
95
|
+
"shell": {
|
|
96
|
+
"commands": [
|
|
97
|
+
"python --version",
|
|
98
|
+
"python -m pytest --version",
|
|
99
|
+
"python -m pytest --help"
|
|
100
|
+
],
|
|
101
|
+
"backendTestPipeline": "markdown-environment",
|
|
102
|
+
"cwd": ".",
|
|
103
|
+
"timeoutMs": 60000,
|
|
104
|
+
"envAllowlist": []
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "generate-backend-md-plan-pi",
|
|
109
|
+
"depends_on": [
|
|
110
|
+
"validate-backend-test-environment-shell"
|
|
111
|
+
],
|
|
112
|
+
"role": "implementer",
|
|
113
|
+
"executor": "pi",
|
|
114
|
+
"toolProfile": "write",
|
|
115
|
+
"complexity": "MED",
|
|
116
|
+
"writePolicy": "exclusive",
|
|
117
|
+
"writeSet": [
|
|
118
|
+
"testcase/md/README.md"
|
|
119
|
+
],
|
|
120
|
+
"allowedPaths": [
|
|
121
|
+
"testcase/md/README.md"
|
|
122
|
+
],
|
|
123
|
+
"forbiddenPaths": [
|
|
124
|
+
".harness/**",
|
|
125
|
+
".harness/dag-runs/**",
|
|
126
|
+
"artifacts/**"
|
|
127
|
+
],
|
|
128
|
+
"writerOutcomePolicy": {
|
|
129
|
+
"type": "implementation-outcome-v1",
|
|
130
|
+
"requireChangedFiles": true
|
|
131
|
+
},
|
|
132
|
+
"retryPolicy": {
|
|
133
|
+
"maxAttempts": 3,
|
|
134
|
+
"backoff": "exponential",
|
|
135
|
+
"initialDelayMs": 2000,
|
|
136
|
+
"maxDelayMs": 30000,
|
|
137
|
+
"retryCategories": [
|
|
138
|
+
"writer-empty-diff",
|
|
139
|
+
"incomplete-write-set"
|
|
140
|
+
]
|
|
141
|
+
},
|
|
142
|
+
"outputContract": "Write a Chinese, human-readable testcase/md/README.md as the single Markdown-first entry page with Coverage Scope, Coverage Matrix and a machine-parseable module index. Do not write module case cards here; do not execute pytest or modify production code/config.",
|
|
143
|
+
"subtask_prompt": "This is a required file-generation node. After reading the bounded inputs, immediately use write tools to create testcase/md/README.md. Do not end after analysis or planning, and do not return before a non-empty bounded diff exists. Write ONLY testcase/md/README.md in this node; module case cards are written by downstream sharded nodes.\n\nOutput budget protocol (hard, max output <=16K per turn): Never paste full Matrix, case bodies, or source text into assistant chat. README holds only Scope+Matrix+module index; never inline full case bodies. If a Completeness Gate / OUTPUT_LIMIT_RECOVERY retry is injected, continue only listed target paths.\n\nThe first non-empty response line must be exactly IMPLEMENTATION_OUTCOME: changed after the README has been written, or IMPLEMENTATION_OUTCOME: blocked when precise missing evidence prevents safe generation. already-satisfied is not valid for this node.\n\nRead the upstream environment report. Generate the Markdown-first backend test README under testcase/md/README.md.\n\nWrite human-readable content in Simplified Chinese by default. Keep English only for machine-readable IDs and technical literals such as Case/AC/REQ/BR IDs, HTTP methods, paths, field names, enum values, commands, filenames, code symbols and exact source citations.\n\nCreate testcase/md/README.md as the concise entry page: test objective, target/environment, isolation/cleanup, module summary and a linked case index table with Case ID, Chinese case name, scenario type, endpoint and expected status/result. Avoid repeating every case body in README.\n\nBefore the Coverage Matrix, write a mandatory machine-readable `## Coverage Scope` section in README using exactly `| Field | Value |`, immediately followed by the separator row `|---|---|`, and these six unique rows: `Change Classification`, `Coverage Policy`, `Affected Operations`, `Affected Rule Keys`, `Regression Floor`, `Scope Evidence`. Always set `Change Classification` to `new-operation` and `Coverage Policy` to `full-contract`; do NOT reason about whether operations are new or existing. Cover all in-scope rules from the requirement document at full depth; treat the product requirement as the coverage baseline and use API contract evidence (fields/status/enum/boundary/format) to supplement scenario dimensions. Scope is limited to operations/rules the requirement document (or its referenced API contract) explicitly describes; do not expand to unrelated operations that the requirement does not mention. List affected operations exactly as `METHOD /path`, stable rule keys separated by semicolons, and precise source pointers as Scope Evidence.\n\nCoverage depth is full over the in-scope rules: fully cover every documented status, request/response field rule, requiredness, enum, boundary, format, auth and business state of each affected operation the requirement describes, but do not re-test unrelated operations the requirement does not mention. Inspect shared validator/helper/DTO/query builder evidence and expand Affected Operations when the same affected path can affect them; unresolved impact stays visible as GAP/CONFLICT.\n\nBefore writing cases, build the mandatory machine-readable Coverage Matrix inside `testcase/md/README.md` itself. Its section heading line must be exactly `## Coverage Matrix` with no numeric prefix/suffix; never place the canonical Matrix only in a module file. Use this exact header: `| Rule Key | Priority | Source | Endpoint/Field | Dimension | Rule | Required Test Points | Case IDs | Status |`. Every data row must contain exactly 9 pipe-delimited cells and must never omit `Dimension`; use concise dimensions such as requirement, operation, response-status, requiredness, enum, boundary, format, business-state or error. Use only P0/P1/P2 and COVERED/PARTIAL/GAP/CONFLICT. Use stable `TP-<UPPERCASE-HYPHENATED-ID>` test points separated by semicolons.\n\nEach Rule Key must appear in exactly one Matrix row. Preserve each AC/REQ/BR Rule Key as one row; if one product rule spans multiple dimensions, use a concise composite Dimension in that single row instead of duplicating the key. Derive OpenAPI Rule Keys exactly as the deterministic analyzer does: operation token is `<HTTP-METHOD>-<PATH>` with braces removed and every non-alphanumeric run replaced by a hyphen, uppercase (for example POST `/api/resource-notes` → `POST-API-RESOURCE-NOTES`); response statuses use `API-<OPERATION>-RESPONSE-STATUS`; body/parameter fields use `API-<OPERATION>-<FIELD>-REQUIRED|ENUM|MIN-LENGTH|MAX-LENGTH|MINIMUM|MAXIMUM|PATTERN|FORMAT`. Do not invent aliases such as API-CREATE-FIELDS when a deterministic key applies.\n\nCoverage priority is strict inside the declared scope: P0 product requirements/task hard constraints always remain in scope; P1 exhaustively supplements documented operations, fields, business rules, statuses and errors only for Affected Operations; P2 adds bounded protocol robustness only when it is relevant to the change and does not invent product behavior. Coverage percentages describe the declared affected scope, never whole-API completeness unless every operation is explicitly listed. Conflicts or undefined expectations must stay visible as GAP/CONFLICT with precise source pointers, never guessed.\n\nFor uniqueness/lifecycle rules cover absent, active-existing, deleted-existing, create-delete-recreate, restore-then-recreate and documented scope/case-normalization states. For every enum cover every valid value plus bounded invalid equivalence classes (unknown, case variant, whitespace, empty, null/missing and wrong types as applicable). For every length/number rule cover min-1, min, nominal, max and max+1. For format rules cover each allowed class separately plus a valid mixed value, and representative forbidden classes including uppercase, internal/leading/trailing whitespace, tab/newline, unsupported punctuation, slash, emoji or control characters when the source contract supports that expectation.\n\nMandatory module index: include a `## Module Index` table in README that lists every planned module as a canonical relative link of the exact form `[label](./<stem>.md)` plus a `testcase/md/<stem>.md` path cell, so a downstream deterministic manifest can parse the module list. Name each module file with a stable lowercase business stem such as `health` or `resource_notes`. Do not use Case-ID-like module filenames such as `BE-HEALTH.md` or `BE-NOTES.md`. The relative link target MUST equal the on-disk filename stem the sharded writer will create. For every automatable case, `自动化映射` must name exactly `testcase/test_<module>.py`, where <module> is that Markdown filename without `.md`, lowercased, with non-alphanumeric characters replaced by underscores. Example: `testcase/md/health.md` → `testcase/test_health.py`; `testcase/md/resource_notes.md` → `testcase/test_resource_notes.py`. Never invent a different pytest path in Markdown than the module stem implies.\n\nBefore finalizing README, calculate the predicted collected-item count as `sum(max(1, number of variant Test Points in each Case))`. If the task declares an item budget, the prediction must not exceed it. Reduce excess only by removing duplicate execution and converting same-request checkpoints to assertions; never drop required rules, boundaries, enums, operation-specific inputs, or business states. Record the prediction in README. Use only environment-supported fixtures/targets/isolation, record evidence gaps in Chinese, and do not emit JSON, pytest, or execute commands.\n\n## Derived task contract: 需求.md\n\n# Backend test\n- AC-001 proof\n\n## Authoritative reference index\n\n[]\n\nFor each index entry, use `readPath` for Pi read-tool calls and copy `path` exactly into Markdown Source References. Bound files under .harness/tasks/<taskId>/source/** are read-only inputs: reading them is allowed even though writing .harness/** is forbidden. Never resolve `path` relative to the repository root, search for substitutes, or fall back to docs/** when a bound read fails.\n\nRead only precise indexed references needed for AC/API/field/rule evidence; references remain authoritative over derived text."
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"id": "materialize-backend-md-module-manifest-shell",
|
|
147
|
+
"depends_on": [
|
|
148
|
+
"generate-backend-md-plan-pi"
|
|
149
|
+
],
|
|
150
|
+
"role": "verifier",
|
|
151
|
+
"executor": "shell",
|
|
152
|
+
"complexity": "LOW",
|
|
153
|
+
"writePolicy": "read-only",
|
|
154
|
+
"allowedPaths": [
|
|
155
|
+
"testcase/**",
|
|
156
|
+
"docs/test-reports/**"
|
|
157
|
+
],
|
|
158
|
+
"forbiddenPaths": [
|
|
159
|
+
".harness/**",
|
|
160
|
+
".harness/dag-runs/**",
|
|
161
|
+
"artifacts/**"
|
|
162
|
+
],
|
|
163
|
+
"outputContract": "Stdout JSON {modules:[{stem}]} parsed from testcase/md/README.md using the same module-stem extractor as the Completeness Gate, so the map_agent shard set deterministically matches the README module index.",
|
|
164
|
+
"subtask_prompt": "Parse testcase/md/README.md and emit exactly one trailing JSON line {modules:[{stem}]} listing every trusted module stem (table-row testcase/md/<stem>.md mentions and canonical [label](./<stem>.md) relative links only). No file writes.",
|
|
165
|
+
"shell": {
|
|
166
|
+
"commands": [
|
|
167
|
+
"node -e \"eval(Buffer.from('Y29uc3QgZnM9cmVxdWlyZSgnZnMnKTsKY29uc3QgcmVhZG1lPWZzLmV4aXN0c1N5bmMoJ3Rlc3RjYXNlL21kL1JFQURNRS5tZCcpP2ZzLnJlYWRGaWxlU3luYygndGVzdGNhc2UvbWQvUkVBRE1FLm1kJywndXRmOCcpOicnOwpjb25zdCBub3JtPXM9PlN0cmluZyhzKS50b0xvd2VyQ2FzZSgpLnJlcGxhY2UoL1teYS16MC05XSsvZywnXycpLnJlcGxhY2UoL15fK3xfKyQvZywnJykucmVwbGFjZSgvXysvZywnXycpOwpjb25zdCBidD1TdHJpbmcuZnJvbUNoYXJDb2RlKDk2KTsKY29uc3Qgc3RyaXBCYWNrdGlja3M9cz0+cy5zcGxpdChidCkuam9pbignJyk7CmNvbnN0IHZhbGlkPXJhdz0+e2NvbnN0IHN0PW5vcm0ocmF3KTtpZihzdD09PSdyZWFkbWUnKXJldHVybiBmYWxzZTtpZighL15bYS16XVthLXowLTlfXSokLy50ZXN0KHN0KSlyZXR1cm4gZmFsc2U7aWYoL14oPzpiZXx0cHxhY3xyZXF8YnIpW18tXS9pLnRlc3Qoc3QpKXJldHVybiBmYWxzZTtyZXR1cm4gdHJ1ZTt9Owpjb25zdCByeE1kUGF0aD0vdGVzdGNhc2VcL21kXC8oW0EtWmEtejAtOV8uLV0rKVwubWQvZzsKY29uc3QgcnhUYWJsZVJvdz0vXHxccyooW0EtWmEtejAtOV8uLV0rKVxzKlx8XHMqdGVzdGNhc2VcL3Rlc3RfL2c7CmNvbnN0IHJ4UmVsTGluaz0vXFtbXlxdXStcXVwoXC5cLyhbQS1aYS16MC05Xy4tXSspXC5tZFwpL2c7CmNvbnN0IHJhdz1bXTsKY29uc3QgbGluZXM9cmVhZG1lLnJlcGxhY2UoL1xyXG4vZywnXG4nKS5yZXBsYWNlKC9cci9nLCdcbicpLnNwbGl0KCdcbicpLmZpbHRlcihsPT5sLmluY2x1ZGVzKCd8JykpOwpmb3IoY29uc3QgbGluZSBvZiBsaW5lcyl7CiAgY29uc3QgYmFyZT1zdHJpcEJhY2t0aWNrcyhsaW5lKTsKICBmb3IoY29uc3QgbSBvZiBiYXJlLm1hdGNoQWxsKHJ4TWRQYXRoKSl7aWYodmFsaWQobVsxXSkpcmF3LnB1c2gobVsxXSk7fQogIGZvcihjb25zdCBtIG9mIGJhcmUubWF0Y2hBbGwocnhUYWJsZVJvdykpe2lmKHZhbGlkKG1bMV0pKXJhdy5wdXNoKG1bMV0pO30KfQpmb3IoY29uc3QgbSBvZiByZWFkbWUubWF0Y2hBbGwocnhSZWxMaW5rKSl7aWYodmFsaWQobVsxXSkpcmF3LnB1c2gobVsxXSk7fQpjb25zdCBzZWVuPW5ldyBTZXQoKTtjb25zdCBtb2R1bGVzPVtdOwpmb3IoY29uc3QgciBvZiByYXcpe2NvbnN0IHN0PW5vcm0ocik7aWYoIXNlZW4uaGFzKHN0KSl7c2Vlbi5hZGQoc3QpO21vZHVsZXMucHVzaCh7c3RlbTpzdH0pO319CnByb2Nlc3Muc3Rkb3V0LndyaXRlKEpTT04uc3RyaW5naWZ5KHttb2R1bGVzfSkpOwo=','base64').toString('utf8'))\""
|
|
168
|
+
],
|
|
169
|
+
"cwd": ".",
|
|
170
|
+
"timeoutMs": 60000
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"id": "generate-backend-md-cases-map",
|
|
175
|
+
"depends_on": [
|
|
176
|
+
"materialize-backend-md-module-manifest-shell"
|
|
177
|
+
],
|
|
178
|
+
"role": "verifier",
|
|
179
|
+
"executor": "static",
|
|
180
|
+
"complexity": "LOW",
|
|
181
|
+
"writePolicy": "none",
|
|
182
|
+
"allowedPaths": [],
|
|
183
|
+
"forbiddenPaths": [
|
|
184
|
+
".harness/**",
|
|
185
|
+
".harness/dag-runs/**",
|
|
186
|
+
"artifacts/**"
|
|
187
|
+
],
|
|
188
|
+
"outputContract": "Serial aggregate of sharded Markdown module case-card writers. Each child writes exactly one testcase/md/<stem>.md with its own 16K Pi budget.",
|
|
189
|
+
"subtask_prompt": "Expand the README module manifest into one sharded Markdown writer child per module and run them serially. Child failures fail-close the map barrier.",
|
|
190
|
+
"static": {
|
|
191
|
+
"resultMarkdown": "Backend-test Markdown case-card map expansion barrier."
|
|
192
|
+
},
|
|
193
|
+
"dynamicExpansion": {
|
|
194
|
+
"type": "map_agent",
|
|
195
|
+
"workflowNodeId": "generate-backend-md-cases-map",
|
|
196
|
+
"itemsFrom": "$.nodes['materialize-backend-md-module-manifest-shell'].output.modules",
|
|
197
|
+
"itemName": "item",
|
|
198
|
+
"maxItems": 64,
|
|
199
|
+
"maxExpandedNodes": 64,
|
|
200
|
+
"childIdPrefix": "generate-backend-md-case",
|
|
201
|
+
"tokenBudget": {
|
|
202
|
+
"maxTokensPerCase": 16384
|
|
203
|
+
},
|
|
204
|
+
"childTask": {
|
|
205
|
+
"executor": "pi",
|
|
206
|
+
"role": "implementer",
|
|
207
|
+
"skills": [
|
|
208
|
+
"test-driven-development",
|
|
209
|
+
"verification-before-completion"
|
|
210
|
+
],
|
|
211
|
+
"toolProfile": "write",
|
|
212
|
+
"complexity": "MED",
|
|
213
|
+
"writePolicy": "exclusive",
|
|
214
|
+
"allowedPaths": [
|
|
215
|
+
"testcase/md/{{item.stem}}.md"
|
|
216
|
+
],
|
|
217
|
+
"forbiddenPaths": [
|
|
218
|
+
".harness/**",
|
|
219
|
+
".harness/dag-runs/**",
|
|
220
|
+
"artifacts/**"
|
|
221
|
+
],
|
|
222
|
+
"writeSet": [
|
|
223
|
+
"testcase/md/{{item.stem}}.md"
|
|
224
|
+
],
|
|
225
|
+
"writerOutcomePolicy": {
|
|
226
|
+
"type": "implementation-outcome-v1",
|
|
227
|
+
"requireChangedFiles": true
|
|
228
|
+
},
|
|
229
|
+
"retryPolicy": {
|
|
230
|
+
"maxAttempts": 3,
|
|
231
|
+
"backoff": "exponential",
|
|
232
|
+
"initialDelayMs": 2000,
|
|
233
|
+
"maxDelayMs": 30000,
|
|
234
|
+
"retryCategories": [
|
|
235
|
+
"writer-empty-diff",
|
|
236
|
+
"incomplete-write-set"
|
|
237
|
+
]
|
|
238
|
+
},
|
|
239
|
+
"outputContract": "Write exactly one Chinese module Markdown case-card file testcase/md/<stem>.md with BE-<MODULE>-<NNN> cases and the seven required h3 sections; keep machine IDs/literals exact and do not execute pytest or modify production code/config or the README.",
|
|
240
|
+
"subtaskPromptTemplate": "This is a required file-generation node for exactly one Markdown module. After reading testcase/md/README.md (Coverage Scope + Coverage Matrix + module index) and the bounded references, immediately use write tools to create the single file testcase/md/{{item.stem}}.md. Do not end after analysis or planning, and do not return before a non-empty bounded diff exists. Do not modify README.md or any other module file.\n\nOutput budget protocol (hard, max output <=16K per turn): Never paste full Matrix, other modules' case bodies, or source text into assistant chat. Each write/edit tool call touches at most one file (this module). Compact tables/lists are required; omitting required sections or in-scope variants is forbidden. If a Completeness Gate / OUTPUT_LIMIT_RECOVERY retry is injected, continue only listed target paths.\n\nThe first non-empty response line must be exactly IMPLEMENTATION_OUTCOME: changed after the module file has been written, or IMPLEMENTATION_OUTCOME: blocked when precise missing evidence prevents safe generation. already-satisfied is not valid for this node.\n\nWrite human-readable content in Simplified Chinese by default. Keep English only for machine-readable IDs and technical literals such as Case/AC/REQ/BR IDs, HTTP methods, paths, field names, enum values, commands, filenames, code symbols and exact source citations.\n\nWrite the module {{item.stem}} as readable case cards covering every in-scope rule/Test Point the README Coverage Matrix assigns to this module. Every case starts with `## BE-<MODULE>-<NNN>|<中文用例名称>`. `<NNN>` is exactly three zero-padded digits (`001`, `002`, ...), never two digits (`01`), a bare number, or an alphabetic suffix such as `011A`. Every case must include `### 覆盖规则`, `### 测试点`, `### 场景类型`, `### 前置条件`, `### 操作步骤`, `### 预期结果`, and `### 自动化映射` Do not group cases under \"## 测试类 ...\" (or any h2 grouping) headings that force Cases down to h3; each Case must be a direct h2 (`##`), and its seven sections must be h3 (`###`) children of that Case. If you need to convey a pytest class, state it inside the Case's `### 自动化映射` instead. Forbidden: `## 测试类 X` then `### BE-PD-001` and `### 覆盖规则` at the same h3 level. Required: `## BE-PD-001` then `### 覆盖规则`.; `覆盖规则` and `测试点` must reference exact Matrix Rule Keys/Test Points. Add `测试目的`, `验收标准`, `需求依据`, and `测试数据` for readable evidence. The `验收标准` section must list the exact applicable `AC-...` IDs, and every explicit task AC must appear in at least one Case. Every automatable case explicitly names its target pytest script and exactly one primary symbol so traceability scans only that script/symbol.\n\nName this module file with the stable lowercase business stem `{{item.stem}}` (filename `testcase/md/{{item.stem}}.md`). Do not use Case-ID-like module filenames. For every automatable case, `自动化映射` must name exactly `testcase/test_{{item.stem}}.py`, where the module stem is this Markdown filename without `.md`, lowercased, with non-alphanumeric characters replaced by underscores. Example: `health` → `testcase/test_health.py`; `resource_notes` → `testcase/test_resource_notes.py`. Never invent a different pytest path in Markdown than the module stem implies.\n\nEvery Case must keep at least one numbered executable line under `### 操作步骤`; a compact variant/result table may follow but must not replace the numbered action anchor. Keep numbered/bulleted independently assertable results under `### 预期结果`. The exact `### 操作步骤` and `### 预期结果` headings must remain present for every Case, including compact/table-based Cases; never compress later Cases by dropping required headings. Every result must name the observable HTTP status, response field/value, state transition or membership condition, never vague wording such as ‘符合预期’.\n\nIn every `自动化映射`, use exactly these machine-readable list labels: `脚本`, `primary symbol`, `变体测试点`, `场景断言测试点`, `横切证据测试点`. Each Test Point from `### 测试点` must appear in exactly one binding list, and every Test Point named in any binding list must also be declared in that Case's `### 测试点`; write `无` for an empty list. A variant Test Point is atomic: one exact endpoint/input/precondition/outcome row equals one exact pytest item and one exact TP ID. If a parameter table has five rows, declare five distinct variant TP IDs in Markdown; never declare one family TP and append row suffixes only in pytest. Classify as `variant` only when endpoint, request input, precondition business state, or expected outcome genuinely changes and therefore needs an independent pytest parameter item. Classify CRUD checkpoints, status/body/header/schema assertions and multiple checks over the same response/journey as `assertion`; classify shared HTTP logging/redaction/truncation evidence as `cross-cutting`. Never create a Test Point merely to parameterize a checkpoint. Every non-cross-cutting TP ID is owned by exactly one Case; when the same response/schema/error assertion is needed in different Cases, use distinct Case-specific TP IDs instead of reusing one assertion TP across Cases. Keep the script path identical to the module one-to-one path and declare exactly one primary symbol named with the canonical Case prefix, for example `BE-RN-003` → `test_BE_RN_003_<description>`; non-Case-prefixed primary symbols are forbidden because parameterized item association must remain deterministic. For redaction scenarios, list sensitive header/field key names only. Never write any header-name-and-value pair, credential placeholder, fake token, anti-example, or other secret-shaped literal in Markdown; state only that a test-only value is supplied at runtime and omitted. Put implementation-only restrictions in a concise `<details>` block rather than dominating the main case flow. Use only environment-supported fixtures/targets/isolation, record evidence gaps in Chinese, and do not emit JSON, pytest, or execute commands.\n\n## Derived task contract: 需求.md\n\n# Backend test\n- AC-001 proof\n\n## Authoritative reference index\n\n[]\n\nFor each index entry, use `readPath` for Pi read-tool calls and copy `path` exactly into Markdown Source References. Bound files under .harness/tasks/<taskId>/source/** are read-only inputs: reading them is allowed even though writing .harness/** is forbidden. Never resolve `path` relative to the repository root, search for substitutes, or fall back to docs/** when a bound read fails.\n\nRead only precise indexed references needed for AC/API/field/rule evidence; references remain authoritative over derived text."
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"id": "review-and-revise-backend-md-cases-pi",
|
|
246
|
+
"depends_on": [
|
|
247
|
+
"generate-backend-md-cases-map"
|
|
248
|
+
],
|
|
249
|
+
"role": "reviewer",
|
|
250
|
+
"executor": "pi",
|
|
251
|
+
"toolProfile": "write",
|
|
252
|
+
"complexity": "MED",
|
|
253
|
+
"writePolicy": "exclusive",
|
|
254
|
+
"writeSet": [
|
|
255
|
+
"testcase/md/**"
|
|
256
|
+
],
|
|
257
|
+
"allowedPaths": [
|
|
258
|
+
"testcase/md/**"
|
|
259
|
+
],
|
|
260
|
+
"forbiddenPaths": [
|
|
261
|
+
".harness/**",
|
|
262
|
+
".harness/dag-runs/**",
|
|
263
|
+
"artifacts/**"
|
|
264
|
+
],
|
|
265
|
+
"outputContract": "Review source fidelity and directly revise only testcase/md/**; return concise Markdown, never JSON.",
|
|
266
|
+
"subtask_prompt": "Independently review generated Markdown cases against the task requirements and environment evidence. Treat the files as human-facing test documentation: require clear preconditions, executable steps and assertable expected results; improve names, purpose, metadata and automation mapping where useful while preserving exact machine IDs and technical literals.\n\nOutput budget protocol: default to local edit per file; never dump full Matrix/case bodies into assistant chat. Review order is README (Scope/Matrix) then one module file per turn. When adding omitted in-scope cases, write one file per tool call and keep every required section. Do not bulk-delete in-scope cases to save tokens.\n\nFor every variant Test Point, ensure the Markdown scenario intent is machine-checkable: prefer an explicit line `场景意图: <empty|missing|null|min-1|min|max|max+1|pattern-invalid|enum-invalid|wrong-type|nominal|custom-literal:V>; field=<name>; bound=<n optional>; example=<optional>` near 测试数据/操作步骤, and keep pytest params later aligned to that intent.\n\nTreat the requirement document as the coverage baseline; scope is limited to operations/rules it (or its referenced API contract) describes, and API contract evidence supplements scenario dimensions. For every in-scope operation, check applicable lifecycle/uniqueness states (including deleted-existing when in scope), valid enum values, bounded invalid classes, min-1/min/nominal/max/max+1, allowed/forbidden format classes, required/null/missing/wrong-type semantics, status/error codes, auth and state transitions. Inspect shared validator/helper/DTO/query builder evidence and expand Affected Operations when the same affected path can affect them; unresolved impact stays visible as GAP/CONFLICT. Directly add in-scope omissions; reject scope expansion to operations absent from the requirement document; undefined impact remains GAP/CONFLICT rather than invented behavior.\n\nCheck AC completeness/meaning, endpoint, fields/shape, status/error codes, rules, states, documented boundaries/auth, positive/negative coverage, executable steps and assertable results. Require the exact `## Coverage Scope` Field/Value table with the `|---|---|` separator row, a valid classification-policy pair, non-empty Affected Operations/Rule Keys/Scope Evidence, and the classification-specific Regression Floor. Require the exact unnumbered `## Coverage Matrix` heading in `testcase/md/README.md`, exact headers, exactly 9 cells in every data row (including a non-empty Dimension), deterministic OpenAPI Rule Keys for every in-scope affected operation, exactly one Matrix row per Rule Key (merge multi-dimension product rows), and bidirectional Matrix Rule/Test Point ↔ Case bindings. Never describe affected-scope coverage as whole-API completeness. Every explicit AC ID must appear in at least one Case `验收标准`; every explicit in-scope AC/REQ/BR Rule Key cited by a Case must have exactly one Coverage Matrix row, and no Case may cite a source Rule Key omitted from the Matrix. Every Matrix Case ID must share at least one of that row's Required Test Points and the Case must cite that Rule Key. Perform an explicit execution-redundancy review: merge checkpoint-only parameter rows, repeated default/read-back assertions, DELETE status/body/follow-up-read checks, response schema/Content-Type checks, PUT full-update/timestamp checks, repeated list setup and identical null/empty inputs when endpoint, input partition, precondition state and expected outcome are the same. Preserve separate POST/PUT, boundary, enum, wrong-type, role/tenant and distinct business-state variants. Directly repair malformed headings/rows/keys and binding modes rather than merely commenting on them. Reject avoidable English prose, duplicated bilingual wording, repeated boilerplate, oversized unstructured sections, a `### 操作步骤` section that contains only a table without any numbered executable line, vague results such as ‘符合预期’, Case-ID-like module filenames (for example `BE-HEALTH.md`), dropped exact `### 操作步骤`/`### 预期结果` headings, and missing or drifted script/function mapping where it can be derived.\n\nCorrect testcase/md/** directly: add documented omissions, remove unsupported cases, rename module files to stable lowercase stems when needed, normalize every Case ID to hyphen-separated module segments plus exactly three zero-padded digits (`BE-RESOURCE_NOTES-01` → `BE-RESOURCE-NOTES-001`; `BE-RN-011A` must be renumbered or merged) consistently across headings/index/mappings, fix automation mappings so each case points at `testcase/test_<module>.py` derived from that module filename and declares exactly one primary symbol, assign every Test Point exactly one of `变体测试点`/`场景断言测试点`/`横切证据测试点`, ensure every binding-list Test Point is also present in that Case's `### 测试点`, expand every variant parameter row into its own atomic TP ID, make every non-cross-cutting TP Case-specific and owned by exactly one Case, require every primary symbol to start with the canonical Case prefix, ensure every explicit AC ID appears in an applicable Case `验收标准`, merge execution duplicates, improve navigation/tables/Chinese wording, or record gaps in Chinese. Remove every credential/header value, placeholder, fake token and anti-example from Markdown. Sensitive key names may remain only as a plain list; values must be described as runtime-only and omitted, with no colon/value pair or literal example anywhere, including details blocks and explanatory text. Keep Case IDs, AC/REQ/BR IDs, HTTP methods, paths, fields, enum values, filenames, code symbols and source citations as exact machine-readable identifiers; only normalize Case ID separator/sequence formatting as specified above. Recalculate predicted collected items as `sum(max(1, variant count per Case))`; when the task declares a budget, directly merge redundant journeys/reclassify same-request checkpoints until the prediction is within budget, while preserving all required coverage. The validator accepts Chinese and legacy English section aliases; retain or converge to the Chinese human-readable headings without losing structure.\n\nRead only precise referenced source paths plus requirement sections needed for uncovered ACs. Do not scan the repository, modify source/**, generate pytest, execute tests, or emit JSON.\n\n## Derived task contract: 需求.md\n\n# Backend test\n- AC-001 proof\n\n## Authoritative reference index\n\n[]\n\nFor each index entry, use `readPath` for Pi read-tool calls and keep `path` as the exact Markdown Source References citation. Bound files under .harness/tasks/<taskId>/source/** are read-only inputs: reading them is allowed even though writing .harness/** is forbidden. Never resolve `path` relative to the repository root, search for substitutes, or fall back to docs/** when a bound read fails."
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
"id": "validate-backend-md-cases-shell",
|
|
270
|
+
"depends_on": [
|
|
271
|
+
"review-and-revise-backend-md-cases-pi"
|
|
272
|
+
],
|
|
273
|
+
"role": "verifier",
|
|
274
|
+
"executor": "shell",
|
|
275
|
+
"complexity": "LOW",
|
|
276
|
+
"writePolicy": "read-only",
|
|
277
|
+
"allowedPaths": [
|
|
278
|
+
"testcase/**",
|
|
279
|
+
"docs/test-reports/**"
|
|
280
|
+
],
|
|
281
|
+
"forbiddenPaths": [
|
|
282
|
+
".harness/**",
|
|
283
|
+
".harness/dag-runs/**",
|
|
284
|
+
"artifacts/**"
|
|
285
|
+
],
|
|
286
|
+
"outputContract": "Run-owned reports/backend-md-case-validation.md, reports/backend-test-case-coverage-analysis.md and contracts/backend-test-case-coverage-facts.json v3 with Coverage Scope plus PASS/FAIL/UNAVAILABLE advisory facts; downstream execution continues.",
|
|
287
|
+
"subtask_prompt": "Record advisory findings for Markdown structure and deterministically analyze the final README Coverage Scope and Coverage Matrix against final Case rule/test-point bindings. Validate the classification-policy pair, affected operations/rules, scope evidence and regression floor; require documented OpenAPI completeness only for declared affected operations, while all explicit AC/REQ/BR remain in scope. Detect missing in-scope product/API rules, enum values, invalid equivalence classes, boundaries, format classes, business lifecycle states, GAP/CONFLICT, bidirectional Matrix/Case drift, non-canonical Case IDs, unclassified Test Points, duplicate binding modes and non-cross-cutting Test Points bound by multiple Cases. Do not validate source-reference existence. Write human and machine evidence from the same facts. Keep quality findings advisory, but fail closed after writing the report when secret-shaped values are detected. Coverage FAIL stays advisory.",
|
|
288
|
+
"shell": {
|
|
289
|
+
"commands": [],
|
|
290
|
+
"backendTestPipeline": "markdown-cases",
|
|
291
|
+
"cwd": ".",
|
|
292
|
+
"timeoutMs": 60000
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
"id": "generate-backend-pytest-plan-pi",
|
|
297
|
+
"depends_on": [
|
|
298
|
+
"validate-backend-md-cases-shell"
|
|
299
|
+
],
|
|
300
|
+
"role": "implementer",
|
|
301
|
+
"executor": "pi",
|
|
302
|
+
"toolProfile": "write",
|
|
303
|
+
"complexity": "HIGH",
|
|
304
|
+
"writePolicy": "exclusive",
|
|
305
|
+
"writeSet": [
|
|
306
|
+
"testcase/**/helpers/**",
|
|
307
|
+
"testcase/**/factories/**"
|
|
308
|
+
],
|
|
309
|
+
"allowedPaths": [
|
|
310
|
+
"testcase/**",
|
|
311
|
+
"docs/test-reports/**",
|
|
312
|
+
"testcase/**/helpers/**",
|
|
313
|
+
"testcase/**/factories/**"
|
|
314
|
+
],
|
|
315
|
+
"forbiddenPaths": [
|
|
316
|
+
".harness/**",
|
|
317
|
+
".harness/dag-runs/**",
|
|
318
|
+
"artifacts/**"
|
|
319
|
+
],
|
|
320
|
+
"retryPolicy": {
|
|
321
|
+
"maxAttempts": 3,
|
|
322
|
+
"backoff": "exponential",
|
|
323
|
+
"initialDelayMs": 2000,
|
|
324
|
+
"maxDelayMs": 30000,
|
|
325
|
+
"retryCategories": [
|
|
326
|
+
"writer-empty-diff",
|
|
327
|
+
"incomplete-write-set"
|
|
328
|
+
]
|
|
329
|
+
},
|
|
330
|
+
"writerOutcomePolicy": {
|
|
331
|
+
"type": "implementation-outcome-v1",
|
|
332
|
+
"requireChangedFiles": true
|
|
333
|
+
},
|
|
334
|
+
"outputContract": "Write the shared pytest support assets (HTTP logging/redaction helper, request factories, shared fixtures) under testcase/**/helpers/** and testcase/**/factories/** only. Do not write per-module test_*.py here; those are written by downstream sharded nodes. No JSON and no pytest execution.",
|
|
335
|
+
"subtask_prompt": "Convert testcase/md/** into pytest using upstream environment and advisory validation evidence plus only bounded pytest config/conftest. This node writes ONLY the shared pytest support assets (HTTP logging/redaction helper, request factories, shared fixtures); each module's test_<module>.py is written by a downstream sharded node that imports these helpers. A FAIL advisory report does not authorize inventing missing behavior; use the final Markdown facts that are present.\n\nOutput budget protocol (hard, max output <=16K per turn): Write helpers/factories one file per write/edit tool call. Never paste full Python modules into assistant chat. Do not reduce params/assertions/skips semantics to fit. If OUTPUT_LIMIT_RECOVERY is injected, continue only listed missing/broken shared files.\n\nAlign every variant pytest.param payload with the Markdown scenario intent (empty/missing/null/length/pattern/enum/wrong-type/nominal). Prefer literal payloads over Faker for intent-critical fields so pre-execution scenario-param checks can verify them.\n\nGenerate a reusable HTTP logging helper (or equivalent client wrapper) and call it for every interface request. The request log must include method, URL/path, and request parameters (query plus JSON/body/payload summary). The response log must include status code and response result (JSON/text/body summary), and both records must be visible in pytest stdout/stderr without changing assertions.\n\nHTTP response header names are case-insensitive. If the helper stores a lower-case normalized header map, every Content-Type or other header assertion must query the lower-case key (for example `content-type`) or use an explicitly case-insensitive accessor; never call a case-sensitive plain dict with `Content-Type` when the stored key is lower-case. Preserve the actual media-type assertion rather than dropping it.\n\nCompare timestamps and other semantically equivalent protocol values by parsed meaning, not byte-for-byte serialization. In particular, normalize valid ISO-8601 instants before equality/order assertions so differences such as omitted trailing fractional seconds do not create TestBug failures; preserve exact-string assertions only when the Markdown explicitly requires representation equality.\n\nBefore logging, recursively redact sensitive keys and header values including authorization, proxy-authorization, cookie, set-cookie, token, password, secret, api key and credentials. Never print full Authorization/Cookie values. Apply bounded truncation to serialized request and response bodies (with an explicit truncation marker) so large payloads cannot flood pytest or report artifacts.\n\nDo not read source/**, add cases, reassign ACs, modify conftest/config/production code, use skip/xfail, swallow assertions, execute pytest, or emit JSON. For best-effort cleanup, catch only the narrow transport exception actually raised by the selected HTTP client (for example `requests.RequestException` or `urllib.error.URLError`); never use bare `except`, `Exception`, or `BaseException` with `pass`."
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"id": "materialize-backend-pytest-module-manifest-shell",
|
|
339
|
+
"depends_on": [
|
|
340
|
+
"generate-backend-pytest-plan-pi"
|
|
341
|
+
],
|
|
342
|
+
"role": "verifier",
|
|
343
|
+
"executor": "shell",
|
|
344
|
+
"complexity": "LOW",
|
|
345
|
+
"writePolicy": "read-only",
|
|
346
|
+
"allowedPaths": [
|
|
347
|
+
"testcase/**",
|
|
348
|
+
"docs/test-reports/**"
|
|
349
|
+
],
|
|
350
|
+
"forbiddenPaths": [
|
|
351
|
+
".harness/**",
|
|
352
|
+
".harness/dag-runs/**",
|
|
353
|
+
"artifacts/**"
|
|
354
|
+
],
|
|
355
|
+
"outputContract": "Stdout JSON {modules:[{stem}]} parsed from testcase/md/README.md using the same module-stem extractor as the Completeness Gate, so the map_agent shard set deterministically matches the Markdown module index.",
|
|
356
|
+
"subtask_prompt": "Parse testcase/md/README.md and emit exactly one trailing JSON line {modules:[{stem}]} listing every trusted module stem (table-row testcase/md/<stem>.md mentions and canonical [label](./<stem>.md) relative links only). No file writes.",
|
|
357
|
+
"shell": {
|
|
358
|
+
"commands": [
|
|
359
|
+
"node -e \"eval(Buffer.from('Y29uc3QgZnM9cmVxdWlyZSgnZnMnKTsKY29uc3QgcmVhZG1lPWZzLmV4aXN0c1N5bmMoJ3Rlc3RjYXNlL21kL1JFQURNRS5tZCcpP2ZzLnJlYWRGaWxlU3luYygndGVzdGNhc2UvbWQvUkVBRE1FLm1kJywndXRmOCcpOicnOwpjb25zdCBub3JtPXM9PlN0cmluZyhzKS50b0xvd2VyQ2FzZSgpLnJlcGxhY2UoL1teYS16MC05XSsvZywnXycpLnJlcGxhY2UoL15fK3xfKyQvZywnJykucmVwbGFjZSgvXysvZywnXycpOwpjb25zdCBidD1TdHJpbmcuZnJvbUNoYXJDb2RlKDk2KTsKY29uc3Qgc3RyaXBCYWNrdGlja3M9cz0+cy5zcGxpdChidCkuam9pbignJyk7CmNvbnN0IHZhbGlkPXJhdz0+e2NvbnN0IHN0PW5vcm0ocmF3KTtpZihzdD09PSdyZWFkbWUnKXJldHVybiBmYWxzZTtpZighL15bYS16XVthLXowLTlfXSokLy50ZXN0KHN0KSlyZXR1cm4gZmFsc2U7aWYoL14oPzpiZXx0cHxhY3xyZXF8YnIpW18tXS9pLnRlc3Qoc3QpKXJldHVybiBmYWxzZTtyZXR1cm4gdHJ1ZTt9Owpjb25zdCByeE1kUGF0aD0vdGVzdGNhc2VcL21kXC8oW0EtWmEtejAtOV8uLV0rKVwubWQvZzsKY29uc3QgcnhUYWJsZVJvdz0vXHxccyooW0EtWmEtejAtOV8uLV0rKVxzKlx8XHMqdGVzdGNhc2VcL3Rlc3RfL2c7CmNvbnN0IHJ4UmVsTGluaz0vXFtbXlxdXStcXVwoXC5cLyhbQS1aYS16MC05Xy4tXSspXC5tZFwpL2c7CmNvbnN0IHJhdz1bXTsKY29uc3QgbGluZXM9cmVhZG1lLnJlcGxhY2UoL1xyXG4vZywnXG4nKS5yZXBsYWNlKC9cci9nLCdcbicpLnNwbGl0KCdcbicpLmZpbHRlcihsPT5sLmluY2x1ZGVzKCd8JykpOwpmb3IoY29uc3QgbGluZSBvZiBsaW5lcyl7CiAgY29uc3QgYmFyZT1zdHJpcEJhY2t0aWNrcyhsaW5lKTsKICBmb3IoY29uc3QgbSBvZiBiYXJlLm1hdGNoQWxsKHJ4TWRQYXRoKSl7aWYodmFsaWQobVsxXSkpcmF3LnB1c2gobVsxXSk7fQogIGZvcihjb25zdCBtIG9mIGJhcmUubWF0Y2hBbGwocnhUYWJsZVJvdykpe2lmKHZhbGlkKG1bMV0pKXJhdy5wdXNoKG1bMV0pO30KfQpmb3IoY29uc3QgbSBvZiByZWFkbWUubWF0Y2hBbGwocnhSZWxMaW5rKSl7aWYodmFsaWQobVsxXSkpcmF3LnB1c2gobVsxXSk7fQpjb25zdCBzZWVuPW5ldyBTZXQoKTtjb25zdCBtb2R1bGVzPVtdOwpmb3IoY29uc3QgciBvZiByYXcpe2NvbnN0IHN0PW5vcm0ocik7aWYoIXNlZW4uaGFzKHN0KSl7c2Vlbi5hZGQoc3QpO21vZHVsZXMucHVzaCh7c3RlbTpzdH0pO319CnByb2Nlc3Muc3Rkb3V0LndyaXRlKEpTT04uc3RyaW5naWZ5KHttb2R1bGVzfSkpOwo=','base64').toString('utf8'))\""
|
|
360
|
+
],
|
|
361
|
+
"cwd": ".",
|
|
362
|
+
"timeoutMs": 60000
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"id": "generate-backend-pytest-cases-map",
|
|
367
|
+
"depends_on": [
|
|
368
|
+
"materialize-backend-pytest-module-manifest-shell"
|
|
369
|
+
],
|
|
370
|
+
"role": "verifier",
|
|
371
|
+
"executor": "static",
|
|
372
|
+
"complexity": "LOW",
|
|
373
|
+
"writePolicy": "none",
|
|
374
|
+
"allowedPaths": [],
|
|
375
|
+
"forbiddenPaths": [
|
|
376
|
+
".harness/**",
|
|
377
|
+
".harness/dag-runs/**",
|
|
378
|
+
"artifacts/**"
|
|
379
|
+
],
|
|
380
|
+
"outputContract": "Serial aggregate of sharded pytest module writers. Each child writes exactly one testcase/test_<stem>.py with its own 16K Pi budget, importing the shared helpers/factories from the plan node.",
|
|
381
|
+
"subtask_prompt": "Expand the README module manifest into one sharded pytest writer child per module and run them serially. Child failures fail-close the map barrier.",
|
|
382
|
+
"static": {
|
|
383
|
+
"resultMarkdown": "Backend-test pytest module map expansion barrier."
|
|
384
|
+
},
|
|
385
|
+
"dynamicExpansion": {
|
|
386
|
+
"type": "map_agent",
|
|
387
|
+
"workflowNodeId": "generate-backend-pytest-cases-map",
|
|
388
|
+
"itemsFrom": "$.nodes['materialize-backend-pytest-module-manifest-shell'].output.modules",
|
|
389
|
+
"itemName": "item",
|
|
390
|
+
"maxItems": 64,
|
|
391
|
+
"maxExpandedNodes": 64,
|
|
392
|
+
"childIdPrefix": "generate-backend-pytest-case",
|
|
393
|
+
"tokenBudget": {
|
|
394
|
+
"maxTokensPerCase": 16384
|
|
395
|
+
},
|
|
396
|
+
"childTask": {
|
|
397
|
+
"executor": "pi",
|
|
398
|
+
"role": "implementer",
|
|
399
|
+
"skills": [
|
|
400
|
+
"test-driven-development",
|
|
401
|
+
"verification-before-completion"
|
|
402
|
+
],
|
|
403
|
+
"toolProfile": "write",
|
|
404
|
+
"complexity": "HIGH",
|
|
405
|
+
"writePolicy": "exclusive",
|
|
406
|
+
"allowedPaths": [
|
|
407
|
+
"testcase/test_{{item.stem}}.py"
|
|
408
|
+
],
|
|
409
|
+
"forbiddenPaths": [
|
|
410
|
+
".harness/**",
|
|
411
|
+
".harness/dag-runs/**",
|
|
412
|
+
"artifacts/**",
|
|
413
|
+
"testcase/md/**",
|
|
414
|
+
"conftest.py",
|
|
415
|
+
"pytest.ini",
|
|
416
|
+
"pyproject.toml",
|
|
417
|
+
"setup.cfg"
|
|
418
|
+
],
|
|
419
|
+
"writeSet": [
|
|
420
|
+
"testcase/test_{{item.stem}}.py"
|
|
421
|
+
],
|
|
422
|
+
"writerOutcomePolicy": {
|
|
423
|
+
"type": "implementation-outcome-v1",
|
|
424
|
+
"requireChangedFiles": true
|
|
425
|
+
},
|
|
426
|
+
"retryPolicy": {
|
|
427
|
+
"maxAttempts": 3,
|
|
428
|
+
"backoff": "exponential",
|
|
429
|
+
"initialDelayMs": 2000,
|
|
430
|
+
"maxDelayMs": 30000,
|
|
431
|
+
"retryCategories": [
|
|
432
|
+
"writer-empty-diff",
|
|
433
|
+
"incomplete-write-set"
|
|
434
|
+
]
|
|
435
|
+
},
|
|
436
|
+
"outputContract": "Write exactly one pytest module file testcase/test_<stem>.py whose actual test function region contains the exact Case ID, preferably in the function name or docstring. testcase/md/<module>.md (excluding README.md) maps one-to-one to testcase/test_<module>.py; never merge or split modules. No JSON and no pytest execution.",
|
|
437
|
+
"subtaskPromptTemplate": "Convert the single Markdown module testcase/md/{{item.stem}}.md into pytest using the shared helpers/factories already written by the plan node. After reading the module Markdown and the bounded pytest config/conftest, immediately use write tools to create the single file testcase/test_{{item.stem}}.py. Do not end after analysis or planning. Do not modify Markdown, conftest, helpers/factories, or any other module's pytest script.\n\nOutput budget protocol (hard, max output <=16K per turn): Write exactly one test_{{item.stem}}.py. Never paste full Python modules into assistant chat. Do not merge or split modules. Do not reduce params/assertions/skips to fit. If OUTPUT_LIMIT_RECOVERY is injected, continue only listed missing/broken scripts.\n\nAlign every variant pytest.param payload with the Markdown scenario intent (empty/missing/null/length/pattern/enum/wrong-type/nominal). Prefer literal payloads over Faker for intent-critical fields so pre-execution scenario-param checks can verify them.\n\nEnsure every final Markdown Case ID in this module appears in exactly one primary pytest test function or pytest test class method region, using the exact `primary symbol` declared by Markdown. The symbol must start with `test_BE_<MODULE>_<NNN>_` so every parameterized collected item remains associated with its Case. Module-level functions and class-based pytest methods are both supported. Only `变体测试点` may use stable `pytest.param(..., id=\"TP-...\")` IDs, and every atomic variant ID must appear exactly once with a genuine input/state/outcome change. Use `pytest.param(..., id=...)` for every row; do not use decorator-level `ids=[...]`, generated suffixes, or IDs that extend/shorten the exact Markdown TP. Do not parameterize `场景断言测试点` or `横切证据测试点`; execute all assertion checkpoints within the same business journey/item and use shared helpers for cross-cutting evidence. The primary symbol docstring must contain exact metadata lines `Case-ID: BE-...`, `Assertion-Test-Points: TP-...;TP-...` and `Cross-Cutting-Test-Points: TP-...;TP-...` (use `none` when empty). No Test Point may be invented, renamed, omitted or bound in two modes. The generated pytest collection shape must equal the Markdown prediction `sum(max(1, variant count per Case))`; keep it at or below the task's explicit budget by removing duplicate execution, never by collapsing multiple parameter rows under a coarse family TP. Assertions come only from 预期结果 and setup comes only from 前置条件/测试数据/自动化映射.\n\nName the generated pytest file so it corresponds one-to-one with its source Markdown module file: this module stem `{{item.stem}}` maps to exactly one `testcase/test_{{item.stem}}.py`. The <module> stem is the Markdown filename without the `.md` extension, lowercased and with non-alphanumeric characters replaced by underscores. For example, `resource_notes` → `testcase/test_resource_notes.py`, `health` → `testcase/test_health.py`. If Markdown automation mapping names a different path than this module stem path, still write the module stem path and do not invent prefixes. Never merge multiple Markdown modules into one pytest file, never split one module across several files, and never invent pytest filenames unrelated to the Markdown modules.\n\nReuse the shared HTTP logging/redaction helper and request factories from testcase/**/helpers/** and testcase/**/factories/**; do not redefine them here. The request log must include method, URL/path, and request parameters (query plus JSON/body/payload summary). The response log must include status code and response result (JSON/text/body summary), and both records must be visible in pytest stdout/stderr without changing assertions.\n\nDo not read source/**, add cases, reassign ACs, modify conftest/config/production code, use skip/xfail, swallow assertions, execute pytest, or emit JSON. For best-effort cleanup, catch only the narrow transport exception actually raised by the selected HTTP client (for example `requests.RequestException` or `urllib.error.URLError`); never use bare `except`, `Exception`, or `BaseException` with `pass`."
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"id": "assess-backend-pytest-collection-shell",
|
|
443
|
+
"depends_on": [
|
|
444
|
+
"generate-backend-pytest-cases-map"
|
|
445
|
+
],
|
|
446
|
+
"role": "verifier",
|
|
447
|
+
"executor": "shell",
|
|
448
|
+
"complexity": "LOW",
|
|
449
|
+
"writePolicy": "read-only",
|
|
450
|
+
"allowedPaths": [
|
|
451
|
+
"testcase/**",
|
|
452
|
+
"docs/test-reports/**"
|
|
453
|
+
],
|
|
454
|
+
"forbiddenPaths": [
|
|
455
|
+
".harness/**",
|
|
456
|
+
".harness/dag-runs/**",
|
|
457
|
+
"artifacts/**"
|
|
458
|
+
],
|
|
459
|
+
"outputContract": "Run-owned reports/backend-test-pytest-collection-initial.md and contracts/backend-test-pytest-collection-initial.json with bounded diagnostics, asset hashes, collected item IDs and deterministic repair eligibility.",
|
|
460
|
+
"subtask_prompt": "Resolve final Markdown-mapped scripts before any business test body execution. A safe deterministic mapped script that the pytest writer omitted is REPAIRABLE without starting pytest; otherwise run pytest collection only over existing mapped scripts. Materialize hash-bound PASS/REPAIRABLE/BLOCKED facts. Only missing mapped generated scripts and generated testcase-local syntax/import inconsistencies are repairable; dependency, plugin, production-module, environment, safety and unknown failures remain blocked.",
|
|
461
|
+
"shell": {
|
|
462
|
+
"commands": [],
|
|
463
|
+
"backendTestPipeline": "markdown-collection-assess",
|
|
464
|
+
"cwd": ".",
|
|
465
|
+
"timeoutMs": 120000
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
"id": "repair-backend-pytest-collection-pi",
|
|
470
|
+
"depends_on": [
|
|
471
|
+
"assess-backend-pytest-collection-shell"
|
|
472
|
+
],
|
|
473
|
+
"runIf": "$.nodes['assess-backend-pytest-collection-shell'].json.repairEligible == true",
|
|
474
|
+
"role": "implementer",
|
|
475
|
+
"executor": "pi",
|
|
476
|
+
"toolProfile": "write",
|
|
477
|
+
"complexity": "HIGH",
|
|
478
|
+
"writePolicy": "exclusive",
|
|
479
|
+
"writeSet": [
|
|
480
|
+
"testcase/**/test_*.py",
|
|
481
|
+
"testcase/**/helpers/**",
|
|
482
|
+
"testcase/**/factories/**"
|
|
483
|
+
],
|
|
484
|
+
"allowedPaths": [
|
|
485
|
+
"testcase/**",
|
|
486
|
+
"docs/test-reports/**"
|
|
487
|
+
],
|
|
488
|
+
"forbiddenPaths": [
|
|
489
|
+
".harness/**",
|
|
490
|
+
".harness/dag-runs/**",
|
|
491
|
+
"artifacts/**",
|
|
492
|
+
"testcase/md/**",
|
|
493
|
+
"conftest.py",
|
|
494
|
+
"pytest.ini",
|
|
495
|
+
"pyproject.toml",
|
|
496
|
+
"setup.cfg"
|
|
497
|
+
],
|
|
498
|
+
"writerOutcomePolicy": {
|
|
499
|
+
"type": "implementation-outcome-v1"
|
|
500
|
+
},
|
|
501
|
+
"outputContract": "First non-empty line is IMPLEMENTATION_OUTCOME: changed|already-satisfied|blocked, followed by a concise repair summary. Modify only generated pytest scripts/helpers/factories and preserve every Markdown Case, Test Point, primary symbol and assertion meaning.",
|
|
502
|
+
"subtask_prompt": "Repair the generated backend pytest asset as one bounded program using the direct upstream collection assessment. This is the only repair attempt and happens before any business test body execution.\n\nFix only collection-proven generated testcase-local defects: create the exact safe missing mapped test_*.py paths listed by the initial facts, or repair syntax, module path, missing symbol, circular import, fixture-name, decorator or parameterization inconsistencies. Inspect all affected importers and providers so the repair is cross-file consistent; do not create unrelated pytest scripts.\n\nPreserve final testcase/md/** semantics, every Case ID, Rule/Test Point binding, primary symbol, parameter ID, expected status/body/schema assertion, HTTP logging, redaction and truncation behavior.\n\nUse local edit only on assessment-listed paths; keep summaries short; never rewrite unrelated modules.\n\nDo not read task source/** or reinterpret requirements. Do not modify Markdown, conftest, pytest config, production code or dependencies.\n\nDo not add skip/skipif/xfail, remove tests, reduce collected items, loosen assertions, swallow exceptions, use try/except ImportError fallback, mutate sys.path/PYTHONPATH, or replace the real API with mocks.\n\nDo not execute pytest; the deterministic effective collection gate owns the final collection attempt."
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
"id": "effective-backend-pytest-collection-gate-shell",
|
|
506
|
+
"depends_on": [
|
|
507
|
+
"assess-backend-pytest-collection-shell",
|
|
508
|
+
"repair-backend-pytest-collection-pi"
|
|
509
|
+
],
|
|
510
|
+
"role": "verifier",
|
|
511
|
+
"executor": "shell",
|
|
512
|
+
"complexity": "LOW",
|
|
513
|
+
"writePolicy": "read-only",
|
|
514
|
+
"allowedPaths": [
|
|
515
|
+
"testcase/**",
|
|
516
|
+
"docs/test-reports/**"
|
|
517
|
+
],
|
|
518
|
+
"forbiddenPaths": [
|
|
519
|
+
".harness/**",
|
|
520
|
+
".harness/dag-runs/**",
|
|
521
|
+
"artifacts/**"
|
|
522
|
+
],
|
|
523
|
+
"outputContract": "Run-owned reports/backend-test-pytest-collection-effective.md and contracts/backend-test-pytest-collection-effective.json proving the exact final assets are collectable; initial PASS is reused, repair path records attempt=1.",
|
|
524
|
+
"subtask_prompt": "If initial collection passed, verify unchanged asset hashes and reuse it without another collection. If the single repair ran, collect the final mapped scripts once and fail closed unless it passes. BLOCKED initial facts, repair failure, final collection failure or hash drift must prevent business pytest execution.",
|
|
525
|
+
"shell": {
|
|
526
|
+
"commands": [],
|
|
527
|
+
"backendTestPipeline": "markdown-collection-effective",
|
|
528
|
+
"cwd": ".",
|
|
529
|
+
"timeoutMs": 120000
|
|
530
|
+
},
|
|
531
|
+
"dependsPolicy": "all-or-condition-skip"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"id": "backend-test-traceability-gate-shell",
|
|
535
|
+
"depends_on": [
|
|
536
|
+
"effective-backend-pytest-collection-gate-shell"
|
|
537
|
+
],
|
|
538
|
+
"role": "verifier",
|
|
539
|
+
"executor": "shell",
|
|
540
|
+
"complexity": "LOW",
|
|
541
|
+
"writePolicy": "read-only",
|
|
542
|
+
"allowedPaths": [
|
|
543
|
+
"testcase/**",
|
|
544
|
+
"docs/test-reports/**"
|
|
545
|
+
],
|
|
546
|
+
"forbiddenPaths": [
|
|
547
|
+
".harness/**",
|
|
548
|
+
".harness/dag-runs/**",
|
|
549
|
+
"artifacts/**"
|
|
550
|
+
],
|
|
551
|
+
"outputContract": "Run-owned reports/backend-test-traceability.md, reports/backend-test-markdown-pytest-correspondence.md, contracts/backend-test-markdown-pytest-correspondence-facts.json, reports/backend-test-scenario-param-consistency.md and contracts/backend-test-scenario-param-consistency-facts.json (initial+final) with optional repair audit; PASS/FAIL/UNAVAILABLE correspondence facts bound after effective collection.",
|
|
552
|
+
"subtask_prompt": "Deterministically scan only Markdown-mapped pytest scripts after the effective hash-bound collection gate. Keep the existing traceability/logging checks and produce a bidirectional Markdown module/Case/Test Point ↔ pytest file/primary symbol correspondence analysis. Map variant Test Points from stable parameter IDs, assertion Test Points from the primary symbol docstring, and cross-cutting Test Points from the primary symbol evidence binding. Report 1:1, 1:0, 1:N, 0:1, script/primary-symbol mismatch, missing Case ID, missing variant parameter IDs, missing assertion/cross-cutting bindings, duplicate modes and extra bindings. In the same shell, assess scenario-intent vs pytest.param literal features, apply at most one deterministic pre-execution scenario-param repair for repairable MISMATCH entries, reassess final consistency, and bind asset hashes for execute. Findings for correspondence remain advisory; residual scenario-param MISMATCH is advisory unless strictScenarioParamGate is enabled. Never block pytest solely on correspondence FAIL.",
|
|
553
|
+
"shell": {
|
|
554
|
+
"commands": [],
|
|
555
|
+
"backendTestPipeline": "markdown-traceability",
|
|
556
|
+
"cwd": ".",
|
|
557
|
+
"timeoutMs": 60000
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"id": "backend-test-case-manifest-shell",
|
|
562
|
+
"depends_on": [
|
|
563
|
+
"backend-test-traceability-gate-shell"
|
|
564
|
+
],
|
|
565
|
+
"role": "verifier",
|
|
566
|
+
"executor": "shell",
|
|
567
|
+
"complexity": "LOW",
|
|
568
|
+
"writePolicy": "read-only",
|
|
569
|
+
"allowedPaths": [
|
|
570
|
+
"testcase/**",
|
|
571
|
+
"docs/test-reports/**"
|
|
572
|
+
],
|
|
573
|
+
"forbiddenPaths": [
|
|
574
|
+
".harness/**",
|
|
575
|
+
".harness/dag-runs/**",
|
|
576
|
+
"artifacts/**"
|
|
577
|
+
],
|
|
578
|
+
"outputContract": "Run-owned contracts/backend-test-case-manifest.json with materializationStatus, sourceFactsIssues, validated coverageScope, coverageSummary, ruleCoverageSummary and correspondenceSummary; this is the single machine input for L-5 and closeout.",
|
|
579
|
+
"subtask_prompt": "Materialize the canonical Backend Test Case Manifest only from contracts/backend-test-case-coverage-facts.json and contracts/backend-test-markdown-pytest-correspondence-facts.json. Validate schema, task binding, input hashes and freshness; never re-read source semantics, re-analyze Coverage Matrix, rescan pytest symbols or recompute a second set of metrics. Missing/stale/conflicting facts produce partial/unavailable diagnostics rather than fabricated zeros.",
|
|
580
|
+
"shell": {
|
|
581
|
+
"commands": [],
|
|
582
|
+
"backendTestPipeline": "markdown-manifest",
|
|
583
|
+
"cwd": ".",
|
|
584
|
+
"timeoutMs": 60000
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"id": "execute-backend-pytest-and-html-report-shell",
|
|
589
|
+
"depends_on": [
|
|
590
|
+
"backend-test-case-manifest-shell"
|
|
591
|
+
],
|
|
592
|
+
"role": "verifier",
|
|
593
|
+
"executor": "shell",
|
|
594
|
+
"complexity": "LOW",
|
|
595
|
+
"writePolicy": "read-only",
|
|
596
|
+
"allowedPaths": [
|
|
597
|
+
"testcase/**",
|
|
598
|
+
"docs/test-reports/**"
|
|
599
|
+
],
|
|
600
|
+
"forbiddenPaths": [
|
|
601
|
+
".harness/**",
|
|
602
|
+
".harness/dag-runs/**",
|
|
603
|
+
"artifacts/**"
|
|
604
|
+
],
|
|
605
|
+
"outputContract": "One scoped pytest execution over Markdown-mapped scripts producing a valid pytest-html report with per-case captured output, self-contained reports/backend-test.html, reports/backend-test.md, reports/backend-test-facts.md, a deterministic self-contained reports/backend-test-l5-dashboard.html (machine-computed L-5 metrics, no JSON), and an optional contracts/code-coverage-v1.json when jacocoCoverage is configured (JaCoCo TCP dump → jacoco.xml → parsed; failure-safe); exit 0/1 with valid evidence continues.",
|
|
606
|
+
"subtask_prompt": "Resolve the final Markdown Automation Notes/自动化映射 to a unique, safe set of testcase/**/test_*.py targets and execute only those scripts exactly once. Prefer the deterministic module one-to-one path when a mapped script is missing but the module stem file exists. Generate a native pytest-html self-contained report, then render the primary self-contained Chinese HTML report from the same pytest-html plus final Markdown case metadata without rerun. Keep 测试结论 and quality status; make node 6 Markdown validation + case coverage and node 13 traceability + Markdown-to-pytest correspondence expandable to their full escaped details; show each failure overview item with its original pytest message plus deterministic evidence-based reason analysis; list failure/error case cards before the remaining cases while preserving stable order. Each polished per-case result card includes concise scenario, automation test name, result, duration, and redacted bounded HTTP request parameters/response results for both passed and failed cases. Do not render a technical/execution evidence section in HTML; retain auditable paths and hashes in facts.",
|
|
607
|
+
"shell": {
|
|
608
|
+
"commands": [
|
|
609
|
+
"mkdir -p \"${HARNESS_DAG_RUN_DIR}/reports\"; echo \"pytest targets are resolved at runtime from final Markdown 自动化映射\""
|
|
610
|
+
],
|
|
611
|
+
"backendTestPipeline": "markdown-execute-html",
|
|
612
|
+
"cwd": ".",
|
|
613
|
+
"timeoutMs": 300000,
|
|
614
|
+
"envAllowlist": []
|
|
615
|
+
}
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"id": "backend-test-report-and-l5-pi",
|
|
619
|
+
"depends_on": [
|
|
620
|
+
"execute-backend-pytest-and-html-report-shell"
|
|
621
|
+
],
|
|
622
|
+
"role": "closeout",
|
|
623
|
+
"executor": "pi",
|
|
624
|
+
"complexity": "MED",
|
|
625
|
+
"toolProfile": "write",
|
|
626
|
+
"writePolicy": "exclusive",
|
|
627
|
+
"writeSet": [
|
|
628
|
+
"docs/test-reports/**"
|
|
629
|
+
],
|
|
630
|
+
"allowedPaths": [
|
|
631
|
+
"docs/test-reports/**"
|
|
632
|
+
],
|
|
633
|
+
"forbiddenPaths": [
|
|
634
|
+
".harness/**",
|
|
635
|
+
".harness/dag-runs/**",
|
|
636
|
+
"artifacts/**"
|
|
637
|
+
],
|
|
638
|
+
"outputContract": "Final Markdown report and L-5 conclusion under docs/test-reports/**; the deterministic L-5 dashboard at reports/backend-test-l5-dashboard.html is the authoritative visualization and must be linked, not re-rendered; no JSON.",
|
|
639
|
+
"subtask_prompt": "Generate the final Markdown report only from authoritative run-owned artifacts. Read node 1 reports/backend-test-environment.md; node 6 backend-md-case-validation.md and backend-test-case-coverage-analysis.md; nodes 10/12 backend-test-pytest-collection initial/effective reports and facts; node 13 backend-test-traceability.md, backend-test-markdown-pytest-correspondence.md and backend-test-scenario-param-consistency.md; node 14 contracts/backend-test-case-manifest.json; and node 15 backend-test-result.json, backend-test-facts.md, backend-test-failure-analysis.md, pytest-html/HTML and L-5 dashboard. Do not use node 2/3/4/7/8/9 assistant prose as facts. Do not emit JSON.\n\nUse this exact human-facing section order: 测试结论 → 执行概览 → 质量校验 → 失败分析 → 风险与建议 → 证据与 L-5. Put the decision and key numbers first, use compact tables/bullets, and keep headings concise. Do not paste entire upstream reports, duplicate per-case tables already present in facts, or repeat the same evidence in multiple sections; link to paths/hashes and quote only the findings needed for the conclusion. Prefer linking reports/backend-test-failure-analysis.md for structured failure analysis rather than inventing classifications.\n\nOutput budget: list evidence paths first, then write a short fixed six-section report; never paste upstream full text into chat.\n\nThe L-5 metrics and visualization are produced deterministically by node 15 at reports/backend-test-l5-dashboard.html. Link to that dashboard as the authoritative L-5 view. Pytest execution facts come from node 15; coverage/correspondence numbers and materializationStatus come from node 14; collection authorization comes from nodes 10/12; detailed coverage findings come from node 6; detailed mapping findings come from node 13. Never recompute these values. If machine manifest and human reports disagree, report evidence inconsistency rather than silently choosing.\n\nAlways state the exact Coverage Scope classification, policy, affected operations, regression floor, completeness claim, PASS/FAIL/UNAVAILABLE status and findings from node 6 case validation + coverage, plus node 13 traceability + correspondence. Affected-scope or affected-operations-full coverage must never be described as whole-API completeness unless every operation is explicitly listed. Their FAIL status does not block pytest, but it must remain visible and must never be rewritten as PASS.\n\nInclude environment, case quality/review, automation mapping, exact pytest facts, failure classification/analysis, risks, regression recommendations, evidence paths/hashes, coverage availability, and L-5 READY/NOT READY. Distinguish Markdown Case count, primary pytest symbol count, collected pytest item count, variant/assertion/cross-cutting Test Point counts and execution amplification; never describe pytest item count as the number of business scenarios.\n\nNever override Shell/pytest-html facts. L-5 requires pass=100%, AC=100%, automation>=90%, line>=80%, branch>=70%, skipped=0 and no blocking Critical risk.\n\nWrite only under docs/test-reports/**."
|
|
640
|
+
}
|
|
641
|
+
],
|
|
642
|
+
"sourceBinding": {
|
|
643
|
+
"schemaVersion": 1,
|
|
644
|
+
"taskId": "backend-test-template",
|
|
645
|
+
"sources": [
|
|
646
|
+
{
|
|
647
|
+
"kind": "requirement",
|
|
648
|
+
"path": "source/需求.md",
|
|
649
|
+
"sha256": "e33ab9d1d3d6a785b8f429d8581d015a299adc093b0c9a7c0f9057f968a71837"
|
|
650
|
+
}
|
|
651
|
+
],
|
|
652
|
+
"requirementIds": [
|
|
653
|
+
"AC-001"
|
|
654
|
+
]
|
|
655
|
+
},
|
|
656
|
+
"taskContractBinding": {
|
|
657
|
+
"schemaVersion": 1,
|
|
658
|
+
"taskId": "backend-test-template",
|
|
659
|
+
"revision": 1,
|
|
660
|
+
"projectionVersion": 1,
|
|
661
|
+
"canonicalizerVersion": 1,
|
|
662
|
+
"taskConfigSchemaVersion": 1,
|
|
663
|
+
"canonicalHash": "752c95f16925ee7711b41e465b8eb3530b99eaa40d17a88d753b3b4fcc7aeb6e",
|
|
664
|
+
"taskConfigSha256": "926c8986ce0b291d26af9ba1be8cf1630e647a06c362dac1d6bbac72e6df7bb0"
|
|
665
|
+
}
|
|
462
666
|
}
|