@tea-agent/loop-agent 0.13.0 → 0.15.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 (272) hide show
  1. package/AGENTS.md +157 -157
  2. package/CHANGELOG.md +116 -305
  3. package/README.md +357 -334
  4. package/bin/agent-worker.js +22 -22
  5. package/bin/loop-agent.js +21 -21
  6. package/dist/commands/cursor-prompt.js +6 -6
  7. package/dist/commands/init.js +505 -505
  8. package/dist/commands/loop-benchmark.js +11 -11
  9. package/dist/commands/pi-reuse-benchmark.js +16 -16
  10. package/dist/executors/pi-event-serializer.js +33 -11
  11. package/dist/sidecars/cursor-prompt/executor.js +1 -1
  12. package/dist/task/runtime.js +27 -27
  13. package/dist/worker/observe/spec-evidence.js +19 -10
  14. package/dist/worker/observe/static/api.js +46 -46
  15. package/dist/worker/observe/static/app.js +151 -150
  16. package/dist/worker/observe/static/constants.js +156 -148
  17. package/dist/worker/observe/static/copy.js +67 -67
  18. package/dist/worker/observe/static/dag-helpers.js +201 -172
  19. package/dist/worker/observe/static/dag-layout.d.ts +31 -31
  20. package/dist/worker/observe/static/dag-layout.js +83 -83
  21. package/dist/worker/observe/static/dag-model.js +72 -72
  22. package/dist/worker/observe/static/dom.js +122 -122
  23. package/dist/worker/observe/static/format-pool.d.ts +71 -0
  24. package/dist/worker/observe/static/format-pool.js +134 -67
  25. package/dist/worker/observe/static/format.js +317 -292
  26. package/dist/worker/observe/static/index.html +350 -308
  27. package/dist/worker/observe/static/kpi.js +100 -94
  28. package/dist/worker/observe/static/markdown-render.js +124 -0
  29. package/dist/worker/observe/static/relations.js +133 -133
  30. package/dist/worker/observe/static/router.js +93 -93
  31. package/dist/worker/observe/static/run-processing.js +148 -148
  32. package/dist/worker/observe/static/shell-chrome.js +74 -68
  33. package/dist/worker/observe/static/state.js +273 -267
  34. package/dist/worker/observe/static/styles.css +2504 -1902
  35. package/dist/worker/observe/static/views/batch.js +227 -227
  36. package/dist/worker/observe/static/views/dag-graph.js +172 -172
  37. package/dist/worker/observe/static/views/dag-inspector.js +530 -627
  38. package/dist/worker/observe/static/views/dag.js +371 -371
  39. package/dist/worker/observe/static/views/dashboard.js +86 -100
  40. package/dist/worker/observe/static/views/failures.js +143 -143
  41. package/dist/worker/observe/static/views/feature.js +492 -492
  42. package/dist/worker/observe/static/views/pool.js +708 -350
  43. package/dist/worker/observe/static/views/run.js +453 -453
  44. package/dist/worker/observe/static/views/session-timeline.js +771 -219
  45. package/dist/worker/observe/static/views/shell.js +7 -7
  46. package/dist/worker/observe/static/views/task.js +314 -314
  47. package/dist/worker/observe/static/views/timeline.js +163 -163
  48. package/dist/workflows/dag/canvas-observer.js +275 -275
  49. package/dist/workflows/dag/init-hybrid.js +27 -11
  50. package/docs/README.md +106 -104
  51. package/docs/architecture/README.md +26 -26
  52. package/docs/architecture/dag-execution.md +140 -140
  53. package/docs/architecture/evolution.md +54 -54
  54. package/docs/architecture/facts-and-state.md +71 -71
  55. package/docs/architecture/runtime-boundaries.md +191 -191
  56. package/docs/architecture/system-overview.md +93 -93
  57. package/docs/architecture/worker-and-feature.md +85 -85
  58. package/docs/harness-methodology-debugging.md +153 -153
  59. package/docs/harness-methodology-tdd.md +130 -130
  60. package/docs/harness-methodology-verification.md +27 -27
  61. package/docs/init-surface.manifest.json +304 -307
  62. package/docs/skills/README.md +7 -7
  63. package/docs/skills/vetted-skill-registry.md +29 -29
  64. package/docs/templates/adr.md +60 -60
  65. package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -94
  66. package/docs/templates/agent-dag-decision-envelope.schema.json +213 -213
  67. package/docs/templates/agent-dag-decision-gate-dogfood-report.md +117 -117
  68. package/docs/templates/agent-dag-decision-gate.prompt.md +246 -246
  69. package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -98
  70. package/docs/templates/agent-dag-report.schema.json +473 -473
  71. package/docs/templates/agent-dag-review-verdict.prompt.md +68 -68
  72. package/docs/templates/agent-dag.base.json +190 -190
  73. package/docs/templates/agent-dag.final-verification.json +185 -185
  74. package/docs/templates/agent-dag.schema.json +411 -411
  75. package/docs/templates/agent-dag.supervised-implementation.json +620 -620
  76. package/docs/templates/backend-test-analysis.schema.json +44 -44
  77. package/docs/templates/backend-test-case-manifest.schema.json +190 -190
  78. package/docs/templates/backend-test-dag.classify.prompt.md +75 -75
  79. package/docs/templates/backend-test-dag.generate-pytest.prompt.md +204 -204
  80. package/docs/templates/backend-test-dag.json +559 -559
  81. package/docs/templates/backend-test-dag.retrospect.prompt.md +139 -139
  82. package/docs/templates/backend-test-dag.review-cases.prompt.md +83 -83
  83. package/docs/templates/backend-test-execution.schema.json +133 -133
  84. package/docs/templates/backend-test-result.schema.json +99 -99
  85. package/docs/templates/branch-merge-report.md +0 -1
  86. package/docs/templates/exec-plan.md +64 -64
  87. package/docs/templates/feature-spec.md +53 -53
  88. package/docs/templates/frontend-design-contract.md +42 -42
  89. package/docs/templates/frontend-eval/fixtures/failures/01-type-build-error.md +17 -17
  90. package/docs/templates/frontend-eval/fixtures/failures/02-unit-component-test-fail.md +16 -16
  91. package/docs/templates/frontend-eval/fixtures/failures/03-fixture-schema-drift.md +16 -16
  92. package/docs/templates/frontend-eval/fixtures/failures/04-missing-loading-empty-error-state.md +16 -16
  93. package/docs/templates/frontend-eval/fixtures/failures/05-forbidden-write-writeset-expansion.md +16 -16
  94. package/docs/templates/frontend-eval/fixtures/failures/06-unapproved-dependency-add.md +16 -16
  95. package/docs/templates/frontend-eval/fixtures/failures/07-mock-production-on.md +21 -21
  96. package/docs/templates/frontend-eval/fixtures/functional/01-simple-component-style.md +29 -29
  97. package/docs/templates/frontend-eval/fixtures/functional/02-form-validation.md +28 -28
  98. package/docs/templates/frontend-eval/fixtures/functional/03-list-detail-page.md +28 -28
  99. package/docs/templates/frontend-eval/fixtures/functional/04-api-mock.md +29 -29
  100. package/docs/templates/frontend-eval/fixtures/functional/05-permission-auth-gated-ui.md +27 -27
  101. package/docs/templates/frontend-eval/fixtures/functional/06-ssr-server-client-boundary.md +28 -28
  102. package/docs/templates/frontend-eval/fixtures/functional/07-shared-public-component-api.md +28 -28
  103. package/docs/templates/frontend-eval/fixtures/functional/08-pure-local-no-remote.md +27 -27
  104. package/docs/templates/frontend-eval/metrics.md +138 -138
  105. package/docs/templates/frontend-eval/smoke-targets.md +53 -53
  106. package/docs/templates/frontend-implementation-contract.schema.json +27 -27
  107. package/docs/templates/frontend-task-constraints.md +35 -35
  108. package/docs/templates/frontend-task-requirement.md +70 -70
  109. package/docs/templates/frontend-test-dag.generate-cases.prompt.md +5 -5
  110. package/docs/templates/frontend-test-dag.json +23 -23
  111. package/docs/templates/frontend-test-dag.retrieve-context.prompt.md +3 -3
  112. package/docs/templates/frontend-test-dag.retrospect.prompt.md +3 -3
  113. package/docs/templates/frontend-test-dag.review-cases.prompt.md +3 -3
  114. package/docs/templates/frontend-test-dag.review-execution.prompt.md +3 -3
  115. package/docs/templates/harness.schema.json +221 -221
  116. package/docs/templates/hybrid-dag.json +188 -188
  117. package/docs/templates/init-evolution-review.md +35 -35
  118. package/docs/templates/interactive-ui-round2-experiment.md +66 -66
  119. package/docs/templates/knowledge-graph-bootstrap-dag.json +118 -118
  120. package/docs/templates/knowledge-sync-dag.json +178 -178
  121. package/docs/templates/knowledge-sync-draft.schema.json +71 -71
  122. package/docs/templates/product-line/AGENTS.md +8 -8
  123. package/docs/templates/product-line/README.md +9 -9
  124. package/docs/templates/product-line/acceptance.yaml +14 -14
  125. package/docs/templates/product-line/closeout.yaml +9 -9
  126. package/docs/templates/product-line/design.md +13 -13
  127. package/docs/templates/product-line/links.md +10 -10
  128. package/docs/templates/product-line/requirement.md +17 -17
  129. package/docs/templates/product-line/task-graph.yaml +15 -15
  130. package/docs/templates/product-line/task.yaml +64 -64
  131. package/docs/templates/product-line/test-plan.md +7 -7
  132. package/docs/templates/production-readiness-checklist.md +57 -57
  133. package/docs/templates/progress-log.md +17 -17
  134. package/docs/templates/project-start-checklist.md +9 -9
  135. package/docs/templates/qa-report.md +48 -48
  136. package/docs/templates/sprint-contract.md +29 -29
  137. package/docs/templates/worker-dogfood-evidence.md +80 -80
  138. package/docs/templates/worker-dogfood-setup.md +68 -68
  139. package/examples/decision-gate-agent-dag.json +173 -173
  140. package/examples/example-dag.json +46 -46
  141. package/examples/hybrid-loop-agent-dag.json +188 -188
  142. package/harness.json +66 -66
  143. package/package.json +78 -52
  144. package/scripts/kb-bootstrap-init-skeleton.sh +240 -240
  145. package/scripts/kb-graph-incremental-prepare.mjs +386 -386
  146. package/scripts/kb-graph-materialize.mjs +105 -105
  147. package/scripts/kb-graph-promote.mjs +164 -164
  148. package/scripts/kb-query.mjs +554 -554
  149. package/skills/agent-worker/SKILL.md +39 -39
  150. package/skills/agent-worker/references/agent-worker-operator.md +60 -60
  151. package/skills/ai-engineering-context/SKILL.md +48 -48
  152. package/skills/analyze-product-dependencies/SKILL.md +67 -67
  153. package/skills/analyze-product-dependencies/agents/openai.yaml +4 -4
  154. package/skills/analyze-product-dependencies/references/api-documentation-schema.md +30 -30
  155. package/skills/analyze-product-dependencies/references/dependency-analysis-schema.md +28 -28
  156. package/skills/analyze-product-dependencies/references/example.md +76 -76
  157. package/skills/analyze-product-dependencies/references/forward-test-cases.md +35 -35
  158. package/skills/analyze-product-dependencies/references/input-contract.md +11 -11
  159. package/skills/analyze-product-dependencies/references/scouting-rules.md +61 -61
  160. package/skills/analyze-product-dependencies/scripts/test-validators.mjs +267 -267
  161. package/skills/analyze-product-dependencies/scripts/validate-api-documentation.mjs +101 -101
  162. package/skills/analyze-product-dependencies/scripts/validate-dependency-analysis.mjs +142 -142
  163. package/skills/analyze-product-dependencies/scripts/validate-product-requirement-input.mjs +76 -76
  164. package/skills/analyze-product-dependencies/scripts/validation-helpers.mjs +146 -146
  165. package/skills/analyze-product-requirements/SKILL.md +90 -90
  166. package/skills/analyze-product-requirements/agents/openai.yaml +4 -4
  167. package/skills/analyze-product-requirements/references/acceptance-criteria.md +91 -91
  168. package/skills/analyze-product-requirements/references/clarification-and-knowledge.md +56 -56
  169. package/skills/analyze-product-requirements/references/example.md +86 -86
  170. package/skills/analyze-product-requirements/references/forward-test-cases.md +66 -66
  171. package/skills/analyze-product-requirements/references/product-analysis-schema.md +32 -32
  172. package/skills/analyze-product-requirements/references/product-requirement-schema.md +33 -33
  173. package/skills/analyze-product-requirements/references/requirement-clarification-schema.md +35 -35
  174. package/skills/analyze-product-requirements/scripts/test-validators.mjs +193 -193
  175. package/skills/analyze-product-requirements/scripts/validate-product-analysis.mjs +69 -69
  176. package/skills/analyze-product-requirements/scripts/validate-product-requirement.mjs +97 -97
  177. package/skills/analyze-product-requirements/scripts/validate-requirement-clarification.mjs +98 -98
  178. package/skills/analyze-product-requirements/scripts/validation-helpers.mjs +156 -156
  179. package/skills/browser-tools/SKILL.md +196 -196
  180. package/skills/browser-tools/browser-content.js +103 -103
  181. package/skills/browser-tools/browser-cookies.js +35 -35
  182. package/skills/browser-tools/browser-eval.js +53 -53
  183. package/skills/browser-tools/browser-hn-scraper.js +108 -108
  184. package/skills/browser-tools/browser-nav.js +44 -44
  185. package/skills/browser-tools/browser-pick.js +162 -162
  186. package/skills/browser-tools/browser-screenshot.js +34 -34
  187. package/skills/browser-tools/browser-start.js +86 -86
  188. package/skills/browser-tools/package-lock.json +2556 -2556
  189. package/skills/browser-tools/package.json +19 -19
  190. package/skills/code-review-core/SKILL.md +20 -20
  191. package/skills/codebase-scout/SKILL.md +19 -19
  192. package/skills/frontend-design-review/SKILL.md +66 -66
  193. package/skills/frontend-design-review/references/review-checklist.md +40 -58
  194. package/skills/frontend-implementation/SKILL.md +49 -49
  195. package/skills/frontend-implementation/references/code-standards.md +32 -32
  196. package/skills/frontend-implementation/references/design-spec.md +46 -46
  197. package/skills/frontend-implementation/references/node-contracts.md +27 -27
  198. package/skills/frontend-review/SKILL.md +61 -59
  199. package/skills/frontend-review/references/review-findings.md +48 -47
  200. package/skills/frontend-verification/SKILL.md +55 -53
  201. package/skills/frontend-verification/references/verification-checklist.md +59 -68
  202. package/skills/grill-me/SKILL.md +10 -10
  203. package/skills/grill-with-docs/SKILL.md +88 -88
  204. package/skills/grill-with-docs/adr-format.md +47 -47
  205. package/skills/grill-with-docs/context-format.md +60 -60
  206. package/skills/init-capability-evolution/SKILL.md +70 -70
  207. package/skills/loop-agent/SKILL.md +151 -151
  208. package/skills/loop-agent/references/README.md +67 -67
  209. package/skills/loop-agent/references/command-reference.md +527 -527
  210. package/skills/loop-agent/references/docs-converge.md +126 -126
  211. package/skills/loop-agent/references/harness-policy.md +263 -263
  212. package/skills/loop-agent/references/hybrid-dag.md +243 -243
  213. package/skills/loop-agent/references/learned/README.md +21 -21
  214. package/skills/loop-agent/references/long-running-loop.md +57 -57
  215. package/skills/loop-agent/references/model-routing.md +36 -36
  216. package/skills/loop-agent/references/multi-worktree.md +54 -54
  217. package/skills/loop-agent/references/one-shot-runs.md +85 -85
  218. package/skills/loop-agent/references/orchestrator-and-interventions.md +169 -169
  219. package/skills/loop-agent/references/pi-prompt.md +23 -23
  220. package/skills/loop-agent/references/pi-subagent-assisted-mode.md +84 -84
  221. package/skills/loop-agent/references/post-implementation-and-patterns.md +44 -44
  222. package/skills/loop-agent/references/task-workflow.md +89 -89
  223. package/skills/loop-agent/references/verification-and-failure-handling.md +141 -141
  224. package/skills/playwright-cli/SKILL.md +420 -420
  225. package/skills/playwright-cli/references/element-attributes.md +23 -23
  226. package/skills/playwright-cli/references/playwright-tests.md +39 -39
  227. package/skills/playwright-cli/references/request-mocking.md +87 -87
  228. package/skills/playwright-cli/references/running-code.md +241 -241
  229. package/skills/playwright-cli/references/session-management.md +225 -225
  230. package/skills/playwright-cli/references/storage-state.md +275 -275
  231. package/skills/playwright-cli/references/test-generation.md +433 -433
  232. package/skills/playwright-cli/references/tracing.md +139 -139
  233. package/skills/playwright-cli/references/video-recording.md +143 -143
  234. package/skills/playwright-cli-case-generator/SKILL.md +74 -74
  235. package/skills/requesting-code-review/SKILL.md +101 -101
  236. package/skills/requesting-code-review/code-reviewer.md +168 -168
  237. package/skills/systematic-debugging/CREATION-LOG.md +119 -119
  238. package/skills/systematic-debugging/SKILL.md +296 -296
  239. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -158
  240. package/skills/systematic-debugging/condition-based-waiting.md +115 -115
  241. package/skills/systematic-debugging/defense-in-depth.md +122 -122
  242. package/skills/systematic-debugging/find-polluter.sh +63 -63
  243. package/skills/systematic-debugging/root-cause-tracing.md +169 -169
  244. package/skills/systematic-debugging/test-academic.md +14 -14
  245. package/skills/systematic-debugging/test-pressure-1.md +58 -58
  246. package/skills/systematic-debugging/test-pressure-2.md +68 -68
  247. package/skills/systematic-debugging/test-pressure-3.md +69 -69
  248. package/skills/test-driven-development/SKILL.md +20 -20
  249. package/skills/using-git-worktrees/SKILL.md +215 -215
  250. package/skills/verification-before-completion/SKILL.md +154 -154
  251. package/skills/webapp-testing/SKILL.md +19 -19
  252. package/docs/agent-dag-recovery-playbook.md +0 -195
  253. package/docs/agent-dag-runner.md +0 -67
  254. package/docs/cursor-prompt-sidecar.md +0 -36
  255. package/docs/decisions/README.md +0 -18
  256. package/docs/design/README.md +0 -167
  257. package/docs/development-principles.md +0 -73
  258. package/docs/exec-plans/README.md +0 -6
  259. package/docs/exec-plans/active/README.md +0 -12
  260. package/docs/exec-plans/completed/README.md +0 -107
  261. package/docs/feature-workflow.md +0 -414
  262. package/docs/loop-agent-harness.md +0 -142
  263. package/docs/production-readiness.md +0 -96
  264. package/docs/progress/README.md +0 -80
  265. package/docs/reports/README.md +0 -159
  266. package/docs/verification-matrix.md +0 -70
  267. package/scripts/check-product-line-docs.sh +0 -29
  268. package/scripts/check-task-pool-root.sh +0 -32
  269. package/scripts/kb-graph-incremental-prepare.sh +0 -5
  270. package/scripts/kb-graph-materialize.sh +0 -4
  271. package/scripts/kb-graph-promote.sh +0 -4
  272. package/scripts/kb-query.sh +0 -5
@@ -1,620 +1,620 @@
1
- {
2
- "$schema": "./agent-dag.schema.json",
3
- "version": 3,
4
- "title": "Agent DAG supervised implementation template",
5
- "runtimeContract": {
6
- "schemaVersion": 1,
7
- "agentRuntime": "pi-only",
8
- "repairWriterProtocol": "explicit-node-v1"
9
- },
10
- "objective": "Demonstrate a reusable supervised implementation DAG: contract → parallel scouts → plan → write-set audit → verdict format repair → bounded plan revision → final write-set audit → verdict format repair → write-set gate → implement → soft verify → process supervisor → repair → hard verify → review verdict → review gate → decision gate → closeout. Write-set, process, and review verdict nodes emit first-line VERDICT for deterministic gates, reducing main-session intervention.",
11
- "successCriteria": [
12
- "contract-pi returns a read-only implementation contract with narrow write boundaries",
13
- "scout-src and scout-tests run in parallel without write conflicts",
14
- "plan-pi produces a writeSet coverage matrix with explicit exclusive owners",
15
- "write-set-audit-pi validates coverage and returns VERDICT pass or request-revision",
16
- "write-set-audit-format-repair-pi provides one read-only format recovery attempt without changing substantive findings",
17
- "plan-revision-pi performs at most one read-only revision round and never expands task allowedPaths",
18
- "final-write-set-audit-pi re-audits the effective plan after the bounded revision round",
19
- "write-set-gate-shell blocks implement-pi unless the normalized final audit VERDICT is pass",
20
- "implement-pi and repair-pi write only inside declared writeSet",
21
- "soft-verify-shell archives focused test exit codes before process supervision",
22
- "process-supervisor-pi returns first-line VERDICT pass or request-revision",
23
- "process-gate-shell deterministically accepts valid supervisor verdicts",
24
- "hard-verify-shell archives lint/typecheck/focused tests with active-DAG governance when check-repo runs",
25
- "review-pi returns first-line VERDICT using review verdict prompt invariants",
26
- "review-gate-shell blocks downstream nodes unless review VERDICT is pass",
27
- "decision-pi returns DECISION_ENVELOPE_JSON without pausing runtime by default",
28
- "closeout-pi summarizes evidence without writing files"
29
- ],
30
- "globalConstraints": [
31
- "Replace every REPLACE/WITH/... placeholder with concrete repo paths before execution; do not leave template placeholders in production DAG JSON.",
32
- "Do not commit from DAG nodes; main session inspects and commits after Decision Gate approval.",
33
- "Use only existing executors: pi, shell, static. Cursor is available only through the explicit cursor-prompt sidecar, never as a DAG executor. Pi writer nodes must set toolProfile=write.",
34
- "Read-only nodes must not write repository files, including root artifacts/**.",
35
- "Exclusive writer nodes must stay within declared writeSet.",
36
- "Do not implement automatic retry/resume or mutate historical completed facts.",
37
- "Do not create executor: supervisor; supervisor is a role on executor=pi.",
38
- "Do not create executor: human, executor: decision, or browser executor.",
39
- "Shell governance inside active DAG must use HARNESS_ALLOW_ACTIVE_DAG_RUNS=1 bash scripts/check-repo.sh.",
40
- "On Windows, Bash script commands must run through Git Bash or a configured compatible Bash; do not require WSL or POSIX filesystem paths.",
41
- "Actual file operation paths must be macOS/Windows compatible; use / only for stable repo refs, JSON/Markdown evidence refs, and glob conventions.",
42
- "Prompt templates must not ask main session to write artifacts; node output is the artifact and runner archives it under .harness/dag-runs/.",
43
- "Every task must explicitly declare executor; defaults.executor is schema-only and not a runtime fallback.",
44
- "Prefer same-rank parallel read-only scouts over serial chains when outputs are independent.",
45
- "Same-rank exclusive writeSet entries must be disjoint.",
46
- "Use executorModels for model routing; do not add defaults.model or legacy top-level models.",
47
- "Write-set plan revision is bounded to one round; format repair remains read-only and cannot expand task allowedPaths or authorize writes."
48
- ],
49
- "defaults": {
50
- "executor": "pi",
51
- "contextProfile": "slim",
52
- "skills": [
53
- "ai-engineering-context"
54
- ],
55
- "writePolicy": "read-only"
56
- },
57
- "skillsByRole": {
58
- "planner": [
59
- "loop-agent"
60
- ],
61
- "scout": [
62
- "ai-engineering-context"
63
- ],
64
- "implementer": [
65
- "verification-before-completion"
66
- ],
67
- "reviewer": [
68
- "requesting-code-review",
69
- "verification-before-completion"
70
- ],
71
- "supervisor": [
72
- "verification-before-completion",
73
- "loop-agent"
74
- ],
75
- "verifier": [
76
- "verification-before-completion",
77
- "systematic-debugging"
78
- ],
79
- "closeout": [
80
- "loop-agent",
81
- "verification-before-completion"
82
- ]
83
- },
84
- "executorModels": {
85
- "pi": {
86
- "LOW": "gpt-5.3-codex-spark",
87
- "MED": "glm-5.2",
88
- "HIGH": "gpt-5.5"
89
- }
90
- },
91
- "verifyStrategy": {
92
- "intermediateQuota": "1",
93
- "finalQuota": "full",
94
- "focusedCommandSource": "adapter"
95
- },
96
- "tasks": [
97
- {
98
- "id": "contract-pi",
99
- "depends_on": [],
100
- "complexity": "MED",
101
- "executor": "pi",
102
- "role": "planner",
103
- "writePolicy": "read-only",
104
- "allowedPaths": [
105
- "**"
106
- ],
107
- "forbiddenPaths": [
108
- ".harness/**",
109
- "artifacts/**"
110
- ],
111
- "outputContract": "Plain Markdown implementation contract: scope, risks, parallel scout opportunities, verification expectations. No file writes.",
112
- "subtask_prompt": "Read the DAG objective and success criteria. Return a concise implementation contract covering scope, narrow write boundaries, risks, and verification expectations. Do not edit files or write root artifacts/**."
113
- },
114
- {
115
- "id": "scout-src",
116
- "depends_on": [
117
- "contract-pi"
118
- ],
119
- "complexity": "LOW",
120
- "executor": "pi",
121
- "role": "scout",
122
- "writePolicy": "read-only",
123
- "allowedPaths": [
124
- "REPLACE/WITH/SOURCE/PATH/**"
125
- ],
126
- "forbiddenPaths": [
127
- ".harness/**",
128
- "artifacts/**"
129
- ],
130
- "outputContract": "Plain Markdown source reconnaissance summary; no file writes.",
131
- "subtask_prompt": "Perform read-only source reconnaissance under allowedPaths. List relevant files, patterns, and risks. Do not edit files."
132
- },
133
- {
134
- "id": "scout-tests",
135
- "depends_on": [
136
- "contract-pi"
137
- ],
138
- "complexity": "LOW",
139
- "executor": "pi",
140
- "role": "scout",
141
- "writePolicy": "read-only",
142
- "allowedPaths": [
143
- "REPLACE/WITH/TEST/PATH/**"
144
- ],
145
- "forbiddenPaths": [
146
- ".harness/**",
147
- "artifacts/**"
148
- ],
149
- "outputContract": "Plain Markdown test coverage reconnaissance summary; no file writes.",
150
- "subtask_prompt": "Perform read-only test reconnaissance under allowedPaths. List relevant tests, coverage gaps, and focused verification commands. Do not edit files."
151
- },
152
- {
153
- "id": "plan-pi",
154
- "depends_on": [
155
- "scout-src",
156
- "scout-tests"
157
- ],
158
- "complexity": "MED",
159
- "executor": "pi",
160
- "role": "planner",
161
- "writePolicy": "read-only",
162
- "allowedPaths": [
163
- "**"
164
- ],
165
- "forbiddenPaths": [
166
- ".harness/**",
167
- "artifacts/**"
168
- ],
169
- "outputContract": "Plain Markdown plan with WriteSet Coverage Matrix (file → owning exclusive node id). No file writes.",
170
- "subtask_prompt": "Synthesize upstream scouts into an implementation plan. Include a WriteSet Coverage Matrix table mapping each file that must change to exactly one future exclusive implementer/repair node id. Flag parallel work and verification commands. Do not edit files."
171
- },
172
- {
173
- "id": "write-set-audit-pi",
174
- "depends_on": [
175
- "plan-pi"
176
- ],
177
- "complexity": "MED",
178
- "executor": "pi",
179
- "role": "reviewer",
180
- "writePolicy": "read-only",
181
- "allowedPaths": [
182
- "**"
183
- ],
184
- "forbiddenPaths": [
185
- ".harness/**",
186
- "artifacts/**"
187
- ],
188
- "outputContract": "Plain Markdown whose first non-empty line is VERDICT: pass or VERDICT: request-revision; includes writeSet coverage findings. No file writes.",
189
- "subtask_prompt": "Audit plan-pi WriteSet Coverage Matrix against the contract. First non-empty line must be exactly VERDICT: pass or VERDICT: request-revision. List Critical/Important gaps when any required file lacks a single exclusive owner or overlaps forbidden paths. Do not edit files or write root artifacts/**."
190
- },
191
- {
192
- "id": "write-set-audit-format-repair-pi",
193
- "depends_on": [
194
- "write-set-audit-pi"
195
- ],
196
- "complexity": "LOW",
197
- "executor": "pi",
198
- "role": "reviewer",
199
- "writePolicy": "read-only",
200
- "allowedPaths": [
201
- "**"
202
- ],
203
- "forbiddenPaths": [
204
- ".harness/**",
205
- "artifacts/**"
206
- ],
207
- "outputContract": "Plain Markdown whose first non-empty line is exactly VERDICT: pass or VERDICT: request-revision, followed by the original audit findings without substantive changes. No file writes.",
208
- "subtask_prompt": "Normalize write-set-audit-pi output; this is the single read-only format-repair attempt for the initial audit. First non-empty line must be exactly VERDICT: pass or VERDICT: request-revision. Preserve an existing valid verdict exactly. If the verdict is missing or malformed but the audit states an unambiguous conclusion, add only the matching canonical verdict and preserve the findings. Do not add, remove, or reclassify substantive findings. If the conclusion is ambiguous, emit VERDICT: request-revision and report the format ambiguity. Do not infer a pass from general prose, expand task allowedPaths, or edit files."
209
- },
210
- {
211
- "id": "write-set-format-gate-shell",
212
- "depends_on": [
213
- "write-set-audit-format-repair-pi"
214
- ],
215
- "complexity": "LOW",
216
- "executor": "shell",
217
- "role": "verifier",
218
- "writePolicy": "read-only",
219
- "allowedPaths": [
220
- "**"
221
- ],
222
- "forbiddenPaths": [
223
- ".harness/**",
224
- "artifacts/**"
225
- ],
226
- "outputContract": "Deterministic initial write-set verdict format gate: accept pass or request-revision so the bounded plan-revision stage can run; reject missing or unexpected verdicts.",
227
- "subtask_prompt": "Validate the normalized initial write-set audit verdict before the bounded plan-revision stage. This gate does not authorize implementation writes.",
228
- "shell": {
229
- "verdictGate": {
230
- "fromNodeId": "write-set-audit-format-repair-pi",
231
- "accept": [
232
- "VERDICT: pass",
233
- "VERDICT: request-revision"
234
- ],
235
- "label": "initial write-set audit format",
236
- "lineMode": "first-verdict-line"
237
- },
238
- "cwd": ".",
239
- "timeoutMs": 60000
240
- }
241
- },
242
- {
243
- "id": "plan-revision-pi",
244
- "depends_on": [
245
- "write-set-format-gate-shell",
246
- "plan-pi",
247
- "write-set-audit-format-repair-pi"
248
- ],
249
- "complexity": "MED",
250
- "executor": "pi",
251
- "role": "planner",
252
- "writePolicy": "read-only",
253
- "allowedPaths": [
254
- "**"
255
- ],
256
- "forbiddenPaths": [
257
- ".harness/**",
258
- "artifacts/**"
259
- ],
260
- "outputContract": "PASS_NO_REVISION_NEEDED when the normalized initial audit passed, otherwise a complete revised implementation plan with a corrected WriteSet Coverage Matrix. No file writes.",
261
- "subtask_prompt": "Perform the single bounded plan-revision round. If the normalized verdict is VERDICT: pass, output PASS_NO_REVISION_NEEDED and do not change the original plan. If it is VERDICT: request-revision, return a complete revised plan that resolves every finding and includes a corrected WriteSet Coverage Matrix. Do not expand task allowedPaths, weaken forbiddenPaths, or edit files."
262
- },
263
- {
264
- "id": "final-write-set-audit-pi",
265
- "depends_on": [
266
- "plan-pi",
267
- "plan-revision-pi",
268
- "write-set-audit-format-repair-pi"
269
- ],
270
- "complexity": "MED",
271
- "executor": "pi",
272
- "role": "reviewer",
273
- "writePolicy": "read-only",
274
- "allowedPaths": [
275
- "**"
276
- ],
277
- "forbiddenPaths": [
278
- ".harness/**",
279
- "artifacts/**"
280
- ],
281
- "outputContract": "Plain Markdown whose first non-empty line is VERDICT: pass or VERDICT: request-revision; includes final writeSet coverage findings after the single plan-revision round. No file writes.",
282
- "subtask_prompt": "Perform the final write-set audit after the single bounded plan-revision round. When plan-revision-pi returned PASS_NO_REVISION_NEEDED, audit the original plan-pi output; otherwise audit the complete revised plan. First non-empty line must be exactly VERDICT: pass or VERDICT: request-revision. Request revision if any required file still lacks one exclusive owner, writeSet is broad or placeholder, forbidden paths overlap, or an initial finding remains unresolved. Do not expand task allowedPaths or edit files."
283
- },
284
- {
285
- "id": "final-write-set-audit-format-repair-pi",
286
- "depends_on": [
287
- "final-write-set-audit-pi"
288
- ],
289
- "complexity": "LOW",
290
- "executor": "pi",
291
- "role": "reviewer",
292
- "writePolicy": "read-only",
293
- "allowedPaths": [
294
- "**"
295
- ],
296
- "forbiddenPaths": [
297
- ".harness/**",
298
- "artifacts/**"
299
- ],
300
- "outputContract": "Plain Markdown whose first non-empty line is exactly VERDICT: pass or VERDICT: request-revision, followed by the original final-audit findings without substantive changes. No file writes.",
301
- "subtask_prompt": "Normalize final-write-set-audit-pi output; this is the single read-only format-repair attempt for the final audit. Preserve an existing valid verdict exactly. If the verdict is missing or malformed but the audit states an unambiguous conclusion, add only the matching canonical verdict and preserve the findings. Do not add, remove, or reclassify substantive findings. If the conclusion is ambiguous, emit VERDICT: request-revision. Do not infer a pass from general prose, expand task allowedPaths, or edit files."
302
- },
303
- {
304
- "id": "write-set-gate-shell",
305
- "depends_on": [
306
- "final-write-set-audit-format-repair-pi"
307
- ],
308
- "complexity": "LOW",
309
- "executor": "shell",
310
- "role": "verifier",
311
- "writePolicy": "read-only",
312
- "allowedPaths": [
313
- "**"
314
- ],
315
- "forbiddenPaths": [
316
- ".harness/**",
317
- "artifacts/**"
318
- ],
319
- "outputContract": "Deterministic final write-set audit verdict gate: exit 0 only when final-write-set-audit-format-repair-pi emits VERDICT: pass after the bounded revision round.",
320
- "subtask_prompt": "Deterministic gate: block implement-pi unless the normalized final write-set audit emitted VERDICT: pass.",
321
- "shell": {
322
- "verdictGate": {
323
- "fromNodeId": "final-write-set-audit-format-repair-pi",
324
- "accept": [
325
- "VERDICT: pass"
326
- ],
327
- "label": "write-set audit",
328
- "lineMode": "first-verdict-line"
329
- },
330
- "cwd": ".",
331
- "timeoutMs": 60000
332
- }
333
- },
334
- {
335
- "id": "implement-pi",
336
- "depends_on": [
337
- "write-set-gate-shell",
338
- "plan-pi",
339
- "plan-revision-pi",
340
- "final-write-set-audit-format-repair-pi"
341
- ],
342
- "complexity": "HIGH",
343
- "executor": "pi",
344
- "role": "implementer",
345
- "writePolicy": "exclusive",
346
- "writeSet": [
347
- "REPLACE/WITH/IMPLEMENT/WRITESET/**"
348
- ],
349
- "allowedPaths": [
350
- "REPLACE/WITH/IMPLEMENT/**"
351
- ],
352
- "forbiddenPaths": [
353
- ".harness/**",
354
- "artifacts/**"
355
- ],
356
- "outputContract": "Implementation summary with changed files, focused tests run, and risks. Must not ask main session to write artifacts.",
357
- "subtask_prompt": "Implement the approved change within writeSet only after write-set-gate-shell passed (upstream VERDICT: pass). If write-set gate blocked, output blocked reason without editing files. Keep changes minimal and run focused tests inside allowedPaths when implementing.",
358
- "toolProfile": "write"
359
- },
360
- {
361
- "id": "soft-verify-shell",
362
- "depends_on": [
363
- "implement-pi"
364
- ],
365
- "complexity": "LOW",
366
- "executor": "shell",
367
- "role": "verifier",
368
- "writePolicy": "read-only",
369
- "allowedPaths": [
370
- "REPLACE/WITH/IMPLEMENT/**",
371
- "./**"
372
- ],
373
- "forbiddenPaths": [
374
- ".harness/**",
375
- "artifacts/**"
376
- ],
377
- "outputContract": "Archived shell stdout/stderr with exit codes for focused verification; no worktree writes.",
378
- "subtask_prompt": "Run focused soft verification before process supervision.",
379
- "shell": {
380
- "commands": [
381
- "npx vitest run REPLACE/WITH/FOCUSED/TEST/GLOB.test.ts --reporter=dot"
382
- ],
383
- "verifyEvidence": {
384
- "phase": "intermediate",
385
- "quota": "1",
386
- "commandSource": "inline",
387
- "commandCount": 1,
388
- "commandLabels": [
389
- "focused template verification"
390
- ]
391
- },
392
- "cwd": ".",
393
- "timeoutMs": 300000
394
- }
395
- },
396
- {
397
- "id": "process-supervisor-pi",
398
- "depends_on": [
399
- "soft-verify-shell",
400
- "implement-pi"
401
- ],
402
- "complexity": "HIGH",
403
- "executor": "pi",
404
- "role": "supervisor",
405
- "writePolicy": "read-only",
406
- "allowedPaths": [
407
- "**"
408
- ],
409
- "forbiddenPaths": [
410
- ".harness/**",
411
- "artifacts/**"
412
- ],
413
- "outputContract": "Plain Markdown whose first non-empty line is VERDICT: pass or VERDICT: request-revision, followed by a REPAIR_ARTIFACT_JSON fenced block. Audit writeSet coverage, boundary drift, verification gaps, repair scope. No file writes.",
414
- "subtask_prompt_markdown": "./agent-dag-process-supervisor.prompt.md"
415
- },
416
- {
417
- "id": "process-gate-shell",
418
- "depends_on": [
419
- "process-supervisor-pi"
420
- ],
421
- "complexity": "LOW",
422
- "executor": "shell",
423
- "role": "verifier",
424
- "writePolicy": "read-only",
425
- "allowedPaths": [
426
- "**"
427
- ],
428
- "forbiddenPaths": [
429
- ".harness/**",
430
- "artifacts/**"
431
- ],
432
- "outputContract": "Deterministic process supervisor verdict gate: exit 0 when first non-empty assistant output line is pass or request-revision; exit non-zero otherwise.",
433
- "subtask_prompt": "Deterministic gate: validate process-supervisor-pi first-line VERDICT before repair/hard-verify.",
434
- "shell": {
435
- "verdictGate": {
436
- "fromNodeId": "process-supervisor-pi",
437
- "accept": [
438
- "VERDICT: pass",
439
- "VERDICT: request-revision"
440
- ],
441
- "label": "process",
442
- "lineMode": "first-verdict-line"
443
- },
444
- "repairArtifactGate": {
445
- "fromNodeId": "process-supervisor-pi",
446
- "repairNodeId": "repair-pi"
447
- },
448
- "cwd": ".",
449
- "timeoutMs": 60000
450
- }
451
- },
452
- {
453
- "id": "repair-pi",
454
- "depends_on": [
455
- "process-gate-shell",
456
- "process-supervisor-pi"
457
- ],
458
- "complexity": "HIGH",
459
- "executor": "pi",
460
- "role": "implementer",
461
- "writePolicy": "exclusive",
462
- "writeSet": [
463
- "REPLACE/WITH/REPAIR/WRITESET/**",
464
- "docs/templates/agent-dag.supervised-implementation.json",
465
- "docs/templates/agent-dag-process-supervisor.prompt.md",
466
- "docs/templates/agent-dag-review-verdict.prompt.md",
467
- "docs/templates/agent-dag.schema.json",
468
- "./src/workflows/dag/types.ts",
469
- "./src/workflows/dag/skills.ts",
470
- "./src/executors/dag-pi-executor.ts"
471
- ],
472
- "allowedPaths": [
473
- "REPLACE/WITH/REPAIR/**",
474
- "docs/templates/**",
475
- "./src/workflows/dag/**",
476
- "./src/executors/**"
477
- ],
478
- "forbiddenPaths": [
479
- ".harness/**",
480
- "artifacts/**"
481
- ],
482
- "outputContract": "Repair summary or explicit no-op when process supervisor passed; changed files and tests when revised. Must not ask main session to write artifacts.",
483
- "subtask_prompt": "If process-supervisor-pi returned VERDICT: request-revision, apply bounded fixes within writeSet addressing REPAIR_ARTIFACT_JSON.fixScope and preserving REPAIR_ARTIFACT_JSON.invariant. Use REPAIR_ARTIFACT_JSON.failureClass and rootCause before raw logs; raw log is fallback evidence only when rawLogFallbackAllowed is true. If VERDICT: pass, return no-op with evidence. Re-run focused tests when you change code.",
484
- "toolProfile": "write"
485
- },
486
- {
487
- "id": "hard-verify-shell",
488
- "depends_on": [
489
- "repair-pi"
490
- ],
491
- "complexity": "LOW",
492
- "executor": "shell",
493
- "role": "verifier",
494
- "writePolicy": "read-only",
495
- "allowedPaths": [
496
- "./**",
497
- "docs/**",
498
- "scripts/**"
499
- ],
500
- "forbiddenPaths": [
501
- ".harness/**",
502
- "artifacts/**"
503
- ],
504
- "outputContract": "Archived hard verification stdout/stderr with exit codes; no worktree writes.",
505
- "subtask_prompt": "Run hard verification after repair round.",
506
- "shell": {
507
- "preset": "loop-agent-standard-verify",
508
- "commands": [
509
- "HARNESS_ALLOW_ACTIVE_DAG_RUNS=1 bash scripts/check-repo.sh"
510
- ],
511
- "verifyEvidence": {
512
- "phase": "final",
513
- "quota": "full",
514
- "commandSource": "inline",
515
- "commandCount": 1,
516
- "commandLabels": [
517
- "active DAG repo governance checks"
518
- ],
519
- "finalFullRequired": true
520
- },
521
- "cwd": ".",
522
- "timeoutMs": 300000
523
- }
524
- },
525
- {
526
- "id": "review-pi",
527
- "depends_on": [
528
- "hard-verify-shell"
529
- ],
530
- "complexity": "HIGH",
531
- "executor": "pi",
532
- "role": "reviewer",
533
- "writePolicy": "read-only",
534
- "allowedPaths": [
535
- "**"
536
- ],
537
- "forbiddenPaths": [
538
- ".harness/**",
539
- "artifacts/**"
540
- ],
541
- "outputContract": "Plain Markdown whose first non-empty line is VERDICT: pass or VERDICT: request-revision; Critical/Important findings force request-revision. No file writes.",
542
- "subtask_prompt_markdown": "./agent-dag-review-verdict.prompt.md"
543
- },
544
- {
545
- "id": "review-gate-shell",
546
- "depends_on": [
547
- "review-pi"
548
- ],
549
- "complexity": "LOW",
550
- "executor": "shell",
551
- "role": "verifier",
552
- "writePolicy": "read-only",
553
- "allowedPaths": [
554
- "**"
555
- ],
556
- "forbiddenPaths": [
557
- ".harness/**",
558
- "artifacts/**"
559
- ],
560
- "outputContract": "Deterministic review verdict gate: exit 0 only when review-pi first non-empty assistant output line is pass.",
561
- "subtask_prompt": "Deterministic gate: block decision gate unless review-pi emitted VERDICT: pass.",
562
- "shell": {
563
- "verdictGate": {
564
- "fromNodeId": "review-pi",
565
- "accept": [
566
- "VERDICT: pass"
567
- ],
568
- "label": "review",
569
- "lineMode": "first-verdict-line"
570
- },
571
- "cwd": ".",
572
- "timeoutMs": 60000
573
- }
574
- },
575
- {
576
- "id": "decision-pi",
577
- "depends_on": [
578
- "review-gate-shell",
579
- "hard-verify-shell"
580
- ],
581
- "complexity": "HIGH",
582
- "executor": "pi",
583
- "role": "reviewer",
584
- "writePolicy": "read-only",
585
- "allowedPaths": [
586
- "**"
587
- ],
588
- "forbiddenPaths": [
589
- ".harness/**",
590
- "artifacts/**"
591
- ],
592
- "outputContract": "Markdown with exactly one DECISION_ENVELOPE_JSON fenced block plus evidence summary. No file writes.",
593
- "subtask_prompt_markdown": "./agent-dag-decision-gate.prompt.md",
594
- "decisionGate": {
595
- "enabled": true,
596
- "schemaVersion": 1,
597
- "mode": "record-only"
598
- }
599
- },
600
- {
601
- "id": "closeout-pi",
602
- "depends_on": [
603
- "decision-pi"
604
- ],
605
- "complexity": "MED",
606
- "executor": "pi",
607
- "role": "closeout",
608
- "writePolicy": "read-only",
609
- "allowedPaths": [
610
- "**"
611
- ],
612
- "forbiddenPaths": [
613
- ".harness/**",
614
- "artifacts/**"
615
- ],
616
- "outputContract": "Plain Markdown closeout referencing verification, supervisor/review verdicts, and decision envelope. No file writes.",
617
- "subtask_prompt": "Summarize the supervised DAG outcome: contract, write-set audit, implement/repair, soft/hard verify, process supervisor and review verdicts, decision-pi envelope, and recommended main-session next step. Do not edit files or write root artifacts/**."
618
- }
619
- ]
620
- }
1
+ {
2
+ "$schema": "./agent-dag.schema.json",
3
+ "version": 3,
4
+ "title": "Agent DAG supervised implementation template",
5
+ "runtimeContract": {
6
+ "schemaVersion": 1,
7
+ "agentRuntime": "pi-only",
8
+ "repairWriterProtocol": "explicit-node-v1"
9
+ },
10
+ "objective": "Demonstrate a reusable supervised implementation DAG: contract → parallel scouts → plan → write-set audit → verdict format repair → bounded plan revision → final write-set audit → verdict format repair → write-set gate → implement → soft verify → process supervisor → repair → hard verify → review verdict → review gate → decision gate → closeout. Write-set, process, and review verdict nodes emit first-line VERDICT for deterministic gates, reducing main-session intervention.",
11
+ "successCriteria": [
12
+ "contract-pi returns a read-only implementation contract with narrow write boundaries",
13
+ "scout-src and scout-tests run in parallel without write conflicts",
14
+ "plan-pi produces a writeSet coverage matrix with explicit exclusive owners",
15
+ "write-set-audit-pi validates coverage and returns VERDICT pass or request-revision",
16
+ "write-set-audit-format-repair-pi provides one read-only format recovery attempt without changing substantive findings",
17
+ "plan-revision-pi performs at most one read-only revision round and never expands task allowedPaths",
18
+ "final-write-set-audit-pi re-audits the effective plan after the bounded revision round",
19
+ "write-set-gate-shell blocks implement-pi unless the normalized final audit VERDICT is pass",
20
+ "implement-pi and repair-pi write only inside declared writeSet",
21
+ "soft-verify-shell archives focused test exit codes before process supervision",
22
+ "process-supervisor-pi returns first-line VERDICT pass or request-revision",
23
+ "process-gate-shell deterministically accepts valid supervisor verdicts",
24
+ "hard-verify-shell archives lint/typecheck/focused tests with active-DAG governance when check-repo runs",
25
+ "review-pi returns first-line VERDICT using review verdict prompt invariants",
26
+ "review-gate-shell blocks downstream nodes unless review VERDICT is pass",
27
+ "decision-pi returns DECISION_ENVELOPE_JSON without pausing runtime by default",
28
+ "closeout-pi summarizes evidence without writing files"
29
+ ],
30
+ "globalConstraints": [
31
+ "Replace every REPLACE/WITH/... placeholder with concrete repo paths before execution; do not leave template placeholders in production DAG JSON.",
32
+ "Do not commit from DAG nodes; main session inspects and commits after Decision Gate approval.",
33
+ "Use only existing executors: pi, shell, static. Cursor is available only through the explicit cursor-prompt sidecar, never as a DAG executor. Pi writer nodes must set toolProfile=write.",
34
+ "Read-only nodes must not write repository files, including root artifacts/**.",
35
+ "Exclusive writer nodes must stay within declared writeSet.",
36
+ "Do not implement automatic retry/resume or mutate historical completed facts.",
37
+ "Do not create executor: supervisor; supervisor is a role on executor=pi.",
38
+ "Do not create executor: human, executor: decision, or browser executor.",
39
+ "Shell governance inside active DAG must use HARNESS_ALLOW_ACTIVE_DAG_RUNS=1 bash scripts/check-repo.sh.",
40
+ "On Windows, Bash script commands must run through Git Bash or a configured compatible Bash; do not require WSL or POSIX filesystem paths.",
41
+ "Actual file operation paths must be macOS/Windows compatible; use / only for stable repo refs, JSON/Markdown evidence refs, and glob conventions.",
42
+ "Prompt templates must not ask main session to write artifacts; node output is the artifact and runner archives it under .harness/dag-runs/.",
43
+ "Every task must explicitly declare executor; defaults.executor is schema-only and not a runtime fallback.",
44
+ "Prefer same-rank parallel read-only scouts over serial chains when outputs are independent.",
45
+ "Same-rank exclusive writeSet entries must be disjoint.",
46
+ "Use executorModels for model routing; do not add defaults.model or legacy top-level models.",
47
+ "Write-set plan revision is bounded to one round; format repair remains read-only and cannot expand task allowedPaths or authorize writes."
48
+ ],
49
+ "defaults": {
50
+ "executor": "pi",
51
+ "contextProfile": "slim",
52
+ "skills": [
53
+ "ai-engineering-context"
54
+ ],
55
+ "writePolicy": "read-only"
56
+ },
57
+ "skillsByRole": {
58
+ "planner": [
59
+ "loop-agent"
60
+ ],
61
+ "scout": [
62
+ "ai-engineering-context"
63
+ ],
64
+ "implementer": [
65
+ "verification-before-completion"
66
+ ],
67
+ "reviewer": [
68
+ "requesting-code-review",
69
+ "verification-before-completion"
70
+ ],
71
+ "supervisor": [
72
+ "verification-before-completion",
73
+ "loop-agent"
74
+ ],
75
+ "verifier": [
76
+ "verification-before-completion",
77
+ "systematic-debugging"
78
+ ],
79
+ "closeout": [
80
+ "loop-agent",
81
+ "verification-before-completion"
82
+ ]
83
+ },
84
+ "executorModels": {
85
+ "pi": {
86
+ "LOW": "gpt-5.3-codex-spark",
87
+ "MED": "glm-5.2",
88
+ "HIGH": "gpt-5.5"
89
+ }
90
+ },
91
+ "verifyStrategy": {
92
+ "intermediateQuota": "1",
93
+ "finalQuota": "full",
94
+ "focusedCommandSource": "adapter"
95
+ },
96
+ "tasks": [
97
+ {
98
+ "id": "contract-pi",
99
+ "depends_on": [],
100
+ "complexity": "MED",
101
+ "executor": "pi",
102
+ "role": "planner",
103
+ "writePolicy": "read-only",
104
+ "allowedPaths": [
105
+ "**"
106
+ ],
107
+ "forbiddenPaths": [
108
+ ".harness/**",
109
+ "artifacts/**"
110
+ ],
111
+ "outputContract": "Plain Markdown implementation contract: scope, risks, parallel scout opportunities, verification expectations. No file writes.",
112
+ "subtask_prompt": "Read the DAG objective and success criteria. Return a concise implementation contract covering scope, narrow write boundaries, risks, and verification expectations. Do not edit files or write root artifacts/**."
113
+ },
114
+ {
115
+ "id": "scout-src",
116
+ "depends_on": [
117
+ "contract-pi"
118
+ ],
119
+ "complexity": "LOW",
120
+ "executor": "pi",
121
+ "role": "scout",
122
+ "writePolicy": "read-only",
123
+ "allowedPaths": [
124
+ "REPLACE/WITH/SOURCE/PATH/**"
125
+ ],
126
+ "forbiddenPaths": [
127
+ ".harness/**",
128
+ "artifacts/**"
129
+ ],
130
+ "outputContract": "Plain Markdown source reconnaissance summary; no file writes.",
131
+ "subtask_prompt": "Perform read-only source reconnaissance under allowedPaths. List relevant files, patterns, and risks. Do not edit files."
132
+ },
133
+ {
134
+ "id": "scout-tests",
135
+ "depends_on": [
136
+ "contract-pi"
137
+ ],
138
+ "complexity": "LOW",
139
+ "executor": "pi",
140
+ "role": "scout",
141
+ "writePolicy": "read-only",
142
+ "allowedPaths": [
143
+ "REPLACE/WITH/TEST/PATH/**"
144
+ ],
145
+ "forbiddenPaths": [
146
+ ".harness/**",
147
+ "artifacts/**"
148
+ ],
149
+ "outputContract": "Plain Markdown test coverage reconnaissance summary; no file writes.",
150
+ "subtask_prompt": "Perform read-only test reconnaissance under allowedPaths. List relevant tests, coverage gaps, and focused verification commands. Do not edit files."
151
+ },
152
+ {
153
+ "id": "plan-pi",
154
+ "depends_on": [
155
+ "scout-src",
156
+ "scout-tests"
157
+ ],
158
+ "complexity": "MED",
159
+ "executor": "pi",
160
+ "role": "planner",
161
+ "writePolicy": "read-only",
162
+ "allowedPaths": [
163
+ "**"
164
+ ],
165
+ "forbiddenPaths": [
166
+ ".harness/**",
167
+ "artifacts/**"
168
+ ],
169
+ "outputContract": "Plain Markdown plan with WriteSet Coverage Matrix (file → owning exclusive node id). No file writes.",
170
+ "subtask_prompt": "Synthesize upstream scouts into an implementation plan. Include a WriteSet Coverage Matrix table mapping each file that must change to exactly one future exclusive implementer/repair node id. Flag parallel work and verification commands. Do not edit files."
171
+ },
172
+ {
173
+ "id": "write-set-audit-pi",
174
+ "depends_on": [
175
+ "plan-pi"
176
+ ],
177
+ "complexity": "MED",
178
+ "executor": "pi",
179
+ "role": "reviewer",
180
+ "writePolicy": "read-only",
181
+ "allowedPaths": [
182
+ "**"
183
+ ],
184
+ "forbiddenPaths": [
185
+ ".harness/**",
186
+ "artifacts/**"
187
+ ],
188
+ "outputContract": "Plain Markdown whose first non-empty line is VERDICT: pass or VERDICT: request-revision; includes writeSet coverage findings. No file writes.",
189
+ "subtask_prompt": "Audit plan-pi WriteSet Coverage Matrix against the contract. First non-empty line must be exactly VERDICT: pass or VERDICT: request-revision. List Critical/Important gaps when any required file lacks a single exclusive owner or overlaps forbidden paths. Do not edit files or write root artifacts/**."
190
+ },
191
+ {
192
+ "id": "write-set-audit-format-repair-pi",
193
+ "depends_on": [
194
+ "write-set-audit-pi"
195
+ ],
196
+ "complexity": "LOW",
197
+ "executor": "pi",
198
+ "role": "reviewer",
199
+ "writePolicy": "read-only",
200
+ "allowedPaths": [
201
+ "**"
202
+ ],
203
+ "forbiddenPaths": [
204
+ ".harness/**",
205
+ "artifacts/**"
206
+ ],
207
+ "outputContract": "Plain Markdown whose first non-empty line is exactly VERDICT: pass or VERDICT: request-revision, followed by the original audit findings without substantive changes. No file writes.",
208
+ "subtask_prompt": "Normalize write-set-audit-pi output; this is the single read-only format-repair attempt for the initial audit. First non-empty line must be exactly VERDICT: pass or VERDICT: request-revision. Preserve an existing valid verdict exactly. If the verdict is missing or malformed but the audit states an unambiguous conclusion, add only the matching canonical verdict and preserve the findings. Do not add, remove, or reclassify substantive findings. If the conclusion is ambiguous, emit VERDICT: request-revision and report the format ambiguity. Do not infer a pass from general prose, expand task allowedPaths, or edit files."
209
+ },
210
+ {
211
+ "id": "write-set-format-gate-shell",
212
+ "depends_on": [
213
+ "write-set-audit-format-repair-pi"
214
+ ],
215
+ "complexity": "LOW",
216
+ "executor": "shell",
217
+ "role": "verifier",
218
+ "writePolicy": "read-only",
219
+ "allowedPaths": [
220
+ "**"
221
+ ],
222
+ "forbiddenPaths": [
223
+ ".harness/**",
224
+ "artifacts/**"
225
+ ],
226
+ "outputContract": "Deterministic initial write-set verdict format gate: accept pass or request-revision so the bounded plan-revision stage can run; reject missing or unexpected verdicts.",
227
+ "subtask_prompt": "Validate the normalized initial write-set audit verdict before the bounded plan-revision stage. This gate does not authorize implementation writes.",
228
+ "shell": {
229
+ "verdictGate": {
230
+ "fromNodeId": "write-set-audit-format-repair-pi",
231
+ "accept": [
232
+ "VERDICT: pass",
233
+ "VERDICT: request-revision"
234
+ ],
235
+ "label": "initial write-set audit format",
236
+ "lineMode": "first-verdict-line"
237
+ },
238
+ "cwd": ".",
239
+ "timeoutMs": 60000
240
+ }
241
+ },
242
+ {
243
+ "id": "plan-revision-pi",
244
+ "depends_on": [
245
+ "write-set-format-gate-shell",
246
+ "plan-pi",
247
+ "write-set-audit-format-repair-pi"
248
+ ],
249
+ "complexity": "MED",
250
+ "executor": "pi",
251
+ "role": "planner",
252
+ "writePolicy": "read-only",
253
+ "allowedPaths": [
254
+ "**"
255
+ ],
256
+ "forbiddenPaths": [
257
+ ".harness/**",
258
+ "artifacts/**"
259
+ ],
260
+ "outputContract": "PASS_NO_REVISION_NEEDED when the normalized initial audit passed, otherwise a complete revised implementation plan with a corrected WriteSet Coverage Matrix. No file writes.",
261
+ "subtask_prompt": "Perform the single bounded plan-revision round. If the normalized verdict is VERDICT: pass, output PASS_NO_REVISION_NEEDED and do not change the original plan. If it is VERDICT: request-revision, return a complete revised plan that resolves every finding and includes a corrected WriteSet Coverage Matrix. Do not expand task allowedPaths, weaken forbiddenPaths, or edit files."
262
+ },
263
+ {
264
+ "id": "final-write-set-audit-pi",
265
+ "depends_on": [
266
+ "plan-pi",
267
+ "plan-revision-pi",
268
+ "write-set-audit-format-repair-pi"
269
+ ],
270
+ "complexity": "MED",
271
+ "executor": "pi",
272
+ "role": "reviewer",
273
+ "writePolicy": "read-only",
274
+ "allowedPaths": [
275
+ "**"
276
+ ],
277
+ "forbiddenPaths": [
278
+ ".harness/**",
279
+ "artifacts/**"
280
+ ],
281
+ "outputContract": "Plain Markdown whose first non-empty line is VERDICT: pass or VERDICT: request-revision; includes final writeSet coverage findings after the single plan-revision round. No file writes.",
282
+ "subtask_prompt": "Perform the final write-set audit after the single bounded plan-revision round. When plan-revision-pi returned PASS_NO_REVISION_NEEDED, audit the original plan-pi output; otherwise audit the complete revised plan. First non-empty line must be exactly VERDICT: pass or VERDICT: request-revision. Request revision if any required file still lacks one exclusive owner, writeSet is broad or placeholder, forbidden paths overlap, or an initial finding remains unresolved. Do not expand task allowedPaths or edit files."
283
+ },
284
+ {
285
+ "id": "final-write-set-audit-format-repair-pi",
286
+ "depends_on": [
287
+ "final-write-set-audit-pi"
288
+ ],
289
+ "complexity": "LOW",
290
+ "executor": "pi",
291
+ "role": "reviewer",
292
+ "writePolicy": "read-only",
293
+ "allowedPaths": [
294
+ "**"
295
+ ],
296
+ "forbiddenPaths": [
297
+ ".harness/**",
298
+ "artifacts/**"
299
+ ],
300
+ "outputContract": "Plain Markdown whose first non-empty line is exactly VERDICT: pass or VERDICT: request-revision, followed by the original final-audit findings without substantive changes. No file writes.",
301
+ "subtask_prompt": "Normalize final-write-set-audit-pi output; this is the single read-only format-repair attempt for the final audit. Preserve an existing valid verdict exactly. If the verdict is missing or malformed but the audit states an unambiguous conclusion, add only the matching canonical verdict and preserve the findings. Do not add, remove, or reclassify substantive findings. If the conclusion is ambiguous, emit VERDICT: request-revision. Do not infer a pass from general prose, expand task allowedPaths, or edit files."
302
+ },
303
+ {
304
+ "id": "write-set-gate-shell",
305
+ "depends_on": [
306
+ "final-write-set-audit-format-repair-pi"
307
+ ],
308
+ "complexity": "LOW",
309
+ "executor": "shell",
310
+ "role": "verifier",
311
+ "writePolicy": "read-only",
312
+ "allowedPaths": [
313
+ "**"
314
+ ],
315
+ "forbiddenPaths": [
316
+ ".harness/**",
317
+ "artifacts/**"
318
+ ],
319
+ "outputContract": "Deterministic final write-set audit verdict gate: exit 0 only when final-write-set-audit-format-repair-pi emits VERDICT: pass after the bounded revision round.",
320
+ "subtask_prompt": "Deterministic gate: block implement-pi unless the normalized final write-set audit emitted VERDICT: pass.",
321
+ "shell": {
322
+ "verdictGate": {
323
+ "fromNodeId": "final-write-set-audit-format-repair-pi",
324
+ "accept": [
325
+ "VERDICT: pass"
326
+ ],
327
+ "label": "write-set audit",
328
+ "lineMode": "first-verdict-line"
329
+ },
330
+ "cwd": ".",
331
+ "timeoutMs": 60000
332
+ }
333
+ },
334
+ {
335
+ "id": "implement-pi",
336
+ "depends_on": [
337
+ "write-set-gate-shell",
338
+ "plan-pi",
339
+ "plan-revision-pi",
340
+ "final-write-set-audit-format-repair-pi"
341
+ ],
342
+ "complexity": "HIGH",
343
+ "executor": "pi",
344
+ "role": "implementer",
345
+ "writePolicy": "exclusive",
346
+ "writeSet": [
347
+ "REPLACE/WITH/IMPLEMENT/WRITESET/**"
348
+ ],
349
+ "allowedPaths": [
350
+ "REPLACE/WITH/IMPLEMENT/**"
351
+ ],
352
+ "forbiddenPaths": [
353
+ ".harness/**",
354
+ "artifacts/**"
355
+ ],
356
+ "outputContract": "Implementation summary with changed files, focused tests run, and risks. Must not ask main session to write artifacts.",
357
+ "subtask_prompt": "Implement the approved change within writeSet only after write-set-gate-shell passed (upstream VERDICT: pass). If write-set gate blocked, output blocked reason without editing files. Keep changes minimal and run focused tests inside allowedPaths when implementing.",
358
+ "toolProfile": "write"
359
+ },
360
+ {
361
+ "id": "soft-verify-shell",
362
+ "depends_on": [
363
+ "implement-pi"
364
+ ],
365
+ "complexity": "LOW",
366
+ "executor": "shell",
367
+ "role": "verifier",
368
+ "writePolicy": "read-only",
369
+ "allowedPaths": [
370
+ "REPLACE/WITH/IMPLEMENT/**",
371
+ "./**"
372
+ ],
373
+ "forbiddenPaths": [
374
+ ".harness/**",
375
+ "artifacts/**"
376
+ ],
377
+ "outputContract": "Archived shell stdout/stderr with exit codes for focused verification; no worktree writes.",
378
+ "subtask_prompt": "Run focused soft verification before process supervision.",
379
+ "shell": {
380
+ "commands": [
381
+ "npx vitest run REPLACE/WITH/FOCUSED/TEST/GLOB.test.ts --reporter=dot"
382
+ ],
383
+ "verifyEvidence": {
384
+ "phase": "intermediate",
385
+ "quota": "1",
386
+ "commandSource": "inline",
387
+ "commandCount": 1,
388
+ "commandLabels": [
389
+ "focused template verification"
390
+ ]
391
+ },
392
+ "cwd": ".",
393
+ "timeoutMs": 300000
394
+ }
395
+ },
396
+ {
397
+ "id": "process-supervisor-pi",
398
+ "depends_on": [
399
+ "soft-verify-shell",
400
+ "implement-pi"
401
+ ],
402
+ "complexity": "HIGH",
403
+ "executor": "pi",
404
+ "role": "supervisor",
405
+ "writePolicy": "read-only",
406
+ "allowedPaths": [
407
+ "**"
408
+ ],
409
+ "forbiddenPaths": [
410
+ ".harness/**",
411
+ "artifacts/**"
412
+ ],
413
+ "outputContract": "Plain Markdown whose first non-empty line is VERDICT: pass or VERDICT: request-revision, followed by a REPAIR_ARTIFACT_JSON fenced block. Audit writeSet coverage, boundary drift, verification gaps, repair scope. No file writes.",
414
+ "subtask_prompt_markdown": "./agent-dag-process-supervisor.prompt.md"
415
+ },
416
+ {
417
+ "id": "process-gate-shell",
418
+ "depends_on": [
419
+ "process-supervisor-pi"
420
+ ],
421
+ "complexity": "LOW",
422
+ "executor": "shell",
423
+ "role": "verifier",
424
+ "writePolicy": "read-only",
425
+ "allowedPaths": [
426
+ "**"
427
+ ],
428
+ "forbiddenPaths": [
429
+ ".harness/**",
430
+ "artifacts/**"
431
+ ],
432
+ "outputContract": "Deterministic process supervisor verdict gate: exit 0 when first non-empty assistant output line is pass or request-revision; exit non-zero otherwise.",
433
+ "subtask_prompt": "Deterministic gate: validate process-supervisor-pi first-line VERDICT before repair/hard-verify.",
434
+ "shell": {
435
+ "verdictGate": {
436
+ "fromNodeId": "process-supervisor-pi",
437
+ "accept": [
438
+ "VERDICT: pass",
439
+ "VERDICT: request-revision"
440
+ ],
441
+ "label": "process",
442
+ "lineMode": "first-verdict-line"
443
+ },
444
+ "repairArtifactGate": {
445
+ "fromNodeId": "process-supervisor-pi",
446
+ "repairNodeId": "repair-pi"
447
+ },
448
+ "cwd": ".",
449
+ "timeoutMs": 60000
450
+ }
451
+ },
452
+ {
453
+ "id": "repair-pi",
454
+ "depends_on": [
455
+ "process-gate-shell",
456
+ "process-supervisor-pi"
457
+ ],
458
+ "complexity": "HIGH",
459
+ "executor": "pi",
460
+ "role": "implementer",
461
+ "writePolicy": "exclusive",
462
+ "writeSet": [
463
+ "REPLACE/WITH/REPAIR/WRITESET/**",
464
+ "docs/templates/agent-dag.supervised-implementation.json",
465
+ "docs/templates/agent-dag-process-supervisor.prompt.md",
466
+ "docs/templates/agent-dag-review-verdict.prompt.md",
467
+ "docs/templates/agent-dag.schema.json",
468
+ "./src/workflows/dag/types.ts",
469
+ "./src/workflows/dag/skills.ts",
470
+ "./src/executors/dag-pi-executor.ts"
471
+ ],
472
+ "allowedPaths": [
473
+ "REPLACE/WITH/REPAIR/**",
474
+ "docs/templates/**",
475
+ "./src/workflows/dag/**",
476
+ "./src/executors/**"
477
+ ],
478
+ "forbiddenPaths": [
479
+ ".harness/**",
480
+ "artifacts/**"
481
+ ],
482
+ "outputContract": "Repair summary or explicit no-op when process supervisor passed; changed files and tests when revised. Must not ask main session to write artifacts.",
483
+ "subtask_prompt": "If process-supervisor-pi returned VERDICT: request-revision, apply bounded fixes within writeSet addressing REPAIR_ARTIFACT_JSON.fixScope and preserving REPAIR_ARTIFACT_JSON.invariant. Use REPAIR_ARTIFACT_JSON.failureClass and rootCause before raw logs; raw log is fallback evidence only when rawLogFallbackAllowed is true. If VERDICT: pass, return no-op with evidence. Re-run focused tests when you change code.",
484
+ "toolProfile": "write"
485
+ },
486
+ {
487
+ "id": "hard-verify-shell",
488
+ "depends_on": [
489
+ "repair-pi"
490
+ ],
491
+ "complexity": "LOW",
492
+ "executor": "shell",
493
+ "role": "verifier",
494
+ "writePolicy": "read-only",
495
+ "allowedPaths": [
496
+ "./**",
497
+ "docs/**",
498
+ "scripts/**"
499
+ ],
500
+ "forbiddenPaths": [
501
+ ".harness/**",
502
+ "artifacts/**"
503
+ ],
504
+ "outputContract": "Archived hard verification stdout/stderr with exit codes; no worktree writes.",
505
+ "subtask_prompt": "Run hard verification after repair round.",
506
+ "shell": {
507
+ "preset": "loop-agent-standard-verify",
508
+ "commands": [
509
+ "HARNESS_ALLOW_ACTIVE_DAG_RUNS=1 bash scripts/check-repo.sh"
510
+ ],
511
+ "verifyEvidence": {
512
+ "phase": "final",
513
+ "quota": "full",
514
+ "commandSource": "inline",
515
+ "commandCount": 1,
516
+ "commandLabels": [
517
+ "active DAG repo governance checks"
518
+ ],
519
+ "finalFullRequired": true
520
+ },
521
+ "cwd": ".",
522
+ "timeoutMs": 300000
523
+ }
524
+ },
525
+ {
526
+ "id": "review-pi",
527
+ "depends_on": [
528
+ "hard-verify-shell"
529
+ ],
530
+ "complexity": "HIGH",
531
+ "executor": "pi",
532
+ "role": "reviewer",
533
+ "writePolicy": "read-only",
534
+ "allowedPaths": [
535
+ "**"
536
+ ],
537
+ "forbiddenPaths": [
538
+ ".harness/**",
539
+ "artifacts/**"
540
+ ],
541
+ "outputContract": "Plain Markdown whose first non-empty line is VERDICT: pass or VERDICT: request-revision; Critical/Important findings force request-revision. No file writes.",
542
+ "subtask_prompt_markdown": "./agent-dag-review-verdict.prompt.md"
543
+ },
544
+ {
545
+ "id": "review-gate-shell",
546
+ "depends_on": [
547
+ "review-pi"
548
+ ],
549
+ "complexity": "LOW",
550
+ "executor": "shell",
551
+ "role": "verifier",
552
+ "writePolicy": "read-only",
553
+ "allowedPaths": [
554
+ "**"
555
+ ],
556
+ "forbiddenPaths": [
557
+ ".harness/**",
558
+ "artifacts/**"
559
+ ],
560
+ "outputContract": "Deterministic review verdict gate: exit 0 only when review-pi first non-empty assistant output line is pass.",
561
+ "subtask_prompt": "Deterministic gate: block decision gate unless review-pi emitted VERDICT: pass.",
562
+ "shell": {
563
+ "verdictGate": {
564
+ "fromNodeId": "review-pi",
565
+ "accept": [
566
+ "VERDICT: pass"
567
+ ],
568
+ "label": "review",
569
+ "lineMode": "first-verdict-line"
570
+ },
571
+ "cwd": ".",
572
+ "timeoutMs": 60000
573
+ }
574
+ },
575
+ {
576
+ "id": "decision-pi",
577
+ "depends_on": [
578
+ "review-gate-shell",
579
+ "hard-verify-shell"
580
+ ],
581
+ "complexity": "HIGH",
582
+ "executor": "pi",
583
+ "role": "reviewer",
584
+ "writePolicy": "read-only",
585
+ "allowedPaths": [
586
+ "**"
587
+ ],
588
+ "forbiddenPaths": [
589
+ ".harness/**",
590
+ "artifacts/**"
591
+ ],
592
+ "outputContract": "Markdown with exactly one DECISION_ENVELOPE_JSON fenced block plus evidence summary. No file writes.",
593
+ "subtask_prompt_markdown": "./agent-dag-decision-gate.prompt.md",
594
+ "decisionGate": {
595
+ "enabled": true,
596
+ "schemaVersion": 1,
597
+ "mode": "record-only"
598
+ }
599
+ },
600
+ {
601
+ "id": "closeout-pi",
602
+ "depends_on": [
603
+ "decision-pi"
604
+ ],
605
+ "complexity": "MED",
606
+ "executor": "pi",
607
+ "role": "closeout",
608
+ "writePolicy": "read-only",
609
+ "allowedPaths": [
610
+ "**"
611
+ ],
612
+ "forbiddenPaths": [
613
+ ".harness/**",
614
+ "artifacts/**"
615
+ ],
616
+ "outputContract": "Plain Markdown closeout referencing verification, supervisor/review verdicts, and decision envelope. No file writes.",
617
+ "subtask_prompt": "Summarize the supervised DAG outcome: contract, write-set audit, implement/repair, soft/hard verify, process supervisor and review verdicts, decision-pi envelope, and recommended main-session next step. Do not edit files or write root artifacts/**."
618
+ }
619
+ ]
620
+ }