@tea-agent/loop-agent 0.26.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/CHANGELOG.md +1032 -1020
  2. package/README.md +8 -3
  3. package/bin/loop-agent.js +21 -21
  4. package/dist/cli/command-definitions.js +25 -10
  5. package/dist/cli/help.js +4 -3
  6. package/dist/cli/program.js +43 -17
  7. package/dist/commands/cursor-prompt.js +6 -6
  8. package/dist/commands/import-prd.js +7 -2
  9. package/dist/commands/init.js +7 -5
  10. package/dist/commands/loop-benchmark.js +11 -11
  11. package/dist/commands/pi-reuse-benchmark.js +16 -16
  12. package/dist/commands/task-source-prepare.js +468 -0
  13. package/dist/executors/dag-pi-executor.js +40 -5
  14. package/dist/executors/shell-write-guard.js +161 -25
  15. package/dist/sidecars/cursor-prompt/executor.js +1 -1
  16. package/dist/task/source-prepare/build-draft.js +215 -0
  17. package/dist/task/source-prepare/completeness.js +195 -0
  18. package/dist/task/source-prepare/index.js +7 -0
  19. package/dist/task/source-prepare/parse-intent.js +373 -0
  20. package/dist/task/source-prepare/path-policy.js +197 -0
  21. package/dist/task/source-prepare/prepare.js +506 -0
  22. package/dist/task/source-prepare/reference-integrity.js +274 -0
  23. package/dist/task/source-prepare/types.js +7 -0
  24. package/dist/worker/observe/static/copy.js +67 -67
  25. package/dist/worker/observe/static/dag-layout.d.ts +31 -31
  26. package/dist/worker/observe/static/dag-layout.js +83 -83
  27. package/dist/worker/observe/static/dom.js +220 -220
  28. package/dist/worker/observe/static/relations.js +133 -133
  29. package/dist/worker/observe/static/router.js +93 -93
  30. package/dist/worker/observe/static/run-processing.js +148 -148
  31. package/dist/worker/observe/static/views/batch.js +227 -227
  32. package/dist/worker/observe/static/views/dag-graph.js +172 -172
  33. package/dist/worker/observe/static/views/failures.js +143 -143
  34. package/dist/worker/observe/static/views/feature.js +492 -492
  35. package/dist/worker/observe/static/views/run.js +453 -453
  36. package/dist/worker/observe/static/views/shell.js +7 -7
  37. package/dist/worker/observe/static/views/timeline.js +163 -163
  38. package/dist/workflows/dag/canvas-observer.js +275 -275
  39. package/docs/skills/README.md +7 -7
  40. package/docs/templates/adr.md +60 -60
  41. package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -94
  42. package/docs/templates/agent-dag-decision-envelope.schema.json +213 -213
  43. package/docs/templates/agent-dag-decision-gate.prompt.md +246 -246
  44. package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -98
  45. package/docs/templates/agent-dag-report.schema.json +473 -473
  46. package/docs/templates/agent-dag-review-verdict.prompt.md +68 -68
  47. package/docs/templates/backend-test-result.schema.json +99 -99
  48. package/docs/templates/feature-spec.md +53 -53
  49. package/docs/templates/frontend-design-contract.md +42 -42
  50. package/docs/templates/frontend-eval/fixtures/failures/01-type-build-error.md +17 -17
  51. package/docs/templates/frontend-eval/fixtures/failures/02-unit-component-test-fail.md +16 -16
  52. package/docs/templates/frontend-eval/fixtures/failures/03-fixture-schema-drift.md +16 -16
  53. package/docs/templates/frontend-eval/fixtures/failures/04-missing-loading-empty-error-state.md +16 -16
  54. package/docs/templates/frontend-eval/fixtures/failures/05-forbidden-write-writeset-expansion.md +16 -16
  55. package/docs/templates/frontend-eval/fixtures/failures/06-unapproved-dependency-add.md +16 -16
  56. package/docs/templates/frontend-eval/fixtures/failures/07-mock-production-on.md +21 -21
  57. package/docs/templates/frontend-eval/fixtures/functional/01-simple-component-style.md +29 -29
  58. package/docs/templates/frontend-eval/fixtures/functional/02-form-validation.md +28 -28
  59. package/docs/templates/frontend-eval/fixtures/functional/03-list-detail-page.md +28 -28
  60. package/docs/templates/frontend-eval/fixtures/functional/04-api-mock.md +29 -29
  61. package/docs/templates/frontend-eval/fixtures/functional/05-permission-auth-gated-ui.md +27 -27
  62. package/docs/templates/frontend-eval/fixtures/functional/06-ssr-server-client-boundary.md +28 -28
  63. package/docs/templates/frontend-eval/fixtures/functional/07-shared-public-component-api.md +28 -28
  64. package/docs/templates/frontend-eval/fixtures/functional/08-pure-local-no-remote.md +27 -27
  65. package/docs/templates/frontend-eval/metrics.md +138 -138
  66. package/docs/templates/frontend-eval/smoke-targets.md +53 -53
  67. package/docs/templates/frontend-task-constraints.md +35 -35
  68. package/docs/templates/frontend-task-requirement.md +70 -70
  69. package/docs/templates/init-evolution-review.md +35 -35
  70. package/docs/templates/init-managed-agents.md +10 -5
  71. package/docs/templates/interactive-ui-round2-experiment.md +66 -66
  72. package/docs/templates/knowledge-graph-bootstrap-dag.json +118 -118
  73. package/docs/templates/knowledge-sync-dag.json +178 -178
  74. package/docs/templates/knowledge-sync-draft.schema.json +71 -71
  75. package/docs/templates/product-line/closeout.yaml +9 -9
  76. package/docs/templates/product-line/design.md +13 -13
  77. package/docs/templates/product-line/links.md +10 -10
  78. package/docs/templates/product-line/requirement.md +17 -17
  79. package/docs/templates/product-line/test-plan.md +7 -7
  80. package/docs/templates/production-readiness-checklist.md +57 -57
  81. package/docs/templates/project-start-checklist.md +9 -9
  82. package/docs/templates/qa-report.md +48 -48
  83. package/docs/templates/sprint-contract.md +29 -29
  84. package/docs/templates/worker-dogfood-evidence.md +80 -80
  85. package/docs/templates/worker-dogfood-setup.md +68 -68
  86. package/package.json +1 -1
  87. package/scripts/kb-bootstrap-init-skeleton.sh +0 -0
  88. package/scripts/kb-graph-incremental-prepare.mjs +386 -386
  89. package/scripts/kb-graph-materialize.mjs +105 -105
  90. package/scripts/kb-graph-promote.mjs +164 -164
  91. package/scripts/kb-query.mjs +554 -554
  92. package/skills/ai-engineering-context/SKILL.md +48 -48
  93. package/skills/analyze-product-dependencies/SKILL.md +67 -67
  94. package/skills/analyze-product-dependencies/agents/openai.yaml +4 -4
  95. package/skills/analyze-product-dependencies/references/api-documentation-schema.md +30 -30
  96. package/skills/analyze-product-dependencies/references/dependency-analysis-schema.md +28 -28
  97. package/skills/analyze-product-dependencies/references/example.md +76 -76
  98. package/skills/analyze-product-dependencies/references/forward-test-cases.md +35 -35
  99. package/skills/analyze-product-dependencies/references/input-contract.md +11 -11
  100. package/skills/analyze-product-dependencies/references/scouting-rules.md +61 -61
  101. package/skills/analyze-product-dependencies/scripts/test-validators.mjs +267 -267
  102. package/skills/analyze-product-dependencies/scripts/validate-api-documentation.mjs +101 -101
  103. package/skills/analyze-product-dependencies/scripts/validate-dependency-analysis.mjs +142 -142
  104. package/skills/analyze-product-dependencies/scripts/validate-product-requirement-input.mjs +76 -76
  105. package/skills/analyze-product-dependencies/scripts/validation-helpers.mjs +146 -146
  106. package/skills/analyze-product-requirements/SKILL.md +90 -90
  107. package/skills/analyze-product-requirements/agents/openai.yaml +4 -4
  108. package/skills/analyze-product-requirements/references/acceptance-criteria.md +91 -91
  109. package/skills/analyze-product-requirements/references/clarification-and-knowledge.md +56 -56
  110. package/skills/analyze-product-requirements/references/example.md +86 -86
  111. package/skills/analyze-product-requirements/references/forward-test-cases.md +66 -66
  112. package/skills/analyze-product-requirements/references/product-analysis-schema.md +32 -32
  113. package/skills/analyze-product-requirements/references/product-requirement-schema.md +33 -33
  114. package/skills/analyze-product-requirements/references/requirement-clarification-schema.md +35 -35
  115. package/skills/analyze-product-requirements/scripts/test-validators.mjs +193 -193
  116. package/skills/analyze-product-requirements/scripts/validate-product-analysis.mjs +69 -69
  117. package/skills/analyze-product-requirements/scripts/validate-product-requirement.mjs +97 -97
  118. package/skills/analyze-product-requirements/scripts/validate-requirement-clarification.mjs +98 -98
  119. package/skills/analyze-product-requirements/scripts/validation-helpers.mjs +156 -156
  120. package/skills/browser-tools/browser-content.js +103 -103
  121. package/skills/browser-tools/browser-cookies.js +35 -35
  122. package/skills/browser-tools/browser-eval.js +53 -53
  123. package/skills/browser-tools/browser-hn-scraper.js +108 -108
  124. package/skills/browser-tools/browser-nav.js +44 -44
  125. package/skills/browser-tools/browser-pick.js +162 -162
  126. package/skills/browser-tools/browser-screenshot.js +34 -34
  127. package/skills/browser-tools/browser-start.js +86 -86
  128. package/skills/browser-tools/package-lock.json +2556 -2556
  129. package/skills/browser-tools/package.json +19 -19
  130. package/skills/code-review-core/SKILL.md +20 -20
  131. package/skills/codebase-scout/SKILL.md +19 -19
  132. package/skills/grill-me/SKILL.md +10 -10
  133. package/skills/loop-agent/SKILL.md +5 -2
  134. package/skills/loop-agent/references/README.md +67 -67
  135. package/skills/loop-agent/references/command-reference.md +17 -15
  136. package/skills/loop-agent/references/docs-converge.md +126 -126
  137. package/skills/loop-agent/references/harness-policy.md +3 -4
  138. package/skills/loop-agent/references/learned/README.md +21 -21
  139. package/skills/loop-agent/references/long-running-loop.md +57 -57
  140. package/skills/loop-agent/references/one-shot-runs.md +85 -85
  141. package/skills/loop-agent/references/pi-prompt.md +23 -23
  142. package/skills/loop-agent/references/pi-subagent-assisted-mode.md +84 -84
  143. package/skills/loop-agent/references/post-implementation-and-patterns.md +1 -1
  144. package/skills/loop-agent/references/source-and-plan-practice.md +3 -2
  145. package/skills/loop-agent/references/task-workflow.md +7 -5
  146. package/skills/playwright-cli/SKILL.md +420 -420
  147. package/skills/playwright-cli/references/element-attributes.md +23 -23
  148. package/skills/playwright-cli/references/playwright-tests.md +39 -39
  149. package/skills/playwright-cli/references/request-mocking.md +87 -87
  150. package/skills/playwright-cli/references/running-code.md +241 -241
  151. package/skills/playwright-cli/references/session-management.md +225 -225
  152. package/skills/playwright-cli/references/storage-state.md +275 -275
  153. package/skills/playwright-cli/references/test-generation.md +433 -433
  154. package/skills/playwright-cli/references/tracing.md +139 -139
  155. package/skills/playwright-cli/references/video-recording.md +143 -143
  156. package/skills/requesting-code-review/SKILL.md +101 -101
  157. package/skills/requesting-code-review/code-reviewer.md +168 -168
  158. package/skills/systematic-debugging/CREATION-LOG.md +119 -119
  159. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -158
  160. package/skills/systematic-debugging/condition-based-waiting.md +115 -115
  161. package/skills/systematic-debugging/defense-in-depth.md +122 -122
  162. package/skills/systematic-debugging/find-polluter.sh +63 -63
  163. package/skills/systematic-debugging/root-cause-tracing.md +169 -169
  164. package/skills/systematic-debugging/test-academic.md +14 -14
  165. package/skills/systematic-debugging/test-pressure-1.md +58 -58
  166. package/skills/systematic-debugging/test-pressure-2.md +68 -68
  167. package/skills/systematic-debugging/test-pressure-3.md +69 -69
  168. package/skills/using-git-worktrees/SKILL.md +215 -215
  169. package/skills/verification-before-completion/SKILL.md +154 -154
  170. package/skills/webapp-testing/SKILL.md +19 -19
@@ -1,473 +1,473 @@
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": ["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
- "superseded",
407
- "abandoned"
408
- ]
409
- },
410
- "runDir": { "type": "string", "minLength": 1 },
411
- "startedAt": { "type": "string", "minLength": 1 },
412
- "finishedAt": { "type": "string" },
413
- "failureCategory": { "type": "string" },
414
- "normalizedFailureCategory": {
415
- "type": "string",
416
- "enum": [
417
- "success",
418
- "validation",
419
- "executor",
420
- "write-guard",
421
- "timeout",
422
- "auth",
423
- "human-required",
424
- "human-rejected",
425
- "shell-command",
426
- "static-error",
427
- "decision-envelope",
428
- "skipped",
429
- "unknown"
430
- ]
431
- },
432
- "productLineFailureCategory": {
433
- "$ref": "#/$defs/dagProductLineFailureCategory"
434
- },
435
- "recommendedFollowUp": { "type": "string" },
436
- "recoveryRecommendation": {
437
- "$ref": "#/$defs/dagRecoveryRecommendation"
438
- },
439
- "primaryFailure": { "$ref": "#/$defs/dagReportPrimaryFailure" },
440
- "primaryRecovery": { "$ref": "#/$defs/dagReportPrimaryRecovery" },
441
- "downstreamSkippedNodes": {
442
- "type": "array",
443
- "items": { "$ref": "#/$defs/dagReportDownstreamSkippedNode" }
444
- },
445
- "pausedByNodeId": { "type": "string" },
446
- "pauseReason": { "type": "string" },
447
- "controllerIdentity": {
448
- "type": "object",
449
- "additionalProperties": false,
450
- "required": ["status", "capturedAt", "runtimeContractCompatibility"],
451
- "properties": {
452
- "status": { "enum": ["pinned", "legacy-unpinned"] },
453
- "capturedAt": { "type": "string" },
454
- "packageName": { "type": "string" },
455
- "packageVersion": { "type": "string" },
456
- "packageFingerprint": { "type": "string" },
457
- "binarySha256": { "type": "string" },
458
- "runtimeContractCompatibility": {
459
- "enum": ["compatible", "incompatible", "legacy-unspecified"]
460
- },
461
- "runtimeContractReason": { "type": "string" }
462
- }
463
- },
464
- "executorJsonl": { "$ref": "#/$defs/dagArtifactRef" },
465
- "convergence": { "$ref": "#/$defs/dagConvergence" },
466
- "nodes": {
467
- "type": "array",
468
- "items": { "$ref": "#/$defs/dagNodeReportRow" }
469
- }
470
- }
471
- }
472
- }
473
- }
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": ["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
+ "superseded",
407
+ "abandoned"
408
+ ]
409
+ },
410
+ "runDir": { "type": "string", "minLength": 1 },
411
+ "startedAt": { "type": "string", "minLength": 1 },
412
+ "finishedAt": { "type": "string" },
413
+ "failureCategory": { "type": "string" },
414
+ "normalizedFailureCategory": {
415
+ "type": "string",
416
+ "enum": [
417
+ "success",
418
+ "validation",
419
+ "executor",
420
+ "write-guard",
421
+ "timeout",
422
+ "auth",
423
+ "human-required",
424
+ "human-rejected",
425
+ "shell-command",
426
+ "static-error",
427
+ "decision-envelope",
428
+ "skipped",
429
+ "unknown"
430
+ ]
431
+ },
432
+ "productLineFailureCategory": {
433
+ "$ref": "#/$defs/dagProductLineFailureCategory"
434
+ },
435
+ "recommendedFollowUp": { "type": "string" },
436
+ "recoveryRecommendation": {
437
+ "$ref": "#/$defs/dagRecoveryRecommendation"
438
+ },
439
+ "primaryFailure": { "$ref": "#/$defs/dagReportPrimaryFailure" },
440
+ "primaryRecovery": { "$ref": "#/$defs/dagReportPrimaryRecovery" },
441
+ "downstreamSkippedNodes": {
442
+ "type": "array",
443
+ "items": { "$ref": "#/$defs/dagReportDownstreamSkippedNode" }
444
+ },
445
+ "pausedByNodeId": { "type": "string" },
446
+ "pauseReason": { "type": "string" },
447
+ "controllerIdentity": {
448
+ "type": "object",
449
+ "additionalProperties": false,
450
+ "required": ["status", "capturedAt", "runtimeContractCompatibility"],
451
+ "properties": {
452
+ "status": { "enum": ["pinned", "legacy-unpinned"] },
453
+ "capturedAt": { "type": "string" },
454
+ "packageName": { "type": "string" },
455
+ "packageVersion": { "type": "string" },
456
+ "packageFingerprint": { "type": "string" },
457
+ "binarySha256": { "type": "string" },
458
+ "runtimeContractCompatibility": {
459
+ "enum": ["compatible", "incompatible", "legacy-unspecified"]
460
+ },
461
+ "runtimeContractReason": { "type": "string" }
462
+ }
463
+ },
464
+ "executorJsonl": { "$ref": "#/$defs/dagArtifactRef" },
465
+ "convergence": { "$ref": "#/$defs/dagConvergence" },
466
+ "nodes": {
467
+ "type": "array",
468
+ "items": { "$ref": "#/$defs/dagNodeReportRow" }
469
+ }
470
+ }
471
+ }
472
+ }
473
+ }