@tea-agent/loop-agent 0.1.0 → 0.2.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 (143) hide show
  1. package/AGENTS.md +62 -45
  2. package/CHANGELOG.md +60 -28
  3. package/README.md +160 -124
  4. package/bin/loop-agent.js +21 -21
  5. package/dist/adapters/index.js +3 -2
  6. package/dist/adapters/loop-agent.js +44 -2
  7. package/dist/application/dag/args.js +420 -0
  8. package/dist/application/dag/generate-task-dag.js +280 -0
  9. package/dist/application/dag/report-dag.js +14 -0
  10. package/dist/application/dag/run-dag.js +106 -0
  11. package/dist/application/dag/validate-dag.js +102 -0
  12. package/dist/application/loop/run-action.js +23 -0
  13. package/dist/cli/catalog.js +2 -237
  14. package/dist/cli/command-definitions.js +571 -0
  15. package/dist/cli/index.js +2 -0
  16. package/dist/cli/program.js +65 -1
  17. package/dist/cli/router.js +13 -0
  18. package/dist/cli-governance/active-residue-check.js +38 -0
  19. package/dist/commands/dag-report.js +6 -107
  20. package/dist/commands/dag-run-task.js +8 -466
  21. package/dist/commands/dag-validate.js +7 -179
  22. package/dist/commands/examples.js +90 -0
  23. package/dist/commands/init.js +1518 -0
  24. package/dist/commands/loop.js +57 -31
  25. package/dist/commands/pi-prompt.js +2 -9
  26. package/dist/commands/run-dag.js +7 -180
  27. package/dist/executors/cursor-executor-artifacts.js +3 -4
  28. package/dist/executors/cursor-worker-client.js +13 -3
  29. package/dist/executors/dag-cursor-executor.js +2 -3
  30. package/dist/executors/dag-pi-executor.js +3 -4
  31. package/dist/executors/dag-static-executor.js +2 -5
  32. package/dist/executors/pi-defaults.js +9 -0
  33. package/dist/executors/shell-executor.js +12 -20
  34. package/dist/governance/manifest-types.js +1 -0
  35. package/dist/infrastructure/harness/active-residue-policy.js +73 -0
  36. package/dist/infrastructure/harness/artifact-store.js +72 -0
  37. package/dist/infrastructure/harness/atomic-write.js +49 -0
  38. package/dist/infrastructure/harness/completed-facts-guard.js +40 -0
  39. package/dist/infrastructure/harness/loop-action-store.js +23 -0
  40. package/dist/infrastructure/harness/loop-store.js +41 -0
  41. package/dist/infrastructure/harness/one-shot-run-store.js +94 -0
  42. package/dist/infrastructure/harness/task-store.js +77 -0
  43. package/dist/records/one-shot-runs.js +26 -61
  44. package/dist/records/promotion.js +3 -4
  45. package/dist/shared/artifacts-core.js +5 -5
  46. package/dist/shared/logger.js +9 -15
  47. package/dist/task/delegate.js +4 -4
  48. package/dist/task/runtime.js +5 -7
  49. package/dist/task/state.js +6 -20
  50. package/dist/workflows/dag/convergence/controller.js +277 -0
  51. package/dist/workflows/dag/dynamic-runtime/condition.js +48 -0
  52. package/dist/workflows/dag/dynamic-runtime/loop-until.js +156 -0
  53. package/dist/workflows/dag/dynamic-runtime/map.js +185 -0
  54. package/dist/workflows/dag/dynamic-runtime/reduction.js +72 -0
  55. package/dist/workflows/dag/dynamic-runtime/shared.js +133 -0
  56. package/dist/workflows/dag/failure-routing.js +82 -0
  57. package/dist/workflows/dag/lifecycle.js +101 -8
  58. package/dist/workflows/dag/node-execution.js +262 -0
  59. package/dist/workflows/dag/report.js +73 -1
  60. package/dist/workflows/dag/run-store.js +36 -0
  61. package/dist/workflows/dag/runner.js +82 -1341
  62. package/dist/workflows/dag/scheduler.js +84 -0
  63. package/dist/workflows/dag/upstream-artifacts.js +20 -18
  64. package/dist/workflows/loop/actions/cursor-fix.js +191 -0
  65. package/dist/workflows/loop/actions/dag-action.js +130 -0
  66. package/dist/workflows/loop/actions/pi-review.js +267 -0
  67. package/dist/workflows/loop/actions/shared.js +157 -0
  68. package/dist/workflows/loop/actions/shell-verify.js +82 -0
  69. package/dist/workflows/loop/actions/types.js +1 -0
  70. package/dist/workflows/loop/actions/workflow-action.js +255 -0
  71. package/dist/workflows/loop/actions.js +55 -1212
  72. package/dist/workflows/loop/closeout.js +5 -4
  73. package/dist/workflows/loop/context.js +2 -3
  74. package/dist/workflows/loop/events.js +3 -2
  75. package/dist/workflows/loop/policy/auto-policy.js +104 -0
  76. package/dist/workflows/loop/policy/cursor-fix-policy.js +31 -0
  77. package/dist/workflows/loop/rounds.js +3 -3
  78. package/dist/workflows/loop/signals.js +4 -7
  79. package/dist/workflows/loop/state.js +11 -11
  80. package/docs/README.md +47 -44
  81. package/docs/agent-dag-recovery-playbook.md +32 -6
  82. package/docs/agent-dag-runner.md +17 -17
  83. package/docs/architecture/runtime-boundaries.md +147 -0
  84. package/docs/cursor-executor-usage.md +5 -5
  85. package/docs/decisions/README.md +2 -2
  86. package/docs/design/README.md +24 -24
  87. package/docs/development-principles.md +50 -50
  88. package/docs/dynamic-workflow-dag-engine-roadmap.md +6 -6
  89. package/docs/exec-plans/README.md +4 -4
  90. package/docs/exec-plans/active/README.md +10 -5
  91. package/docs/exec-plans/completed/README.md +9 -5
  92. package/docs/feature-workflow.md +111 -109
  93. package/docs/harness-methodology-verification.md +18 -18
  94. package/docs/loop-agent-harness.md +36 -36
  95. package/docs/production-readiness.md +96 -0
  96. package/docs/progress/README.md +2 -2
  97. package/docs/reports/README.md +4 -2
  98. package/docs/templates/agent-dag-decision-gate-dogfood-report.md +1 -1
  99. package/docs/templates/agent-dag-process-supervisor.prompt.md +2 -2
  100. package/docs/templates/agent-dag-report.schema.json +33 -2
  101. package/docs/templates/agent-dag-review-verdict.prompt.md +1 -1
  102. package/docs/templates/agent-dag.base.json +195 -195
  103. package/docs/templates/agent-dag.final-verification.json +190 -190
  104. package/docs/templates/agent-dag.schema.json +17 -17
  105. package/docs/templates/agent-dag.supervised-implementation.json +500 -500
  106. package/docs/templates/hybrid-dag.json +193 -193
  107. package/docs/templates/production-readiness-checklist.md +57 -0
  108. package/docs/templates/progress-log.md +7 -7
  109. package/docs/templates/project-start-checklist.md +8 -8
  110. package/docs/templates/qa-report.md +17 -11
  111. package/docs/templates/sprint-contract.md +19 -19
  112. package/docs/verification-matrix.md +37 -26
  113. package/examples/example-dag.json +51 -51
  114. package/examples/hybrid-loop-agent-dag.json +194 -194
  115. package/harness.json +5 -5
  116. package/package.json +62 -61
  117. package/skills/ai-engineering-context/SKILL.md +21 -21
  118. package/skills/loop-agent/SKILL.md +56 -171
  119. package/skills/loop-agent/references/README.md +6 -2
  120. package/skills/loop-agent/references/command-reference.md +107 -65
  121. package/skills/loop-agent/references/harness-policy.md +115 -115
  122. package/skills/loop-agent/references/hybrid-dag.md +30 -30
  123. package/skills/loop-agent/references/learned/README.md +13 -13
  124. package/skills/loop-agent/references/long-running-loop.md +59 -0
  125. package/skills/loop-agent/references/model-routing.md +1 -1
  126. package/skills/loop-agent/references/orchestrator-and-interventions.md +1 -1
  127. package/skills/loop-agent/references/pi-prompt.md +9 -9
  128. package/skills/loop-agent/references/pi-subagent-assisted-mode.md +0 -2
  129. package/skills/loop-agent/references/post-implementation-and-patterns.md +7 -7
  130. package/skills/loop-agent/references/task-workflow.md +19 -19
  131. package/skills/loop-agent/references/verification-and-failure-handling.md +54 -0
  132. package/skills/requesting-code-review/SKILL.md +40 -40
  133. package/skills/requesting-code-review/code-reviewer.md +4 -4
  134. package/skills/systematic-debugging/CREATION-LOG.md +43 -43
  135. package/skills/systematic-debugging/SKILL.md +113 -113
  136. package/skills/systematic-debugging/condition-based-waiting.md +20 -20
  137. package/skills/systematic-debugging/defense-in-depth.md +27 -27
  138. package/skills/systematic-debugging/root-cause-tracing.md +38 -38
  139. package/skills/systematic-debugging/test-academic.md +6 -6
  140. package/skills/systematic-debugging/test-pressure-1.md +6 -6
  141. package/skills/systematic-debugging/test-pressure-2.md +2 -2
  142. package/skills/systematic-debugging/test-pressure-3.md +6 -6
  143. package/skills/verification-before-completion/SKILL.md +37 -37
@@ -1,190 +1,190 @@
1
- {
2
- "version": 2,
3
- "title": "Agent DAG final verification template",
4
- "objective": "Run closeout verification gates in a fixed order: reconcile, coverage, static invariant scan, changeset impact, closeout artifact generation, final verification, and closeout summary.",
5
- "successCriteria": [
6
- "task-state-reconcile-shell runs a deterministic task drift report",
7
- "requirement-coverage-shell runs deterministic requirement coverage audit",
8
- "static-invariant-shell uses task-scoped constraints only",
9
- "changeset-impact-shell can skip with an explicit reason when the repo has no changesets/release impact",
10
- "closeout-artifact-shell runs before final-verify-shell",
11
- "final-verify-shell uses repo manifest or task-provided commands without host-specific wrappers"
12
- ],
13
- "globalConstraints": [
14
- "Do not implement Project Policy Gate",
15
- "Do not add rtk or host-specific shell wrappers as loop-agent built-ins",
16
- "Do not mutate .harness/dag-runs/completed facts",
17
- "Final verification must run after closeout artifact creation"
18
- ],
19
- "defaults": {
20
- "executor": "shell",
21
- "contextProfile": "slim",
22
- "writePolicy": "read-only",
23
- "skills": [
24
- "ai-engineering-context"
25
- ]
26
- },
27
- "executorModels": {
28
- "cursor": {
29
- "LOW": "composer-2.5",
30
- "MED": "composer-2.5",
31
- "HIGH": "composer-2.5"
32
- },
33
- "pi": {
34
- "LOW": "gpt-5.3-codex-spark",
35
- "MED": "glm-5.2",
36
- "HIGH": "gpt-5.5"
37
- }
38
- },
39
- "skillsByRole": {
40
- "verifier": [
41
- "verification-before-completion"
42
- ],
43
- "closeout": [
44
- "loop-agent",
45
- "verification-before-completion"
46
- ]
47
- },
48
- "tasks": [
49
- {
50
- "id": "task-state-reconcile-shell",
51
- "depends_on": [],
52
- "executor": "shell",
53
- "role": "verifier",
54
- "complexity": "LOW",
55
- "writePolicy": "read-only",
56
- "forbiddenPaths": [
57
- ".harness/dag-runs/completed/**",
58
- "artifacts/**"
59
- ],
60
- "shell": {
61
- "commands": [
62
- "npm run dev -- dag reconcile-tasks --glob 'REPLACE_WITH_TASK_GLOB' --markdown"
63
- ]
64
- },
65
- "outputContract": "Markdown task state/artifact/DAG/verification drift report.",
66
- "subtask_prompt": "Run deterministic task reconcile audit."
67
- },
68
- {
69
- "id": "requirement-coverage-shell",
70
- "depends_on": [],
71
- "executor": "shell",
72
- "role": "verifier",
73
- "complexity": "LOW",
74
- "writePolicy": "read-only",
75
- "forbiddenPaths": [
76
- ".harness/dag-runs/completed/**",
77
- "artifacts/**"
78
- ],
79
- "shell": {
80
- "commands": [
81
- "npm run dev -- handoff coverage REPLACE_WITH_TASK_ID --markdown"
82
- ]
83
- },
84
- "outputContract": "Markdown requirement coverage audit.",
85
- "subtask_prompt": "Run deterministic requirement coverage audit."
86
- },
87
- {
88
- "id": "static-invariant-shell",
89
- "depends_on": [],
90
- "executor": "shell",
91
- "role": "verifier",
92
- "complexity": "LOW",
93
- "writePolicy": "read-only",
94
- "forbiddenPaths": [
95
- ".harness/dag-runs/completed/**",
96
- "artifacts/**"
97
- ],
98
- "shell": {
99
- "commands": [
100
- "node -e 'const fs=require(\"fs\"); const task=\"REPLACE_WITH_TASK_ID\"; const cfg=JSON.parse(fs.readFileSync(`.harness/tasks/${task}/task.json`,\"utf8\")); const forbidden=cfg.forbiddenPaths||[]; const hard=cfg.hardConstraints||[]; console.log(`# Static invariant scan for ${task}`); console.log(`forbiddenPaths=${forbidden.length}`); console.log(`hardConstraints=${hard.length}`); if (forbidden.some((entry)=>String(entry).includes(\"harness.json\"))) console.log(\"invariant: harness.json remains forbidden by task source\"); console.log(\"No global shellPolicy or host wrapper policy was introduced by this scan.\");'"
101
- ]
102
- },
103
- "outputContract": "Task-scoped static invariant scan result.",
104
- "subtask_prompt": "Run only task-scoped invariant checks."
105
- },
106
- {
107
- "id": "changeset-impact-shell",
108
- "depends_on": [],
109
- "executor": "shell",
110
- "role": "verifier",
111
- "complexity": "LOW",
112
- "writePolicy": "read-only",
113
- "forbiddenPaths": [
114
- ".harness/dag-runs/completed/**",
115
- "artifacts/**"
116
- ],
117
- "shell": {
118
- "commands": [
119
- "node -e 'const fs=require(\"fs\"); const task=\"REPLACE_WITH_TASK_ID\"; const cfg=JSON.parse(fs.readFileSync(`.harness/tasks/${task}/task.json`,\"utf8\")); const haystack=[cfg.notes||\"\",...(cfg.hardConstraints||[]),...(cfg.sourceFiles||[])].join(\"\\n\"); process.exit(/changeset|release|publish|version/i.test(haystack)?0:2);' && { test -d .changeset || test -f .changeset/config.json || { echo \"changeset impact declared by task but no .changeset metadata found\"; exit 1; }; echo \"changeset impact metadata present\"; } || { code=$?; if test \"$code\" = 2; then if test -d .changeset || test -f .changeset/config.json; then echo \"changeset metadata present; review release notes before final verify\"; else echo \"SKIP: no changesets directory/config and task declares no release impact\"; fi; else exit \"$code\"; fi; }"
120
- ]
121
- },
122
- "outputContract": "Changeset impact audit or explicit skip reason.",
123
- "subtask_prompt": "Audit changeset/release impact or emit a skip reason."
124
- },
125
- {
126
- "id": "closeout-artifact-shell",
127
- "depends_on": [
128
- "task-state-reconcile-shell",
129
- "requirement-coverage-shell",
130
- "static-invariant-shell",
131
- "changeset-impact-shell"
132
- ],
133
- "executor": "shell",
134
- "role": "verifier",
135
- "complexity": "LOW",
136
- "writePolicy": "none",
137
- "forbiddenPaths": [
138
- ".harness/dag-runs/completed/**",
139
- "artifacts/**"
140
- ],
141
- "shell": {
142
- "commands": [
143
- "mkdir -p \"$(dirname \"REPLACE_WITH_CLOSEOUT_PATH\")\"",
144
- "printf '%s\\n' '# Final Verification Closeout' '' 'task: REPLACE_WITH_TASK_ID' 'generated before final verification; do not treat as verify evidence' > \"REPLACE_WITH_CLOSEOUT_PATH\"",
145
- "test -s \"REPLACE_WITH_CLOSEOUT_PATH\""
146
- ]
147
- },
148
- "outputContract": "Derived closeout artifact exists before final verification.",
149
- "subtask_prompt": "Create closeout artifact before final verification."
150
- },
151
- {
152
- "id": "final-verify-shell",
153
- "depends_on": [
154
- "closeout-artifact-shell"
155
- ],
156
- "executor": "shell",
157
- "role": "verifier",
158
- "complexity": "LOW",
159
- "writePolicy": "read-only",
160
- "forbiddenPaths": [
161
- ".harness/dag-runs/completed/**",
162
- "artifacts/**"
163
- ],
164
- "shell": {
165
- "commands": [
166
- "CHECK_REPO=$(node -e 'const fs=require(\"fs\"); const manifest=JSON.parse(fs.readFileSync(\"harness.json\",\"utf8\")); process.stdout.write((manifest.scripts&&manifest.scripts.checkRepo)||\"scripts/check-repo.sh\");'); HARNESS_ALLOW_ACTIVE_DAG_RUNS=1 bash \"$CHECK_REPO\""
167
- ]
168
- },
169
- "outputContract": "Final verification evidence captured after closeout artifact creation.",
170
- "subtask_prompt": "Run final verification after closeout artifact exists."
171
- },
172
- {
173
- "id": "closeout-summary-pi",
174
- "depends_on": [
175
- "final-verify-shell"
176
- ],
177
- "executor": "pi",
178
- "role": "closeout",
179
- "complexity": "LOW",
180
- "writePolicy": "read-only",
181
- "forbiddenPaths": [
182
- ".harness/**",
183
- ".harness/dag-runs/**",
184
- "artifacts/**"
185
- ],
186
- "outputContract": "Plain Markdown final closeout summary. No file writes.",
187
- "subtask_prompt": "Summarize final verification evidence. Do not write files."
188
- }
189
- ]
190
- }
1
+ {
2
+ "version": 2,
3
+ "title": "Agent DAG final verification template",
4
+ "objective": "Run closeout verification gates in a fixed order: reconcile, coverage, static invariant scan, changeset impact, closeout artifact generation, final verification, and closeout summary.",
5
+ "successCriteria": [
6
+ "task-state-reconcile-shell runs a deterministic task drift report",
7
+ "requirement-coverage-shell runs deterministic requirement coverage audit",
8
+ "static-invariant-shell uses task-scoped constraints only",
9
+ "changeset-impact-shell can skip with an explicit reason when the repo has no changesets/release impact",
10
+ "closeout-artifact-shell runs before final-verify-shell",
11
+ "final-verify-shell uses repo manifest or task-provided commands without host-specific wrappers"
12
+ ],
13
+ "globalConstraints": [
14
+ "Do not implement Project Policy Gate",
15
+ "Do not add rtk or host-specific shell wrappers as loop-agent built-ins",
16
+ "Do not mutate .harness/dag-runs/completed facts",
17
+ "Final verification must run after closeout artifact creation"
18
+ ],
19
+ "defaults": {
20
+ "executor": "shell",
21
+ "contextProfile": "slim",
22
+ "writePolicy": "read-only",
23
+ "skills": [
24
+ "ai-engineering-context"
25
+ ]
26
+ },
27
+ "executorModels": {
28
+ "cursor": {
29
+ "LOW": "composer-2.5",
30
+ "MED": "composer-2.5",
31
+ "HIGH": "composer-2.5"
32
+ },
33
+ "pi": {
34
+ "LOW": "gpt-5.3-codex-spark",
35
+ "MED": "glm-5.2",
36
+ "HIGH": "gpt-5.5"
37
+ }
38
+ },
39
+ "skillsByRole": {
40
+ "verifier": [
41
+ "verification-before-completion"
42
+ ],
43
+ "closeout": [
44
+ "loop-agent",
45
+ "verification-before-completion"
46
+ ]
47
+ },
48
+ "tasks": [
49
+ {
50
+ "id": "task-state-reconcile-shell",
51
+ "depends_on": [],
52
+ "executor": "shell",
53
+ "role": "verifier",
54
+ "complexity": "LOW",
55
+ "writePolicy": "read-only",
56
+ "forbiddenPaths": [
57
+ ".harness/dag-runs/completed/**",
58
+ "artifacts/**"
59
+ ],
60
+ "shell": {
61
+ "commands": [
62
+ "npm run dev -- dag reconcile-tasks --glob 'REPLACE_WITH_TASK_GLOB' --markdown"
63
+ ]
64
+ },
65
+ "outputContract": "Markdown task state/artifact/DAG/verification drift report.",
66
+ "subtask_prompt": "Run deterministic task reconcile audit."
67
+ },
68
+ {
69
+ "id": "requirement-coverage-shell",
70
+ "depends_on": [],
71
+ "executor": "shell",
72
+ "role": "verifier",
73
+ "complexity": "LOW",
74
+ "writePolicy": "read-only",
75
+ "forbiddenPaths": [
76
+ ".harness/dag-runs/completed/**",
77
+ "artifacts/**"
78
+ ],
79
+ "shell": {
80
+ "commands": [
81
+ "npm run dev -- handoff coverage REPLACE_WITH_TASK_ID --markdown"
82
+ ]
83
+ },
84
+ "outputContract": "Markdown requirement coverage audit.",
85
+ "subtask_prompt": "Run deterministic requirement coverage audit."
86
+ },
87
+ {
88
+ "id": "static-invariant-shell",
89
+ "depends_on": [],
90
+ "executor": "shell",
91
+ "role": "verifier",
92
+ "complexity": "LOW",
93
+ "writePolicy": "read-only",
94
+ "forbiddenPaths": [
95
+ ".harness/dag-runs/completed/**",
96
+ "artifacts/**"
97
+ ],
98
+ "shell": {
99
+ "commands": [
100
+ "node -e 'const fs=require(\"fs\"); const task=\"REPLACE_WITH_TASK_ID\"; const cfg=JSON.parse(fs.readFileSync(`.harness/tasks/${task}/task.json`,\"utf8\")); const forbidden=cfg.forbiddenPaths||[]; const hard=cfg.hardConstraints||[]; console.log(`# Static invariant scan for ${task}`); console.log(`forbiddenPaths=${forbidden.length}`); console.log(`hardConstraints=${hard.length}`); if (forbidden.some((entry)=>String(entry).includes(\"harness.json\"))) console.log(\"invariant: harness.json remains forbidden by task source\"); console.log(\"No global shellPolicy or host wrapper policy was introduced by this scan.\");'"
101
+ ]
102
+ },
103
+ "outputContract": "Task-scoped static invariant scan result.",
104
+ "subtask_prompt": "Run only task-scoped invariant checks."
105
+ },
106
+ {
107
+ "id": "changeset-impact-shell",
108
+ "depends_on": [],
109
+ "executor": "shell",
110
+ "role": "verifier",
111
+ "complexity": "LOW",
112
+ "writePolicy": "read-only",
113
+ "forbiddenPaths": [
114
+ ".harness/dag-runs/completed/**",
115
+ "artifacts/**"
116
+ ],
117
+ "shell": {
118
+ "commands": [
119
+ "node -e 'const fs=require(\"fs\"); const task=\"REPLACE_WITH_TASK_ID\"; const cfg=JSON.parse(fs.readFileSync(`.harness/tasks/${task}/task.json`,\"utf8\")); const haystack=[cfg.notes||\"\",...(cfg.hardConstraints||[]),...(cfg.sourceFiles||[])].join(\"\\n\"); process.exit(/changeset|release|publish|version/i.test(haystack)?0:2);' && { test -d .changeset || test -f .changeset/config.json || { echo \"changeset impact declared by task but no .changeset metadata found\"; exit 1; }; echo \"changeset impact metadata present\"; } || { code=$?; if test \"$code\" = 2; then if test -d .changeset || test -f .changeset/config.json; then echo \"changeset metadata present; review release notes before final verify\"; else echo \"SKIP: no changesets directory/config and task declares no release impact\"; fi; else exit \"$code\"; fi; }"
120
+ ]
121
+ },
122
+ "outputContract": "Changeset impact audit or explicit skip reason.",
123
+ "subtask_prompt": "Audit changeset/release impact or emit a skip reason."
124
+ },
125
+ {
126
+ "id": "closeout-artifact-shell",
127
+ "depends_on": [
128
+ "task-state-reconcile-shell",
129
+ "requirement-coverage-shell",
130
+ "static-invariant-shell",
131
+ "changeset-impact-shell"
132
+ ],
133
+ "executor": "shell",
134
+ "role": "verifier",
135
+ "complexity": "LOW",
136
+ "writePolicy": "none",
137
+ "forbiddenPaths": [
138
+ ".harness/dag-runs/completed/**",
139
+ "artifacts/**"
140
+ ],
141
+ "shell": {
142
+ "commands": [
143
+ "mkdir -p \"$(dirname \"REPLACE_WITH_CLOSEOUT_PATH\")\"",
144
+ "printf '%s\\n' '# Final Verification Closeout' '' 'task: REPLACE_WITH_TASK_ID' 'generated before final verification; do not treat as verify evidence' > \"REPLACE_WITH_CLOSEOUT_PATH\"",
145
+ "test -s \"REPLACE_WITH_CLOSEOUT_PATH\""
146
+ ]
147
+ },
148
+ "outputContract": "Derived closeout artifact exists before final verification.",
149
+ "subtask_prompt": "Create closeout artifact before final verification."
150
+ },
151
+ {
152
+ "id": "final-verify-shell",
153
+ "depends_on": [
154
+ "closeout-artifact-shell"
155
+ ],
156
+ "executor": "shell",
157
+ "role": "verifier",
158
+ "complexity": "LOW",
159
+ "writePolicy": "read-only",
160
+ "forbiddenPaths": [
161
+ ".harness/dag-runs/completed/**",
162
+ "artifacts/**"
163
+ ],
164
+ "shell": {
165
+ "commands": [
166
+ "CHECK_REPO=$(node -e 'const fs=require(\"fs\"); const manifest=JSON.parse(fs.readFileSync(\"harness.json\",\"utf8\")); process.stdout.write((manifest.scripts&&manifest.scripts.checkRepo)||\"scripts/check-repo.sh\");'); HARNESS_ALLOW_ACTIVE_DAG_RUNS=1 bash \"$CHECK_REPO\""
167
+ ]
168
+ },
169
+ "outputContract": "Final verification evidence captured after closeout artifact creation.",
170
+ "subtask_prompt": "Run final verification after closeout artifact exists."
171
+ },
172
+ {
173
+ "id": "closeout-summary-pi",
174
+ "depends_on": [
175
+ "final-verify-shell"
176
+ ],
177
+ "executor": "pi",
178
+ "role": "closeout",
179
+ "complexity": "LOW",
180
+ "writePolicy": "read-only",
181
+ "forbiddenPaths": [
182
+ ".harness/**",
183
+ ".harness/dag-runs/**",
184
+ "artifacts/**"
185
+ ],
186
+ "outputContract": "Plain Markdown final closeout summary. No file writes.",
187
+ "subtask_prompt": "Summarize final verification evidence. Do not write files."
188
+ }
189
+ ]
190
+ }
@@ -58,10 +58,10 @@
58
58
  "type": "object",
59
59
  "description": "Executor-owned model routing template keyed by executor then complexity. Do not use legacy top-level models or defaults.model.",
60
60
  "additionalProperties": false,
61
- "properties": {
62
- "cursor": { "$ref": "#/$defs/complexityModelMap" },
63
- "pi": { "$ref": "#/$defs/complexityModelMap" }
64
- }
61
+ "properties": {
62
+ "cursor": { "$ref": "#/$defs/complexityModelMap" },
63
+ "pi": { "$ref": "#/$defs/complexityModelMap" }
64
+ }
65
65
  },
66
66
  "tasks": {
67
67
  "type": "array",
@@ -76,11 +76,11 @@
76
76
  "complexity": {
77
77
  "enum": ["LOW", "MED", "HIGH"]
78
78
  },
79
- "executor": {
80
- "enum": ["cursor", "pi", "shell", "static"]
81
- },
82
- "toolProfile": {
83
- "enum": ["read-only", "write"]
79
+ "executor": {
80
+ "enum": ["cursor", "pi", "shell", "static"]
81
+ },
82
+ "toolProfile": {
83
+ "enum": ["read-only", "write"]
84
84
  },
85
85
  "role": {
86
86
  "enum": ["planner", "scout", "implementer", "reviewer", "supervisor", "verifier", "closeout"]
@@ -248,15 +248,15 @@
248
248
  "subtask_prompt_source": { "$ref": "#/$defs/promptSource" },
249
249
  "executor": {
250
250
  "$ref": "#/$defs/executor",
251
- "default": "pi"
251
+ "default": "pi"
252
+ },
253
+ "role": { "$ref": "#/$defs/role" },
254
+ "skills": {
255
+ "type": "array",
256
+ "items": { "type": "string", "minLength": 1 }
252
257
  },
253
- "role": { "$ref": "#/$defs/role" },
254
- "skills": {
255
- "type": "array",
256
- "items": { "type": "string", "minLength": 1 }
257
- },
258
- "toolProfile": { "$ref": "#/$defs/toolProfile" },
259
- "writePolicy": { "$ref": "#/$defs/writePolicy" },
258
+ "toolProfile": { "$ref": "#/$defs/toolProfile" },
259
+ "writePolicy": { "$ref": "#/$defs/writePolicy" },
260
260
  "writeSet": {
261
261
  "type": "array",
262
262
  "items": { "type": "string", "minLength": 1 }