@tea-agent/loop-agent 0.7.5 → 0.8.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.
Files changed (127) hide show
  1. package/AGENTS.md +143 -142
  2. package/CHANGELOG.md +148 -164
  3. package/README.md +206 -204
  4. package/bin/agent-worker.js +22 -22
  5. package/bin/loop-agent.js +21 -21
  6. package/dist/commands/init.js +518 -488
  7. package/dist/commands/loop-benchmark.js +11 -11
  8. package/dist/commands/pi-reuse-benchmark.js +16 -16
  9. package/dist/executors/cursor-executor.js +1 -1
  10. package/dist/governance/manifest-types.js +1 -1
  11. package/dist/task/runtime.js +27 -27
  12. package/dist/worker/cli.js +3 -3
  13. package/dist/worker/observability/event-store.js +2 -1
  14. package/dist/worker/observability/read-model.js +13 -11
  15. package/dist/worker/observe/paths.js +2 -2
  16. package/dist/worker/observe/routes.js +4 -3
  17. package/dist/worker/observe/static/app.js +1479 -1480
  18. package/dist/worker/observe/static/dag-layout.d.ts +31 -31
  19. package/dist/worker/observe/static/dag-layout.js +83 -83
  20. package/dist/worker/observe/static/index.html +63 -63
  21. package/dist/worker/observe/static/styles.css +722 -722
  22. package/dist/worker/pool/run-store.js +7 -8
  23. package/dist/worker/run-task/run-task.js +11 -2
  24. package/dist/worker/runner/run-ready.js +1 -1
  25. package/dist/workflows/dag/canvas-observer.js +275 -275
  26. package/docs/README.md +80 -79
  27. package/docs/agent-dag-recovery-playbook.md +184 -184
  28. package/docs/agent-dag-runner.md +42 -42
  29. package/docs/architecture/runtime-boundaries.md +162 -162
  30. package/docs/cursor-executor-usage.md +25 -25
  31. package/docs/decisions/README.md +3 -3
  32. package/docs/design/README.md +49 -49
  33. package/docs/development-principles.md +73 -73
  34. package/docs/dynamic-workflow-dag-engine-roadmap.md +1749 -1749
  35. package/docs/exec-plans/README.md +6 -6
  36. package/docs/exec-plans/active/README.md +11 -11
  37. package/docs/exec-plans/completed/README.md +35 -34
  38. package/docs/feature-workflow.md +187 -187
  39. package/docs/harness-methodology-debugging.md +153 -153
  40. package/docs/harness-methodology-tdd.md +130 -130
  41. package/docs/harness-methodology-verification.md +27 -27
  42. package/docs/init-surface.manifest.json +245 -241
  43. package/docs/loop-agent-harness.md +63 -55
  44. package/docs/production-readiness.md +96 -96
  45. package/docs/progress/README.md +3 -3
  46. package/docs/reports/README.md +9 -9
  47. package/docs/skills/README.md +6 -6
  48. package/docs/skills/vetted-skill-registry.md +26 -26
  49. package/docs/templates/adr.md +60 -60
  50. package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -94
  51. package/docs/templates/agent-dag-decision-envelope.schema.json +213 -213
  52. package/docs/templates/agent-dag-decision-gate-dogfood-report.md +117 -117
  53. package/docs/templates/agent-dag-decision-gate.prompt.md +246 -246
  54. package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -98
  55. package/docs/templates/agent-dag-report.schema.json +454 -454
  56. package/docs/templates/agent-dag-review-verdict.prompt.md +68 -68
  57. package/docs/templates/agent-dag.base.json +195 -195
  58. package/docs/templates/agent-dag.final-verification.json +190 -190
  59. package/docs/templates/agent-dag.schema.json +316 -316
  60. package/docs/templates/agent-dag.supervised-implementation.json +500 -500
  61. package/docs/templates/exec-plan.md +64 -64
  62. package/docs/templates/feature-spec.md +53 -53
  63. package/docs/templates/harness.schema.json +218 -0
  64. package/docs/templates/hybrid-dag.json +193 -193
  65. package/docs/templates/init-evolution-review.md +33 -33
  66. package/docs/templates/interactive-ui-round2-experiment.md +66 -66
  67. package/docs/templates/product-line/AGENTS.md +8 -8
  68. package/docs/templates/product-line/README.md +9 -9
  69. package/docs/templates/product-line/acceptance.yaml +14 -14
  70. package/docs/templates/product-line/closeout.yaml +9 -9
  71. package/docs/templates/product-line/design.md +13 -13
  72. package/docs/templates/product-line/links.md +10 -10
  73. package/docs/templates/product-line/requirement.md +17 -17
  74. package/docs/templates/product-line/task-graph.yaml +15 -15
  75. package/docs/templates/product-line/task.yaml +65 -65
  76. package/docs/templates/product-line/test-plan.md +7 -7
  77. package/docs/templates/production-readiness-checklist.md +57 -57
  78. package/docs/templates/progress-log.md +17 -17
  79. package/docs/templates/project-start-checklist.md +9 -9
  80. package/docs/templates/qa-report.md +48 -48
  81. package/docs/templates/sprint-contract.md +29 -29
  82. package/docs/templates/worker-dogfood-evidence.md +52 -52
  83. package/docs/templates/worker-dogfood-setup.md +48 -48
  84. package/docs/verification-matrix.md +49 -49
  85. package/examples/decision-gate-agent-dag.json +123 -123
  86. package/examples/example-dag.json +51 -51
  87. package/examples/hybrid-loop-agent-dag.json +194 -194
  88. package/harness.json +73 -71
  89. package/package.json +68 -67
  90. package/scripts/check-product-line-docs.sh +22 -22
  91. package/scripts/check-task-pool-root.sh +32 -0
  92. package/skills/ai-engineering-context/SKILL.md +48 -48
  93. package/skills/code-review-core/SKILL.md +20 -20
  94. package/skills/codebase-scout/SKILL.md +19 -19
  95. package/skills/init-capability-evolution/SKILL.md +69 -69
  96. package/skills/loop-agent/SKILL.md +149 -149
  97. package/skills/loop-agent/references/README.md +67 -67
  98. package/skills/loop-agent/references/command-reference.md +432 -412
  99. package/skills/loop-agent/references/harness-policy.md +263 -263
  100. package/skills/loop-agent/references/hybrid-dag.md +216 -216
  101. package/skills/loop-agent/references/learned/README.md +21 -21
  102. package/skills/loop-agent/references/long-running-loop.md +59 -59
  103. package/skills/loop-agent/references/model-routing.md +36 -36
  104. package/skills/loop-agent/references/multi-worktree.md +54 -54
  105. package/skills/loop-agent/references/one-shot-runs.md +85 -85
  106. package/skills/loop-agent/references/orchestrator-and-interventions.md +169 -169
  107. package/skills/loop-agent/references/pi-prompt.md +23 -23
  108. package/skills/loop-agent/references/pi-subagent-assisted-mode.md +81 -81
  109. package/skills/loop-agent/references/post-implementation-and-patterns.md +44 -44
  110. package/skills/loop-agent/references/task-workflow.md +89 -89
  111. package/skills/loop-agent/references/verification-and-failure-handling.md +128 -128
  112. package/skills/requesting-code-review/SKILL.md +101 -101
  113. package/skills/requesting-code-review/code-reviewer.md +168 -168
  114. package/skills/systematic-debugging/CREATION-LOG.md +119 -119
  115. package/skills/systematic-debugging/SKILL.md +296 -296
  116. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -158
  117. package/skills/systematic-debugging/condition-based-waiting.md +115 -115
  118. package/skills/systematic-debugging/defense-in-depth.md +122 -122
  119. package/skills/systematic-debugging/find-polluter.sh +63 -63
  120. package/skills/systematic-debugging/root-cause-tracing.md +169 -169
  121. package/skills/systematic-debugging/test-academic.md +14 -14
  122. package/skills/systematic-debugging/test-pressure-1.md +58 -58
  123. package/skills/systematic-debugging/test-pressure-2.md +68 -68
  124. package/skills/systematic-debugging/test-pressure-3.md +69 -69
  125. package/skills/test-driven-development/SKILL.md +20 -20
  126. package/skills/verification-before-completion/SKILL.md +154 -154
  127. package/skills/webapp-testing/SKILL.md +19 -19
@@ -1,454 +1,454 @@
1
- {
2
- "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://loop-agent.local/schemas/agent-dag-report.schema.json",
4
- "title": "Agent DAG Report",
5
- "description": "Stable JSON contract for `dag report --json` output consumed by Decision Gate evidence builders and operator tooling. Derived read-only view over `.harness/dag-runs/` canonical facts; never mutates run state.",
6
- "type": "object",
7
- "additionalProperties": false,
8
- "required": ["schemaVersion", "runs"],
9
- "properties": {
10
- "schemaVersion": {
11
- "type": "integer",
12
- "const": 1,
13
- "description": "Report envelope schema version. Bump only when breaking stable fields."
14
- },
15
- "runs": {
16
- "type": "array",
17
- "items": { "$ref": "#/$defs/dagRunReportEntry" }
18
- }
19
- },
20
- "$defs": {
21
- "dagArtifactRef": {
22
- "type": "object",
23
- "additionalProperties": false,
24
- "required": ["path", "exists"],
25
- "properties": {
26
- "path": { "type": "string" },
27
- "exists": { "type": "boolean" }
28
- }
29
- },
30
- "dagRecoveryRecommendation": {
31
- "type": "object",
32
- "additionalProperties": false,
33
- "required": [
34
- "action",
35
- "summary",
36
- "reason",
37
- "humanRequired",
38
- "autoRetryEligible"
39
- ],
40
- "properties": {
41
- "action": {
42
- "type": "string",
43
- "enum": [
44
- "none",
45
- "monitor",
46
- "retry-node",
47
- "rerun-after-fix",
48
- "resume-or-reject",
49
- "manual-review",
50
- "inspect-upstream",
51
- "unknown"
52
- ]
53
- },
54
- "summary": { "type": "string" },
55
- "reason": { "type": "string" },
56
- "humanRequired": { "type": "boolean" },
57
- "autoRetryEligible": { "type": "boolean" },
58
- "commandHint": { "type": "string" }
59
- }
60
- },
61
- "dagProductLineFailureCategory": {
62
- "type": "string",
63
- "enum": [
64
- "SpecUnclear",
65
- "ContractMismatch",
66
- "ProductBug",
67
- "TestBug",
68
- "EnvFailure",
69
- "FlakyTest",
70
- "RiskyChange",
71
- "DependencyFailure",
72
- "NeedsHuman",
73
- "Unknown"
74
- ]
75
- },
76
- "dagReportPrimaryFailure": {
77
- "type": "object",
78
- "additionalProperties": false,
79
- "required": ["scope"],
80
- "properties": {
81
- "scope": { "type": "string", "enum": ["node", "run"] },
82
- "nodeId": { "type": "string" },
83
- "nodeStatus": {
84
- "type": "string",
85
- "enum": ["PENDING", "RUNNING", "FINISHED", "ERROR", "SKIPPED"]
86
- },
87
- "failureCategory": { "type": "string" },
88
- "normalizedFailureCategory": {
89
- "type": "string",
90
- "enum": [
91
- "success",
92
- "validation",
93
- "executor",
94
- "write-guard",
95
- "timeout",
96
- "auth",
97
- "human-required",
98
- "human-rejected",
99
- "shell-command",
100
- "static-error",
101
- "decision-envelope",
102
- "skipped",
103
- "unknown"
104
- ]
105
- },
106
- "productLineFailureCategory": {
107
- "$ref": "#/$defs/dagProductLineFailureCategory"
108
- },
109
- "recommendedFollowUp": { "type": "string" }
110
- }
111
- },
112
- "dagReportPrimaryRecovery": {
113
- "$ref": "#/$defs/dagRecoveryRecommendation"
114
- },
115
- "dagReportDownstreamSkippedNode": {
116
- "type": "object",
117
- "additionalProperties": false,
118
- "required": ["nodeId"],
119
- "properties": {
120
- "nodeId": { "type": "string" },
121
- "failureCategory": { "type": "string" },
122
- "normalizedFailureCategory": {
123
- "type": "string",
124
- "enum": [
125
- "success",
126
- "validation",
127
- "executor",
128
- "write-guard",
129
- "timeout",
130
- "auth",
131
- "human-required",
132
- "human-rejected",
133
- "shell-command",
134
- "static-error",
135
- "decision-envelope",
136
- "skipped",
137
- "unknown"
138
- ]
139
- },
140
- "productLineFailureCategory": {
141
- "$ref": "#/$defs/dagProductLineFailureCategory"
142
- },
143
- "recommendedFollowUp": { "type": "string" }
144
- }
145
- },
146
- "dagNodeDecisionEnvelope": {
147
- "type": "object",
148
- "additionalProperties": true,
149
- "required": ["parseOk"],
150
- "properties": {
151
- "parseOk": { "type": "boolean" },
152
- "decision": { "type": "string" },
153
- "requiresHuman": { "type": "boolean" },
154
- "nextAction": { "type": "string" },
155
- "riskLevel": { "type": "string" },
156
- "source": {
157
- "type": "string",
158
- "enum": ["assistantText", "resultSummaryFallback"]
159
- },
160
- "errors": {
161
- "type": "array",
162
- "items": { "type": "string" }
163
- }
164
- }
165
- },
166
- "dagNodeArtifactsReport": {
167
- "type": "object",
168
- "additionalProperties": false,
169
- "required": [
170
- "resultSummary",
171
- "promptRedacted",
172
- "skills",
173
- "nodeRecord",
174
- "decisionEnvelope",
175
- "decisionEnvelopeValidation",
176
- "humanEscalationJson",
177
- "humanEscalationMd",
178
- "humanApproval",
179
- "humanRejection"
180
- ],
181
- "properties": {
182
- "resultSummary": { "$ref": "#/$defs/dagArtifactRef" },
183
- "promptRedacted": { "$ref": "#/$defs/dagArtifactRef" },
184
- "skills": { "$ref": "#/$defs/dagArtifactRef" },
185
- "nodeRecord": { "$ref": "#/$defs/dagArtifactRef" },
186
- "decisionEnvelope": { "$ref": "#/$defs/dagArtifactRef" },
187
- "decisionEnvelopeValidation": { "$ref": "#/$defs/dagArtifactRef" },
188
- "humanEscalationJson": { "$ref": "#/$defs/dagArtifactRef" },
189
- "humanEscalationMd": { "$ref": "#/$defs/dagArtifactRef" },
190
- "humanApproval": { "$ref": "#/$defs/dagArtifactRef" },
191
- "humanRejection": { "$ref": "#/$defs/dagArtifactRef" }
192
- }
193
- },
194
- "repairArtifact": {
195
- "type": "object",
196
- "additionalProperties": false,
197
- "required": [
198
- "schemaVersion",
199
- "verdict",
200
- "failureClass",
201
- "rootCause",
202
- "fixScope",
203
- "invariant",
204
- "evidenceRefs",
205
- "rawLogFallbackAllowed"
206
- ],
207
- "properties": {
208
- "schemaVersion": { "type": "integer", "const": 1 },
209
- "verdict": {
210
- "type": "string",
211
- "enum": ["pass", "request-revision"]
212
- },
213
- "failureClass": {
214
- "type": "string",
215
- "enum": [
216
- "syntax",
217
- "runtime",
218
- "logic",
219
- "boundary",
220
- "environment",
221
- "governance",
222
- "unknown"
223
- ]
224
- },
225
- "rootCause": { "type": "string", "minLength": 1 },
226
- "fixScope": {
227
- "type": "array",
228
- "items": { "type": "string", "minLength": 1 }
229
- },
230
- "invariant": { "type": "string", "minLength": 1 },
231
- "evidenceRefs": {
232
- "type": "array",
233
- "items": { "type": "string", "minLength": 1 }
234
- },
235
- "rawLogFallbackAllowed": { "type": "boolean" }
236
- }
237
- },
238
- "dagConvergencePassArtifactRef": {
239
- "type": "object",
240
- "additionalProperties": false,
241
- "required": ["nodeId", "status"],
242
- "properties": {
243
- "nodeId": { "type": "string" },
244
- "status": {
245
- "type": "string",
246
- "enum": ["PENDING", "RUNNING", "FINISHED", "ERROR", "SKIPPED"]
247
- },
248
- "failureCategory": { "type": "string" },
249
- "nodeRecordPath": { "type": "string" },
250
- "stdoutArtifactPath": { "type": "string" },
251
- "assistantArtifactPath": { "type": "string" },
252
- "preservedNodeRecordPath": { "type": "string" },
253
- "preservedNodeDir": { "type": "string" }
254
- }
255
- },
256
- "dagConvergencePass": {
257
- "type": "object",
258
- "additionalProperties": false,
259
- "required": ["pass", "finishedAt", "status", "reason", "artifactRefs"],
260
- "properties": {
261
- "pass": { "type": "integer", "minimum": 1 },
262
- "startedAt": { "type": "string" },
263
- "finishedAt": { "type": "string" },
264
- "status": {
265
- "type": "string",
266
- "enum": ["retrying", "terminal", "paused"]
267
- },
268
- "reason": { "type": "string" },
269
- "hardVerifyStatus": {
270
- "type": "string",
271
- "enum": ["PENDING", "RUNNING", "FINISHED", "ERROR", "SKIPPED"]
272
- },
273
- "hardVerifyFailureCategory": { "type": "string" },
274
- "processVerdict": {
275
- "type": "string",
276
- "enum": ["pass", "request-revision", "unknown"]
277
- },
278
- "repairArtifact": { "$ref": "#/$defs/repairArtifact" },
279
- "verifyPhase": {
280
- "type": "string",
281
- "enum": ["intermediate", "final"]
282
- },
283
- "verifyQuota": {
284
- "type": "string",
285
- "enum": ["1", "3", "full"]
286
- },
287
- "verifyCommandCount": { "type": "integer", "minimum": 0 },
288
- "verifyCommandLabels": {
289
- "type": "array",
290
- "items": { "type": "string" }
291
- },
292
- "shellSuccessCount": { "type": "integer", "minimum": 0 },
293
- "artifactRefs": {
294
- "type": "array",
295
- "items": { "$ref": "#/$defs/dagConvergencePassArtifactRef" }
296
- }
297
- }
298
- },
299
- "dagConvergence": {
300
- "type": "object",
301
- "additionalProperties": false,
302
- "required": ["enabled", "maxPasses", "currentPass", "passHistory"],
303
- "properties": {
304
- "enabled": { "type": "boolean" },
305
- "maxPasses": { "type": "integer", "minimum": 1 },
306
- "currentPass": { "type": "integer", "minimum": 1 },
307
- "terminalReason": { "type": "string" },
308
- "passHistory": {
309
- "type": "array",
310
- "items": { "$ref": "#/$defs/dagConvergencePass" }
311
- }
312
- }
313
- },
314
- "dagNodeReportRow": {
315
- "type": "object",
316
- "additionalProperties": false,
317
- "required": [
318
- "nodeId",
319
- "rank",
320
- "order",
321
- "executor",
322
- "status",
323
- "artifacts"
324
- ],
325
- "properties": {
326
- "nodeId": { "type": "string" },
327
- "rank": { "type": "integer", "minimum": 0 },
328
- "order": { "type": "integer", "minimum": 0 },
329
- "executor": {
330
- "type": "string",
331
- "enum": ["cursor", "pi", "shell", "static"]
332
- },
333
- "model": { "type": "string" },
334
- "status": {
335
- "type": "string",
336
- "enum": ["PENDING", "RUNNING", "FINISHED", "ERROR", "SKIPPED"]
337
- },
338
- "durationMs": { "type": "number", "minimum": 0 },
339
- "tokensUsed": { "type": "number", "minimum": 0 },
340
- "failureCategory": { "type": "string" },
341
- "normalizedFailureCategory": {
342
- "type": "string",
343
- "enum": [
344
- "success",
345
- "validation",
346
- "executor",
347
- "write-guard",
348
- "timeout",
349
- "auth",
350
- "human-required",
351
- "human-rejected",
352
- "shell-command",
353
- "static-error",
354
- "decision-envelope",
355
- "skipped",
356
- "unknown"
357
- ]
358
- },
359
- "productLineFailureCategory": {
360
- "$ref": "#/$defs/dagProductLineFailureCategory"
361
- },
362
- "recommendedFollowUp": { "type": "string" },
363
- "recoveryRecommendation": {
364
- "$ref": "#/$defs/dagRecoveryRecommendation"
365
- },
366
- "backend": { "type": "string", "enum": ["sdk", "cli"] },
367
- "sdkAttempted": { "type": "boolean" },
368
- "startedAt": { "type": "string" },
369
- "finishedAt": { "type": "string" },
370
- "decisionEnvelope": { "$ref": "#/$defs/dagNodeDecisionEnvelope" },
371
- "artifacts": { "$ref": "#/$defs/dagNodeArtifactsReport" }
372
- }
373
- },
374
- "dagRunReportEntry": {
375
- "type": "object",
376
- "additionalProperties": false,
377
- "required": [
378
- "runId",
379
- "title",
380
- "lifecycle",
381
- "status",
382
- "runDir",
383
- "startedAt",
384
- "primaryFailure",
385
- "primaryRecovery",
386
- "downstreamSkippedNodes",
387
- "executorJsonl",
388
- "nodes"
389
- ],
390
- "properties": {
391
- "runId": { "type": "string", "minLength": 1 },
392
- "title": { "type": "string" },
393
- "lifecycle": {
394
- "type": "string",
395
- "enum": ["active", "paused", "completed"]
396
- },
397
- "status": {
398
- "type": "string",
399
- "enum": [
400
- "pending",
401
- "running",
402
- "finished",
403
- "partial_failed",
404
- "failed",
405
- "paused"
406
- ]
407
- },
408
- "runDir": { "type": "string", "minLength": 1 },
409
- "startedAt": { "type": "string", "minLength": 1 },
410
- "finishedAt": { "type": "string" },
411
- "failureCategory": { "type": "string" },
412
- "normalizedFailureCategory": {
413
- "type": "string",
414
- "enum": [
415
- "success",
416
- "validation",
417
- "executor",
418
- "write-guard",
419
- "timeout",
420
- "auth",
421
- "human-required",
422
- "human-rejected",
423
- "shell-command",
424
- "static-error",
425
- "decision-envelope",
426
- "skipped",
427
- "unknown"
428
- ]
429
- },
430
- "productLineFailureCategory": {
431
- "$ref": "#/$defs/dagProductLineFailureCategory"
432
- },
433
- "recommendedFollowUp": { "type": "string" },
434
- "recoveryRecommendation": {
435
- "$ref": "#/$defs/dagRecoveryRecommendation"
436
- },
437
- "primaryFailure": { "$ref": "#/$defs/dagReportPrimaryFailure" },
438
- "primaryRecovery": { "$ref": "#/$defs/dagReportPrimaryRecovery" },
439
- "downstreamSkippedNodes": {
440
- "type": "array",
441
- "items": { "$ref": "#/$defs/dagReportDownstreamSkippedNode" }
442
- },
443
- "pausedByNodeId": { "type": "string" },
444
- "pauseReason": { "type": "string" },
445
- "executorJsonl": { "$ref": "#/$defs/dagArtifactRef" },
446
- "convergence": { "$ref": "#/$defs/dagConvergence" },
447
- "nodes": {
448
- "type": "array",
449
- "items": { "$ref": "#/$defs/dagNodeReportRow" }
450
- }
451
- }
452
- }
453
- }
454
- }
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://loop-agent.local/schemas/agent-dag-report.schema.json",
4
+ "title": "Agent DAG Report",
5
+ "description": "Stable JSON contract for `dag report --json` output consumed by Decision Gate evidence builders and operator tooling. Derived read-only view over `.harness/dag-runs/` canonical facts; never mutates run state.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["schemaVersion", "runs"],
9
+ "properties": {
10
+ "schemaVersion": {
11
+ "type": "integer",
12
+ "const": 1,
13
+ "description": "Report envelope schema version. Bump only when breaking stable fields."
14
+ },
15
+ "runs": {
16
+ "type": "array",
17
+ "items": { "$ref": "#/$defs/dagRunReportEntry" }
18
+ }
19
+ },
20
+ "$defs": {
21
+ "dagArtifactRef": {
22
+ "type": "object",
23
+ "additionalProperties": false,
24
+ "required": ["path", "exists"],
25
+ "properties": {
26
+ "path": { "type": "string" },
27
+ "exists": { "type": "boolean" }
28
+ }
29
+ },
30
+ "dagRecoveryRecommendation": {
31
+ "type": "object",
32
+ "additionalProperties": false,
33
+ "required": [
34
+ "action",
35
+ "summary",
36
+ "reason",
37
+ "humanRequired",
38
+ "autoRetryEligible"
39
+ ],
40
+ "properties": {
41
+ "action": {
42
+ "type": "string",
43
+ "enum": [
44
+ "none",
45
+ "monitor",
46
+ "retry-node",
47
+ "rerun-after-fix",
48
+ "resume-or-reject",
49
+ "manual-review",
50
+ "inspect-upstream",
51
+ "unknown"
52
+ ]
53
+ },
54
+ "summary": { "type": "string" },
55
+ "reason": { "type": "string" },
56
+ "humanRequired": { "type": "boolean" },
57
+ "autoRetryEligible": { "type": "boolean" },
58
+ "commandHint": { "type": "string" }
59
+ }
60
+ },
61
+ "dagProductLineFailureCategory": {
62
+ "type": "string",
63
+ "enum": [
64
+ "SpecUnclear",
65
+ "ContractMismatch",
66
+ "ProductBug",
67
+ "TestBug",
68
+ "EnvFailure",
69
+ "FlakyTest",
70
+ "RiskyChange",
71
+ "DependencyFailure",
72
+ "NeedsHuman",
73
+ "Unknown"
74
+ ]
75
+ },
76
+ "dagReportPrimaryFailure": {
77
+ "type": "object",
78
+ "additionalProperties": false,
79
+ "required": ["scope"],
80
+ "properties": {
81
+ "scope": { "type": "string", "enum": ["node", "run"] },
82
+ "nodeId": { "type": "string" },
83
+ "nodeStatus": {
84
+ "type": "string",
85
+ "enum": ["PENDING", "RUNNING", "FINISHED", "ERROR", "SKIPPED"]
86
+ },
87
+ "failureCategory": { "type": "string" },
88
+ "normalizedFailureCategory": {
89
+ "type": "string",
90
+ "enum": [
91
+ "success",
92
+ "validation",
93
+ "executor",
94
+ "write-guard",
95
+ "timeout",
96
+ "auth",
97
+ "human-required",
98
+ "human-rejected",
99
+ "shell-command",
100
+ "static-error",
101
+ "decision-envelope",
102
+ "skipped",
103
+ "unknown"
104
+ ]
105
+ },
106
+ "productLineFailureCategory": {
107
+ "$ref": "#/$defs/dagProductLineFailureCategory"
108
+ },
109
+ "recommendedFollowUp": { "type": "string" }
110
+ }
111
+ },
112
+ "dagReportPrimaryRecovery": {
113
+ "$ref": "#/$defs/dagRecoveryRecommendation"
114
+ },
115
+ "dagReportDownstreamSkippedNode": {
116
+ "type": "object",
117
+ "additionalProperties": false,
118
+ "required": ["nodeId"],
119
+ "properties": {
120
+ "nodeId": { "type": "string" },
121
+ "failureCategory": { "type": "string" },
122
+ "normalizedFailureCategory": {
123
+ "type": "string",
124
+ "enum": [
125
+ "success",
126
+ "validation",
127
+ "executor",
128
+ "write-guard",
129
+ "timeout",
130
+ "auth",
131
+ "human-required",
132
+ "human-rejected",
133
+ "shell-command",
134
+ "static-error",
135
+ "decision-envelope",
136
+ "skipped",
137
+ "unknown"
138
+ ]
139
+ },
140
+ "productLineFailureCategory": {
141
+ "$ref": "#/$defs/dagProductLineFailureCategory"
142
+ },
143
+ "recommendedFollowUp": { "type": "string" }
144
+ }
145
+ },
146
+ "dagNodeDecisionEnvelope": {
147
+ "type": "object",
148
+ "additionalProperties": true,
149
+ "required": ["parseOk"],
150
+ "properties": {
151
+ "parseOk": { "type": "boolean" },
152
+ "decision": { "type": "string" },
153
+ "requiresHuman": { "type": "boolean" },
154
+ "nextAction": { "type": "string" },
155
+ "riskLevel": { "type": "string" },
156
+ "source": {
157
+ "type": "string",
158
+ "enum": ["assistantText", "resultSummaryFallback"]
159
+ },
160
+ "errors": {
161
+ "type": "array",
162
+ "items": { "type": "string" }
163
+ }
164
+ }
165
+ },
166
+ "dagNodeArtifactsReport": {
167
+ "type": "object",
168
+ "additionalProperties": false,
169
+ "required": [
170
+ "resultSummary",
171
+ "promptRedacted",
172
+ "skills",
173
+ "nodeRecord",
174
+ "decisionEnvelope",
175
+ "decisionEnvelopeValidation",
176
+ "humanEscalationJson",
177
+ "humanEscalationMd",
178
+ "humanApproval",
179
+ "humanRejection"
180
+ ],
181
+ "properties": {
182
+ "resultSummary": { "$ref": "#/$defs/dagArtifactRef" },
183
+ "promptRedacted": { "$ref": "#/$defs/dagArtifactRef" },
184
+ "skills": { "$ref": "#/$defs/dagArtifactRef" },
185
+ "nodeRecord": { "$ref": "#/$defs/dagArtifactRef" },
186
+ "decisionEnvelope": { "$ref": "#/$defs/dagArtifactRef" },
187
+ "decisionEnvelopeValidation": { "$ref": "#/$defs/dagArtifactRef" },
188
+ "humanEscalationJson": { "$ref": "#/$defs/dagArtifactRef" },
189
+ "humanEscalationMd": { "$ref": "#/$defs/dagArtifactRef" },
190
+ "humanApproval": { "$ref": "#/$defs/dagArtifactRef" },
191
+ "humanRejection": { "$ref": "#/$defs/dagArtifactRef" }
192
+ }
193
+ },
194
+ "repairArtifact": {
195
+ "type": "object",
196
+ "additionalProperties": false,
197
+ "required": [
198
+ "schemaVersion",
199
+ "verdict",
200
+ "failureClass",
201
+ "rootCause",
202
+ "fixScope",
203
+ "invariant",
204
+ "evidenceRefs",
205
+ "rawLogFallbackAllowed"
206
+ ],
207
+ "properties": {
208
+ "schemaVersion": { "type": "integer", "const": 1 },
209
+ "verdict": {
210
+ "type": "string",
211
+ "enum": ["pass", "request-revision"]
212
+ },
213
+ "failureClass": {
214
+ "type": "string",
215
+ "enum": [
216
+ "syntax",
217
+ "runtime",
218
+ "logic",
219
+ "boundary",
220
+ "environment",
221
+ "governance",
222
+ "unknown"
223
+ ]
224
+ },
225
+ "rootCause": { "type": "string", "minLength": 1 },
226
+ "fixScope": {
227
+ "type": "array",
228
+ "items": { "type": "string", "minLength": 1 }
229
+ },
230
+ "invariant": { "type": "string", "minLength": 1 },
231
+ "evidenceRefs": {
232
+ "type": "array",
233
+ "items": { "type": "string", "minLength": 1 }
234
+ },
235
+ "rawLogFallbackAllowed": { "type": "boolean" }
236
+ }
237
+ },
238
+ "dagConvergencePassArtifactRef": {
239
+ "type": "object",
240
+ "additionalProperties": false,
241
+ "required": ["nodeId", "status"],
242
+ "properties": {
243
+ "nodeId": { "type": "string" },
244
+ "status": {
245
+ "type": "string",
246
+ "enum": ["PENDING", "RUNNING", "FINISHED", "ERROR", "SKIPPED"]
247
+ },
248
+ "failureCategory": { "type": "string" },
249
+ "nodeRecordPath": { "type": "string" },
250
+ "stdoutArtifactPath": { "type": "string" },
251
+ "assistantArtifactPath": { "type": "string" },
252
+ "preservedNodeRecordPath": { "type": "string" },
253
+ "preservedNodeDir": { "type": "string" }
254
+ }
255
+ },
256
+ "dagConvergencePass": {
257
+ "type": "object",
258
+ "additionalProperties": false,
259
+ "required": ["pass", "finishedAt", "status", "reason", "artifactRefs"],
260
+ "properties": {
261
+ "pass": { "type": "integer", "minimum": 1 },
262
+ "startedAt": { "type": "string" },
263
+ "finishedAt": { "type": "string" },
264
+ "status": {
265
+ "type": "string",
266
+ "enum": ["retrying", "terminal", "paused"]
267
+ },
268
+ "reason": { "type": "string" },
269
+ "hardVerifyStatus": {
270
+ "type": "string",
271
+ "enum": ["PENDING", "RUNNING", "FINISHED", "ERROR", "SKIPPED"]
272
+ },
273
+ "hardVerifyFailureCategory": { "type": "string" },
274
+ "processVerdict": {
275
+ "type": "string",
276
+ "enum": ["pass", "request-revision", "unknown"]
277
+ },
278
+ "repairArtifact": { "$ref": "#/$defs/repairArtifact" },
279
+ "verifyPhase": {
280
+ "type": "string",
281
+ "enum": ["intermediate", "final"]
282
+ },
283
+ "verifyQuota": {
284
+ "type": "string",
285
+ "enum": ["1", "3", "full"]
286
+ },
287
+ "verifyCommandCount": { "type": "integer", "minimum": 0 },
288
+ "verifyCommandLabels": {
289
+ "type": "array",
290
+ "items": { "type": "string" }
291
+ },
292
+ "shellSuccessCount": { "type": "integer", "minimum": 0 },
293
+ "artifactRefs": {
294
+ "type": "array",
295
+ "items": { "$ref": "#/$defs/dagConvergencePassArtifactRef" }
296
+ }
297
+ }
298
+ },
299
+ "dagConvergence": {
300
+ "type": "object",
301
+ "additionalProperties": false,
302
+ "required": ["enabled", "maxPasses", "currentPass", "passHistory"],
303
+ "properties": {
304
+ "enabled": { "type": "boolean" },
305
+ "maxPasses": { "type": "integer", "minimum": 1 },
306
+ "currentPass": { "type": "integer", "minimum": 1 },
307
+ "terminalReason": { "type": "string" },
308
+ "passHistory": {
309
+ "type": "array",
310
+ "items": { "$ref": "#/$defs/dagConvergencePass" }
311
+ }
312
+ }
313
+ },
314
+ "dagNodeReportRow": {
315
+ "type": "object",
316
+ "additionalProperties": false,
317
+ "required": [
318
+ "nodeId",
319
+ "rank",
320
+ "order",
321
+ "executor",
322
+ "status",
323
+ "artifacts"
324
+ ],
325
+ "properties": {
326
+ "nodeId": { "type": "string" },
327
+ "rank": { "type": "integer", "minimum": 0 },
328
+ "order": { "type": "integer", "minimum": 0 },
329
+ "executor": {
330
+ "type": "string",
331
+ "enum": ["cursor", "pi", "shell", "static"]
332
+ },
333
+ "model": { "type": "string" },
334
+ "status": {
335
+ "type": "string",
336
+ "enum": ["PENDING", "RUNNING", "FINISHED", "ERROR", "SKIPPED"]
337
+ },
338
+ "durationMs": { "type": "number", "minimum": 0 },
339
+ "tokensUsed": { "type": "number", "minimum": 0 },
340
+ "failureCategory": { "type": "string" },
341
+ "normalizedFailureCategory": {
342
+ "type": "string",
343
+ "enum": [
344
+ "success",
345
+ "validation",
346
+ "executor",
347
+ "write-guard",
348
+ "timeout",
349
+ "auth",
350
+ "human-required",
351
+ "human-rejected",
352
+ "shell-command",
353
+ "static-error",
354
+ "decision-envelope",
355
+ "skipped",
356
+ "unknown"
357
+ ]
358
+ },
359
+ "productLineFailureCategory": {
360
+ "$ref": "#/$defs/dagProductLineFailureCategory"
361
+ },
362
+ "recommendedFollowUp": { "type": "string" },
363
+ "recoveryRecommendation": {
364
+ "$ref": "#/$defs/dagRecoveryRecommendation"
365
+ },
366
+ "backend": { "type": "string", "enum": ["sdk", "cli"] },
367
+ "sdkAttempted": { "type": "boolean" },
368
+ "startedAt": { "type": "string" },
369
+ "finishedAt": { "type": "string" },
370
+ "decisionEnvelope": { "$ref": "#/$defs/dagNodeDecisionEnvelope" },
371
+ "artifacts": { "$ref": "#/$defs/dagNodeArtifactsReport" }
372
+ }
373
+ },
374
+ "dagRunReportEntry": {
375
+ "type": "object",
376
+ "additionalProperties": false,
377
+ "required": [
378
+ "runId",
379
+ "title",
380
+ "lifecycle",
381
+ "status",
382
+ "runDir",
383
+ "startedAt",
384
+ "primaryFailure",
385
+ "primaryRecovery",
386
+ "downstreamSkippedNodes",
387
+ "executorJsonl",
388
+ "nodes"
389
+ ],
390
+ "properties": {
391
+ "runId": { "type": "string", "minLength": 1 },
392
+ "title": { "type": "string" },
393
+ "lifecycle": {
394
+ "type": "string",
395
+ "enum": ["active", "paused", "completed"]
396
+ },
397
+ "status": {
398
+ "type": "string",
399
+ "enum": [
400
+ "pending",
401
+ "running",
402
+ "finished",
403
+ "partial_failed",
404
+ "failed",
405
+ "paused"
406
+ ]
407
+ },
408
+ "runDir": { "type": "string", "minLength": 1 },
409
+ "startedAt": { "type": "string", "minLength": 1 },
410
+ "finishedAt": { "type": "string" },
411
+ "failureCategory": { "type": "string" },
412
+ "normalizedFailureCategory": {
413
+ "type": "string",
414
+ "enum": [
415
+ "success",
416
+ "validation",
417
+ "executor",
418
+ "write-guard",
419
+ "timeout",
420
+ "auth",
421
+ "human-required",
422
+ "human-rejected",
423
+ "shell-command",
424
+ "static-error",
425
+ "decision-envelope",
426
+ "skipped",
427
+ "unknown"
428
+ ]
429
+ },
430
+ "productLineFailureCategory": {
431
+ "$ref": "#/$defs/dagProductLineFailureCategory"
432
+ },
433
+ "recommendedFollowUp": { "type": "string" },
434
+ "recoveryRecommendation": {
435
+ "$ref": "#/$defs/dagRecoveryRecommendation"
436
+ },
437
+ "primaryFailure": { "$ref": "#/$defs/dagReportPrimaryFailure" },
438
+ "primaryRecovery": { "$ref": "#/$defs/dagReportPrimaryRecovery" },
439
+ "downstreamSkippedNodes": {
440
+ "type": "array",
441
+ "items": { "$ref": "#/$defs/dagReportDownstreamSkippedNode" }
442
+ },
443
+ "pausedByNodeId": { "type": "string" },
444
+ "pauseReason": { "type": "string" },
445
+ "executorJsonl": { "$ref": "#/$defs/dagArtifactRef" },
446
+ "convergence": { "$ref": "#/$defs/dagConvergence" },
447
+ "nodes": {
448
+ "type": "array",
449
+ "items": { "$ref": "#/$defs/dagNodeReportRow" }
450
+ }
451
+ }
452
+ }
453
+ }
454
+ }