@tea-agent/loop-agent 0.1.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 (264) hide show
  1. package/AGENTS.md +121 -0
  2. package/CHANGELOG.md +37 -0
  3. package/README.md +144 -0
  4. package/bin/loop-agent.js +21 -0
  5. package/dist/adapters/aimax.js +91 -0
  6. package/dist/adapters/context.js +32 -0
  7. package/dist/adapters/index.js +28 -0
  8. package/dist/adapters/loop-agent.js +98 -0
  9. package/dist/adapters/types.js +1 -0
  10. package/dist/cli/catalog.js +259 -0
  11. package/dist/cli/help.js +55 -0
  12. package/dist/cli/index.js +3 -0
  13. package/dist/cli/program.js +505 -0
  14. package/dist/cli.js +12 -0
  15. package/dist/commands/closeout.js +13 -0
  16. package/dist/commands/coverage-audit.js +14 -0
  17. package/dist/commands/cursor-prompt.js +222 -0
  18. package/dist/commands/cursor-worker.js +43 -0
  19. package/dist/commands/dag-approve.js +102 -0
  20. package/dist/commands/dag-final-verification.js +76 -0
  21. package/dist/commands/dag-init-hybrid.js +56 -0
  22. package/dist/commands/dag-reconcile-tasks.js +51 -0
  23. package/dist/commands/dag-reject.js +91 -0
  24. package/dist/commands/dag-report.js +177 -0
  25. package/dist/commands/dag-resume.js +34 -0
  26. package/dist/commands/dag-run-task.js +470 -0
  27. package/dist/commands/dag-validate.js +186 -0
  28. package/dist/commands/dag-workflow-compile.js +91 -0
  29. package/dist/commands/dag-workflow-plan.js +130 -0
  30. package/dist/commands/dag-workflow-validate.js +66 -0
  31. package/dist/commands/delegate.js +132 -0
  32. package/dist/commands/docs-archive.js +5 -0
  33. package/dist/commands/docs-audit.js +5 -0
  34. package/dist/commands/doctor.js +50 -0
  35. package/dist/commands/goal.js +92 -0
  36. package/dist/commands/handoff-check.js +5 -0
  37. package/dist/commands/harvest.js +44 -0
  38. package/dist/commands/inspect.js +11 -0
  39. package/dist/commands/instructions.js +195 -0
  40. package/dist/commands/knowledge.js +64 -0
  41. package/dist/commands/loop-benchmark.js +72 -0
  42. package/dist/commands/loop.js +241 -0
  43. package/dist/commands/new-task.js +5 -0
  44. package/dist/commands/pi-prompt.js +181 -0
  45. package/dist/commands/pi-reuse-benchmark.js +153 -0
  46. package/dist/commands/plan-list.js +5 -0
  47. package/dist/commands/promote-run.js +29 -0
  48. package/dist/commands/reference-index.js +16 -0
  49. package/dist/commands/run-dag.js +184 -0
  50. package/dist/commands/spine.js +38 -0
  51. package/dist/commands/stats.js +84 -0
  52. package/dist/commands/status.js +56 -0
  53. package/dist/commands/study-init.js +192 -0
  54. package/dist/commands/workflow.js +259 -0
  55. package/dist/commands/worktree-create.js +31 -0
  56. package/dist/commands/worktree-list.js +5 -0
  57. package/dist/commands/worktree-remove.js +26 -0
  58. package/dist/cursor-worker-entry.js +8 -0
  59. package/dist/executors/config-core.js +55 -0
  60. package/dist/executors/config.js +2 -0
  61. package/dist/executors/cursor-artifacts.js +33 -0
  62. package/dist/executors/cursor-execution-log.js +81 -0
  63. package/dist/executors/cursor-executor-artifacts.js +135 -0
  64. package/dist/executors/cursor-executor.js +468 -0
  65. package/dist/executors/cursor-run.js +115 -0
  66. package/dist/executors/cursor-tool.js +94 -0
  67. package/dist/executors/cursor-worker-client.js +213 -0
  68. package/dist/executors/cursor-worker-protocol.js +18 -0
  69. package/dist/executors/cursor-worker-server.js +54 -0
  70. package/dist/executors/cursor-worker.js +3 -0
  71. package/dist/executors/cursor.js +6 -0
  72. package/dist/executors/dag-cursor-executor.js +88 -0
  73. package/dist/executors/dag-pi-executor.js +322 -0
  74. package/dist/executors/dag-static-executor.js +45 -0
  75. package/dist/executors/dag.js +4 -0
  76. package/dist/executors/index.js +8 -0
  77. package/dist/executors/model-routing.js +60 -0
  78. package/dist/executors/pi-event-serializer.js +43 -0
  79. package/dist/executors/pi-executor.js +606 -0
  80. package/dist/executors/pi-reuse-benchmark.js +316 -0
  81. package/dist/executors/pi-runtime-reuse.js +29 -0
  82. package/dist/executors/pi-sdk-executor.js +255 -0
  83. package/dist/executors/pi-sdk.js +1 -0
  84. package/dist/executors/pi.js +3 -0
  85. package/dist/executors/shell-executor.js +300 -0
  86. package/dist/executors/shell-presets.js +47 -0
  87. package/dist/executors/shell-verification.js +251 -0
  88. package/dist/executors/shell-write-guard.js +126 -0
  89. package/dist/executors/shell.js +3 -0
  90. package/dist/executors/static.js +1 -0
  91. package/dist/governance/checks.js +434 -0
  92. package/dist/governance/harness.js +9 -0
  93. package/dist/governance/index.js +3 -0
  94. package/dist/governance/manifest-types.js +128 -0
  95. package/dist/governance/manifest.js +2 -0
  96. package/dist/governance/path-guard.js +69 -0
  97. package/dist/governance/path-guards.js +2 -0
  98. package/dist/governance/profiles.js +3 -0
  99. package/dist/governance/requirement-coverage.js +425 -0
  100. package/dist/governance/skill-safety.js +135 -0
  101. package/dist/governance/spine-audit.js +152 -0
  102. package/dist/records/closeout.js +2 -0
  103. package/dist/records/harvest.js +236 -0
  104. package/dist/records/index.js +3 -0
  105. package/dist/records/one-shot-runs.js +421 -0
  106. package/dist/records/promotion.js +199 -0
  107. package/dist/shared/artifacts-core.js +88 -0
  108. package/dist/shared/artifacts.js +2 -0
  109. package/dist/shared/context-files.js +32 -0
  110. package/dist/shared/context.js +2 -0
  111. package/dist/shared/copy-dir.js +17 -0
  112. package/dist/shared/git-progress.js +165 -0
  113. package/dist/shared/index.js +5 -0
  114. package/dist/shared/logger.js +23 -0
  115. package/dist/shared/one-shot-prompt-args.js +98 -0
  116. package/dist/shared/path-refs.js +31 -0
  117. package/dist/shared/prompts.js +26 -0
  118. package/dist/shared/reference-context.js +238 -0
  119. package/dist/shared/timeout-policy.js +19 -0
  120. package/dist/shared/timeout.js +1 -0
  121. package/dist/shared/types.js +5 -0
  122. package/dist/task/config-types.js +97 -0
  123. package/dist/task/config.js +2 -0
  124. package/dist/task/delegate.js +220 -0
  125. package/dist/task/goal-audit.js +51 -0
  126. package/dist/task/goal-policy.js +8 -0
  127. package/dist/task/goal.js +3 -0
  128. package/dist/task/ids.js +1 -0
  129. package/dist/task/index.js +9 -0
  130. package/dist/task/lifecycle.js +1 -0
  131. package/dist/task/paths.js +1 -0
  132. package/dist/task/read-model.js +149 -0
  133. package/dist/task/runtime.js +699 -0
  134. package/dist/task/source-state.js +1 -0
  135. package/dist/task/state.js +55 -0
  136. package/dist/task/subagent-guidance.js +1 -0
  137. package/dist/task/workflow-state-types.js +92 -0
  138. package/dist/task/worktree-cleanup.js +140 -0
  139. package/dist/task/worktree.js +171 -0
  140. package/dist/workflows/dag/authoring.js +8 -0
  141. package/dist/workflows/dag/authority-surface.js +138 -0
  142. package/dist/workflows/dag/canvas-observer.js +474 -0
  143. package/dist/workflows/dag/decision-envelope.js +502 -0
  144. package/dist/workflows/dag/decision-evidence.js +153 -0
  145. package/dist/workflows/dag/decision-gates.js +1 -0
  146. package/dist/workflows/dag/executor-registry.js +25 -0
  147. package/dist/workflows/dag/facts.js +4 -0
  148. package/dist/workflows/dag/failure-category.js +111 -0
  149. package/dist/workflows/dag/final-verification.js +180 -0
  150. package/dist/workflows/dag/governance-constants.js +5 -0
  151. package/dist/workflows/dag/governance-profile.js +405 -0
  152. package/dist/workflows/dag/index.js +6 -0
  153. package/dist/workflows/dag/init-hybrid.js +855 -0
  154. package/dist/workflows/dag/knowledge-curator.js +162 -0
  155. package/dist/workflows/dag/lifecycle.js +484 -0
  156. package/dist/workflows/dag/prompt-source.js +88 -0
  157. package/dist/workflows/dag/prompt.js +130 -0
  158. package/dist/workflows/dag/reconcile-tasks.js +404 -0
  159. package/dist/workflows/dag/recovery-recommendation.js +226 -0
  160. package/dist/workflows/dag/repair-artifact.js +136 -0
  161. package/dist/workflows/dag/report.js +1019 -0
  162. package/dist/workflows/dag/runner.js +1677 -0
  163. package/dist/workflows/dag/runtime.js +5 -0
  164. package/dist/workflows/dag/skill-instructions.js +471 -0
  165. package/dist/workflows/dag/skills.js +41 -0
  166. package/dist/workflows/dag/spec.js +3 -0
  167. package/dist/workflows/dag/topo.js +30 -0
  168. package/dist/workflows/dag/types.js +275 -0
  169. package/dist/workflows/dag/upstream-artifacts.js +95 -0
  170. package/dist/workflows/dag/validate.js +527 -0
  171. package/dist/workflows/dynamic/artifacts.js +65 -0
  172. package/dist/workflows/dynamic/compile.js +360 -0
  173. package/dist/workflows/dynamic/compileTypes.js +1 -0
  174. package/dist/workflows/dynamic/errors.js +5 -0
  175. package/dist/workflows/dynamic/index.js +7 -0
  176. package/dist/workflows/dynamic/profiles.js +156 -0
  177. package/dist/workflows/dynamic/spec.js +114 -0
  178. package/dist/workflows/dynamic/validate.js +275 -0
  179. package/dist/workflows/loop/actions.js +1334 -0
  180. package/dist/workflows/loop/benchmark.js +510 -0
  181. package/dist/workflows/loop/closeout.js +134 -0
  182. package/dist/workflows/loop/context.js +48 -0
  183. package/dist/workflows/loop/events.js +25 -0
  184. package/dist/workflows/loop/hash.js +32 -0
  185. package/dist/workflows/loop/index.js +8 -0
  186. package/dist/workflows/loop/paths.js +17 -0
  187. package/dist/workflows/loop/rounds.js +81 -0
  188. package/dist/workflows/loop/signals.js +55 -0
  189. package/dist/workflows/loop/state.js +116 -0
  190. package/dist/workflows/loop/templates.js +54 -0
  191. package/dist/workflows/loop/types.js +28 -0
  192. package/docs/README.md +62 -0
  193. package/docs/agent-dag-recovery-playbook.md +158 -0
  194. package/docs/agent-dag-runner.md +40 -0
  195. package/docs/cursor-executor-usage.md +25 -0
  196. package/docs/decisions/README.md +3 -0
  197. package/docs/design/README.md +36 -0
  198. package/docs/development-principles.md +71 -0
  199. package/docs/dynamic-workflow-dag-engine-roadmap.md +1749 -0
  200. package/docs/exec-plans/README.md +6 -0
  201. package/docs/exec-plans/active/README.md +5 -0
  202. package/docs/exec-plans/completed/README.md +5 -0
  203. package/docs/feature-workflow.md +184 -0
  204. package/docs/harness-methodology-debugging.md +153 -0
  205. package/docs/harness-methodology-tdd.md +130 -0
  206. package/docs/harness-methodology-verification.md +27 -0
  207. package/docs/loop-agent-harness.md +42 -0
  208. package/docs/progress/README.md +3 -0
  209. package/docs/reports/README.md +3 -0
  210. package/docs/templates/adr.md +60 -0
  211. package/docs/templates/agent-dag-authority-surface-audit.prompt.md +94 -0
  212. package/docs/templates/agent-dag-decision-envelope.schema.json +213 -0
  213. package/docs/templates/agent-dag-decision-gate-dogfood-report.md +117 -0
  214. package/docs/templates/agent-dag-decision-gate.prompt.md +246 -0
  215. package/docs/templates/agent-dag-process-supervisor.prompt.md +98 -0
  216. package/docs/templates/agent-dag-report.schema.json +423 -0
  217. package/docs/templates/agent-dag-review-verdict.prompt.md +68 -0
  218. package/docs/templates/agent-dag.base.json +195 -0
  219. package/docs/templates/agent-dag.final-verification.json +190 -0
  220. package/docs/templates/agent-dag.schema.json +316 -0
  221. package/docs/templates/agent-dag.supervised-implementation.json +500 -0
  222. package/docs/templates/exec-plan.md +64 -0
  223. package/docs/templates/feature-spec.md +53 -0
  224. package/docs/templates/hybrid-dag.json +193 -0
  225. package/docs/templates/progress-log.md +17 -0
  226. package/docs/templates/project-start-checklist.md +9 -0
  227. package/docs/templates/qa-report.md +42 -0
  228. package/docs/templates/sprint-contract.md +29 -0
  229. package/docs/verification-matrix.md +30 -0
  230. package/examples/decision-gate-agent-dag.json +123 -0
  231. package/examples/example-dag.json +51 -0
  232. package/examples/hybrid-loop-agent-dag.json +194 -0
  233. package/harness.json +92 -0
  234. package/package.json +61 -0
  235. package/skills/ai-engineering-context/SKILL.md +48 -0
  236. package/skills/loop-agent/SKILL.md +260 -0
  237. package/skills/loop-agent/references/README.md +63 -0
  238. package/skills/loop-agent/references/command-reference.md +315 -0
  239. package/skills/loop-agent/references/harness-policy.md +258 -0
  240. package/skills/loop-agent/references/hybrid-dag.md +216 -0
  241. package/skills/loop-agent/references/learned/README.md +21 -0
  242. package/skills/loop-agent/references/model-routing.md +36 -0
  243. package/skills/loop-agent/references/multi-worktree.md +54 -0
  244. package/skills/loop-agent/references/one-shot-runs.md +85 -0
  245. package/skills/loop-agent/references/orchestrator-and-interventions.md +169 -0
  246. package/skills/loop-agent/references/pi-prompt.md +23 -0
  247. package/skills/loop-agent/references/pi-subagent-assisted-mode.md +83 -0
  248. package/skills/loop-agent/references/post-implementation-and-patterns.md +44 -0
  249. package/skills/loop-agent/references/task-workflow.md +84 -0
  250. package/skills/loop-agent/references/verification-and-failure-handling.md +74 -0
  251. package/skills/requesting-code-review/SKILL.md +101 -0
  252. package/skills/requesting-code-review/code-reviewer.md +168 -0
  253. package/skills/systematic-debugging/CREATION-LOG.md +119 -0
  254. package/skills/systematic-debugging/SKILL.md +296 -0
  255. package/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  256. package/skills/systematic-debugging/condition-based-waiting.md +115 -0
  257. package/skills/systematic-debugging/defense-in-depth.md +122 -0
  258. package/skills/systematic-debugging/find-polluter.sh +63 -0
  259. package/skills/systematic-debugging/root-cause-tracing.md +169 -0
  260. package/skills/systematic-debugging/test-academic.md +14 -0
  261. package/skills/systematic-debugging/test-pressure-1.md +58 -0
  262. package/skills/systematic-debugging/test-pressure-2.md +68 -0
  263. package/skills/systematic-debugging/test-pressure-3.md +69 -0
  264. package/skills/verification-before-completion/SKILL.md +154 -0
@@ -0,0 +1,194 @@
1
+ {
2
+ "version": 2,
3
+ "title": "Hybrid DAG 示例:Pi 只读契约 + 并行侦察 + Pi 写入实现",
4
+ "objective": "演示 v2 hybrid DAG:Pi 节点返回只读契约/审查结论,Pi 节点并行只读侦察,Pi writer 节点通过 toolProfile=write 独占实现。",
5
+ "successCriteria": [
6
+ "contract-pi 返回可审计的只读实现契约摘要",
7
+ "scout-src 与 scout-tests 并行只读侦察且互不写冲突",
8
+ "implement-core 仅在声明的 writeSet 内修改代码",
9
+ "review-pi 基于上游输出完成只读审查",
10
+ "verify-shell 归档确定性验证命令输出",
11
+ "dag validate 校验通过且 ranks 符合依赖拓扑"
12
+ ],
13
+ "globalConstraints": [
14
+ "Do not commit runtime traces under .harness/dag-runs/",
15
+ "Do not enable cross-node Pi runtime reuse by default",
16
+ "Preserve CODE_AGENT_PI_BACKEND=cli-only rollback for Pi nodes",
17
+ "Every task must explicitly declare executor; defaults.executor is schema-only and not a runtime fallback",
18
+ "Prefer same-rank parallel read-only scouts over serial chains when outputs are independent",
19
+ "Add depends_on only when a child truly needs upstream output; challenge single-chain topologies during review",
20
+ "Same-rank exclusive writeSet entries must be disjoint",
21
+ "exclusive implementer nodes must use narrow, concrete writeSet paths; never use ** or repo root",
22
+ "Cursor is optional; no-Cursor environments should use Pi read-only scouts and Pi writer nodes with toolProfile=write",
23
+ "Read-only nodes must not write root artifacts/**; root artifacts/ is reserved for Level 1/current-work summaries or explicit exclusive write nodes"
24
+ ],
25
+ "defaults": {
26
+ "executor": "pi",
27
+ "piBackend": "sdk-first",
28
+ "contextProfile": "slim",
29
+ "skills": [
30
+ "ai-engineering-context"
31
+ ],
32
+ "writePolicy": "read-only"
33
+ },
34
+ "skillsByRole": {
35
+ "planner": [
36
+ "loop-agent"
37
+ ],
38
+ "scout": [
39
+ "ai-engineering-context"
40
+ ],
41
+ "implementer": [
42
+ "verification-before-completion"
43
+ ],
44
+ "reviewer": [
45
+ "requesting-code-review"
46
+ ],
47
+ "verifier": [
48
+ "verification-before-completion",
49
+ "systematic-debugging"
50
+ ],
51
+ "closeout": [
52
+ "loop-agent",
53
+ "verification-before-completion"
54
+ ]
55
+ },
56
+ "executorModels": {
57
+ "cursor": {
58
+ "LOW": "composer-2.5",
59
+ "MED": "composer-2.5",
60
+ "HIGH": "composer-2.5"
61
+ },
62
+ "pi": {
63
+ "LOW": "gpt-5.3-codex-spark",
64
+ "MED": "glm-5.2",
65
+ "HIGH": "gpt-5.5"
66
+ }
67
+ },
68
+ "tasks": [
69
+ {
70
+ "id": "contract-pi",
71
+ "depends_on": [],
72
+ "role": "planner",
73
+ "executor": "pi",
74
+ "complexity": "MED",
75
+ "writePolicy": "read-only",
76
+ "allowedPaths": [
77
+ "./**",
78
+ "docs/**"
79
+ ],
80
+ "forbiddenPaths": [
81
+ ".harness/**",
82
+ "artifacts/**"
83
+ ],
84
+ "outputContract": "Plain Markdown implementation contract summary; no file writes.",
85
+ "subtask_prompt": "阅读 ./README.md 与 docs/agent-dag-runner.md,返回 10 行以内的实现契约摘要(只读分析 + 文档建议,不改代码/文档/artifacts)。指出是否适合并行 scout 与窄 writeSet。"
86
+ },
87
+ {
88
+ "id": "scout-src",
89
+ "depends_on": [
90
+ "contract-pi"
91
+ ],
92
+ "role": "scout",
93
+ "executor": "pi",
94
+ "complexity": "LOW",
95
+ "writePolicy": "read-only",
96
+ "allowedPaths": [
97
+ "./src/workflows/dag/**"
98
+ ],
99
+ "forbiddenPaths": [
100
+ ".harness/**",
101
+ "artifacts/**"
102
+ ],
103
+ "outputContract": "Plain Markdown reconnaissance summary of DAG-related source modules; no file writes.",
104
+ "subtask_prompt": "只读审计 ./src/workflows/dag/ 中与 DAG 相关的模块,列出关键文件与职责(不要改文件)。"
105
+ },
106
+ {
107
+ "id": "scout-tests",
108
+ "depends_on": [
109
+ "contract-pi"
110
+ ],
111
+ "role": "scout",
112
+ "executor": "pi",
113
+ "complexity": "LOW",
114
+ "writePolicy": "read-only",
115
+ "allowedPaths": [
116
+ "./test/**"
117
+ ],
118
+ "forbiddenPaths": [
119
+ ".harness/**",
120
+ "artifacts/**"
121
+ ],
122
+ "outputContract": "Plain Markdown test coverage gap summary; no file writes.",
123
+ "subtask_prompt": "只读审计 ./test/ 中与 dag-runner 相关的测试覆盖,列出缺口建议(不要改文件)。"
124
+ },
125
+ {
126
+ "id": "implement-core",
127
+ "depends_on": [
128
+ "scout-src",
129
+ "scout-tests"
130
+ ],
131
+ "role": "implementer",
132
+ "executor": "pi",
133
+ "complexity": "HIGH",
134
+ "writePolicy": "exclusive",
135
+ "writeSet": [
136
+ "./src/workflows/dag/runner.ts"
137
+ ],
138
+ "allowedPaths": [
139
+ "./src/workflows/dag/**"
140
+ ],
141
+ "forbiddenPaths": [
142
+ ".harness/**",
143
+ "artifacts/**"
144
+ ],
145
+ "outputContract": "Implementation summary with changed files, tests run, and residual risks.",
146
+ "subtask_prompt": "基于上游侦察结果,在 writeSet 范围内做最小必要改动并说明风险(若无需改动则输出 no-op 理由)。",
147
+ "toolProfile": "write"
148
+ },
149
+ {
150
+ "id": "review-pi",
151
+ "depends_on": [
152
+ "implement-core"
153
+ ],
154
+ "role": "reviewer",
155
+ "executor": "pi",
156
+ "complexity": "MED",
157
+ "writePolicy": "read-only",
158
+ "allowedPaths": [
159
+ "./**",
160
+ "docs/**"
161
+ ],
162
+ "forbiddenPaths": [
163
+ ".harness/**",
164
+ "artifacts/**"
165
+ ],
166
+ "outputContract": "Plain Markdown review summary; no file writes.",
167
+ "subtask_prompt": "审查上游实现与侦察结论是否一致,列出范围漂移、验证缺口与残余风险(只读,不改文件/文档/artifacts)。"
168
+ },
169
+ {
170
+ "id": "verify-shell",
171
+ "depends_on": [
172
+ "implement-core"
173
+ ],
174
+ "role": "verifier",
175
+ "executor": "shell",
176
+ "complexity": "LOW",
177
+ "writePolicy": "read-only",
178
+ "allowedPaths": [
179
+ "./**"
180
+ ],
181
+ "forbiddenPaths": [
182
+ ".harness/**",
183
+ "artifacts/**"
184
+ ],
185
+ "outputContract": "Archived shell verification stdout/stderr with exit codes; no worktree writes.",
186
+ "subtask_prompt": "Run deterministic loop-agent verification and archive command outputs.",
187
+ "shell": {
188
+ "preset": "loop-agent-standard-verify",
189
+ "cwd": ".",
190
+ "timeoutMs": 300000
191
+ }
192
+ }
193
+ ]
194
+ }
package/harness.json ADDED
@@ -0,0 +1,92 @@
1
+ {
2
+ "version": 1,
3
+ "project": "loop-agent",
4
+ "governanceRoot": "docs",
5
+ "workflowPolicy": {
6
+ "defaultImplementationWorkflow": "agent-dag",
7
+ "dag": {
8
+ "defaultEntry": "dag run-task",
9
+ "profileRouting": {
10
+ "minimal": "standard-dag",
11
+ "standard": "standard-dag",
12
+ "reviewed": "review-gated-dag",
13
+ "supervised": "supervised-implementation"
14
+ }
15
+ },
16
+ "humanGatePolicy": {
17
+ "defaultMode": "record-only",
18
+ "pauseOn": [
19
+ "requirement-ambiguity",
20
+ "architecture-or-public-contract-risk",
21
+ "credential-cost-or-deployment-risk",
22
+ "repeated-gate-failure",
23
+ "high-or-critical-decision-risk"
24
+ ]
25
+ }
26
+ },
27
+ "entrypoints": {
28
+ "readme": "README.md",
29
+ "agents": "AGENTS.md",
30
+ "governanceIndex": "docs/README.md",
31
+ "principles": "docs/development-principles.md",
32
+ "workflow": "docs/feature-workflow.md",
33
+ "verificationMatrix": "docs/verification-matrix.md",
34
+ "loopAgentHarness": "docs/loop-agent-harness.md",
35
+ "cursorExecutorUsage": "docs/cursor-executor-usage.md"
36
+ },
37
+ "artifacts": {
38
+ "templatesDir": "docs/templates",
39
+ "execPlansDir": "docs/exec-plans",
40
+ "progressDir": "docs/progress",
41
+ "reportsDir": "docs/reports",
42
+ "decisionsDir": "docs/decisions"
43
+ },
44
+ "scripts": {
45
+ "checkRepo": "scripts/check-repo.sh",
46
+ "checkStructure": "scripts/check-engineering-structure.sh",
47
+ "checkDocIndex": "scripts/check-doc-index.sh",
48
+ "checkDocLinks": "scripts/check-doc-links.sh",
49
+ "checkHarnessRuntimeClean": "scripts/check-harness-runtime-clean.sh",
50
+ "ci": "scripts/ci.sh"
51
+ },
52
+ "models": {
53
+ "analyze": {
54
+ "provider": "wizard-local",
55
+ "model": "gpt-5.3-codex-spark",
56
+ "timeoutMs": 1800000
57
+ },
58
+ "plan": {
59
+ "provider": "wizard-local",
60
+ "model": "gpt-5.3-codex-spark",
61
+ "timeoutMs": 1800000
62
+ },
63
+ "implement": {
64
+ "provider": "wizard-local",
65
+ "model": "gpt-5.3-codex-spark",
66
+ "timeoutMs": 1800000
67
+ },
68
+ "verify": {
69
+ "provider": "wizard-local",
70
+ "model": "gpt-5.3-codex-spark",
71
+ "timeoutMs": 1800000
72
+ },
73
+ "retrospective": {
74
+ "provider": "wizard-local",
75
+ "model": "gpt-5.3-codex-spark",
76
+ "timeoutMs": 1800000
77
+ }
78
+ },
79
+ "executors": {
80
+ "pi": {
81
+ "description": "Pi planning, review, diagnosis, and bounded writing when DAG toolProfile=write",
82
+ "defaultModel": "gpt-5.3-codex-spark",
83
+ "requiresApiKey": ""
84
+ },
85
+ "cursor": {
86
+ "description": "Cursor via @cursor/sdk (default model: account default)",
87
+ "enabled": false,
88
+ "defaultModel": "default",
89
+ "requiresApiKey": "CURSOR_API_KEY"
90
+ }
91
+ }
92
+ }
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@tea-agent/loop-agent",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "bin": {
6
+ "loop-agent": "bin/loop-agent.js"
7
+ },
8
+ "files": [
9
+ "AGENTS.md",
10
+ "bin/",
11
+ "dist/",
12
+ "docs/*.md",
13
+ "docs/decisions/README.md",
14
+ "docs/design/README.md",
15
+ "docs/exec-plans/README.md",
16
+ "docs/exec-plans/active/README.md",
17
+ "docs/exec-plans/completed/README.md",
18
+ "docs/progress/README.md",
19
+ "docs/reports/README.md",
20
+ "docs/templates/",
21
+ "examples/",
22
+ "harness.json",
23
+ "skills/",
24
+ "README.md",
25
+ "CHANGELOG.md"
26
+ ],
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "scripts": {
31
+ "dev": "node --import tsx/esm src/cli.ts",
32
+ "cursor": "node --import tsx/esm src/cli.ts cursor-prompt",
33
+ "pi-prompt": "node --import tsx/esm src/cli.ts pi-prompt",
34
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
35
+ "build": "npm run clean && tsc -p tsconfig.build.json",
36
+ "prepack": "npm run build",
37
+ "prepublishOnly": "npm run typecheck && npm test && npm run build",
38
+ "lint": "tsc --noEmit",
39
+ "typecheck": "tsc --noEmit",
40
+ "test": "vitest run",
41
+ "docs:dev": "npm --prefix website start",
42
+ "docs:build": "npm --prefix website run build",
43
+ "docs:serve": "npm --prefix website run serve",
44
+ "smoke:stale-serial": "tsx scripts/smoke-stale-plan-serial.ts"
45
+ },
46
+ "dependencies": {
47
+ "commander": "^12.1.0",
48
+ "zod": "^3.25.76"
49
+ },
50
+ "optionalDependencies": {
51
+ "@cursor/sdk": "^1.0.7",
52
+ "@earendil-works/pi-coding-agent": "*",
53
+ "@earendil-works/pi-ai": "*"
54
+ },
55
+ "devDependencies": {
56
+ "tsx": "^4.20.6",
57
+ "typescript": "^5.9.3",
58
+ "vitest": "^3.2.4",
59
+ "@types/node": "^24.6.0"
60
+ }
61
+ }
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: ai-engineering-context
3
+ description: Use when an AI coding agent starts loop-agent work, prepares DAG or Loop context, delegates role-specific nodes, or decides where requirements, facts, evidence, and handoff notes belong.
4
+ ---
5
+
6
+ # AI Engineering Context
7
+
8
+ Context is an engineering artifact, not chat residue. Keep requirements, role boundaries, write authority, evidence, and handoff facts explicit.
9
+
10
+ ## When to Use
11
+
12
+ Use when starting a task, DAG, workflow, or Loop round; preparing role prompts; delegating to Cursor/Pi/shell/static executors; or handling stale plans, conflicting requirements, or missing evidence.
13
+
14
+ Do not use for private platform paths, personal memory, Google Drive rules, or replacing task skills.
15
+
16
+ ## Context Priority
17
+
18
+ Prefer facts in this order: latest user instruction; task source/contract; DAG/Loop artifacts; docs/plans/ADRs; code/tests; chat history as hints only.
19
+
20
+ If sources conflict, stop and name the conflict.
21
+
22
+ ## Role Boundaries
23
+
24
+ - Planner: contract, DAG shape, write boundary, verification plan; no implementation edits.
25
+ - Scout: code/test/doc/artifact facts; no repo writes.
26
+ - Implementer: bounded changes inside writeSet; no scope widening or completion claims.
27
+ - Reviewer: bugs, regressions, missing tests, risk; no rewrites unless assigned.
28
+ - Verifier: command evidence, reproduction, failure category; model judgment is not proof.
29
+ - Supervisor: gates, escalation, repair scope; no write-guard or human-gate bypass.
30
+ - Closeout: evidence, risks, next steps; no hidden failures.
31
+
32
+ ## Prompt Contract
33
+
34
+ Every delegated node prompt should include objective, task id, role, executor, allowed paths, forbidden paths, writeSet, upstream artifact refs, concise excerpts, output contract, expected evidence, non-goals, and stop conditions.
35
+
36
+ Read-only nodes must return findings in node output only. They must not create scratch files in the repo.
37
+
38
+ ## Persistence Rules
39
+
40
+ Requirements and constraints go in task `source/`. Execution state and node artifacts go in `.harness/`. Durable plans, reports, decisions go in `docs/`. Reusable process guidance goes in `skills/`. Chat is transient only.
41
+
42
+ ## Failure Handling
43
+
44
+ - Missing context: run scout or read the durable source.
45
+ - Ambiguous requirement: update the contract before implementation.
46
+ - Verification failure: diagnose cause before changing code.
47
+ - Missing skill instructions: treat as context defect; do not assume hidden behavior.
48
+ - Missing fresh verification: do not close out.
@@ -0,0 +1,260 @@
1
+ ---
2
+ name: loop-agent
3
+ description: >-
4
+ Use when implementing features, processing PRDs or requirements, running structured loop-agent workflows, creating harness tasks, using Agent DAG, run-dag, pi-prompt planning/review, or Cursor bounded implementation in loop-agent. Triggers: loop-agent, workflow, structured development, harness task, Agent DAG, 结构化开发, 工作流, 需求实现, PRD 实现.
5
+ ---
6
+
7
+ # loop-agent Workflow
8
+
9
+ 这是 `loop-agent` 的入口文档。它只描述当前推荐入口,不再保留旧入口作为可选主路径。
10
+
11
+ ## Canonical Harness Policy
12
+
13
+ Shared loop-agent harness workflow rules live in `references/harness-policy.md`. Repo-local `docs/loop-agent-harness.md` / `specs/loop-agent-harness.md` files should stay thin adapters for local runtime path, governance root, and verification commands.
14
+
15
+ ## 默认立场
16
+
17
+ - 主入口是 **Agent DAG**。
18
+ - 主会话负责编排、审 writeSet、复核验证与 handoff。
19
+ - DAG `pi` executor 默认用于 read-only planning / review / diagnosis;当节点声明 `toolProfile: "write"` 时用于 bounded implementation / repair;Pi 模型矩阵保持 LOW=`gpt-5.3-codex-spark`、MED=`glm-5.2`、HIGH=`gpt-5.5`。
20
+ - `pi-prompt` 与 `cursor-prompt` 都是一次性 full-capability helper;用作 sidecar 时必须在 prompt 和 tool/model 参数里显式收窄。
21
+ - Cursor 是显式启用的可选 bounded write backend;默认 no-Cursor DAG 使用 `executor: "pi"` + `toolProfile: "write"`,必须给出 allowed / forbidden paths。
22
+ - Shell verification 是事实源;任何完成声明都必须有本轮命令输出。
23
+ - 长期结论写回 `docs/exec-plans/`、`docs/reports/`、`docs/progress/` 或 `./skill/`。
24
+
25
+ ## 唯一推荐执行路径
26
+
27
+ ```bash
28
+ loop-agent new-task <task-id> "Task Title"
29
+ # write <repo-root>/.harness/tasks/<task-id>/source/需求.md
30
+ # write <repo-root>/.harness/tasks/<task-id>/source/执行约束.md
31
+
32
+ loop-agent dag run-task <task-id> --profile auto --strict-models --output <temp-dir>/<task-id>-dag.json
33
+ loop-agent dag validate --dag <temp-dir>/<task-id>-dag.json --strict-models --strict-governance
34
+ loop-agent run-dag --dag <temp-dir>/<task-id>-dag.json --cwd <repo-root>
35
+ ```
36
+
37
+ `loop-agent` 默认指 npm 上已发布的全局 CLI。自举迭代 loop-agent 本仓库时,首次安装或有意升级可用 `npm install -g @tea-agent/loop-agent@latest`,但一次自举任务启动后不要中途升级控制器,并记录 `npm list -g @tea-agent/loop-agent --depth=0` 显示的实际版本。不要用当前工作区的 `npm link` 或 `npm run dev` 控制可能改动 CLI、DAG runtime、executor、package metadata 或 build output 的任务。`npm run dev -- <args>` 只用于源码调试和聚焦 CLI 开发。
38
+
39
+ `<temp-dir>` 表示平台原生临时目录。macOS 和 Windows 都应使用实际平台路径;`/` 只用于 repo refs、JSON/Markdown 证据 refs 和 glob 约定。
40
+
41
+ 执行前必须审阅:
42
+
43
+ - `profileRouting`
44
+ - `governanceProfile`
45
+ - writer `writeSet`
46
+ - writer `forbiddenPaths`
47
+ - shell verification commands
48
+ - decision gate mode
49
+
50
+ ## Pi Sidecar
51
+
52
+ 短时规划、审查、失败归因可使用 full-capability `pi-prompt`,默认模型是 `glm-5.2`。作为只读 sidecar 时必须显式传只读 tools:
53
+
54
+ ```bash
55
+ loop-agent pi-prompt \
56
+ --cwd ~/go/src/loop-agent \
57
+ --provider wizard-local \
58
+ --model glm-5.2 \
59
+ --tools read,grep,find,ls \
60
+ --timeout 2400000 \
61
+ "Read the task source and provide a concise implementation plan. Do not edit files."
62
+ ```
63
+
64
+ 规则:
65
+
66
+ - `pi-prompt` 本身具备完整能力;只读 sidecar 必须使用 `--tools read,grep,find,ls` 并在 prompt 中写明不编辑文件。
67
+ - 高复杂度 one-shot 诊断可显式加 `--model gpt-5.5`。
68
+ - 输出是 advisory,不能替代 deterministic verification。
69
+ - 发现必须写回 task source、report、progress 或 exec plan。
70
+
71
+ ## Bounded Write Execution
72
+
73
+ 需要写代码时,默认使用 DAG `pi` executor 的 write tool profile。Pi writer 节点必须包含 task id、目标、allowed paths、forbidden paths、writeSet、硬约束和预期验证,并在执行后由主会话独立运行 shell verification。
74
+
75
+ Cursor 只作为显式启用的可选 bounded write backend。需要使用 Cursor 时:
76
+
77
+ ```bash
78
+ loop-agent cursor-prompt \
79
+ --cwd ~/go/src/loop-agent \
80
+ --timeout 1800000 \
81
+ --model composer-2.5 \
82
+ "<bounded task prompt with allowedPaths and forbiddenPaths>"
83
+ ```
84
+
85
+ Cursor prompt 与 Pi writer prompt 都必须包含:
86
+
87
+ - task id
88
+ - exact objective
89
+ - allowed paths
90
+ - forbidden paths
91
+ - hard constraints
92
+ - expected verification
93
+ - instruction to preserve unrelated files
94
+
95
+ bounded writer 完成后,主会话必须独立执行:
96
+
97
+ ```bash
98
+ git status --short
99
+ git diff --stat
100
+ bash scripts/check-repo.sh
101
+ npm run lint
102
+ npm test
103
+ npm run typecheck
104
+ loop-agent inspect
105
+ loop-agent docs audit
106
+ loop-agent handoff check <task-id>
107
+ ```
108
+
109
+ ## Operator Commands
110
+
111
+ 运行状态、恢复和收口只使用这些 operator 面:
112
+
113
+ ```bash
114
+ loop-agent dag status --run-id <run-id>
115
+ loop-agent dag doctor
116
+ loop-agent dag report --latest --markdown
117
+ loop-agent dag closeout-draft --run-id <run-id>
118
+ loop-agent promote-run <task-id> --run-id <run-id>
119
+ loop-agent closeout task <task-id>
120
+ loop-agent inspect
121
+ loop-agent doctor
122
+ loop-agent spine audit <task-id> --markdown
123
+ loop-agent knowledge curate --markdown
124
+ loop-agent loop-benchmark --markdown
125
+ loop-agent docs audit
126
+ loop-agent handoff check <task-id>
127
+ ```
128
+
129
+ ## Long-Running Loop
130
+
131
+ `loop` 是 experimental outer workflow state,用于跨多轮记录目标、压缩记忆和 round facts 引用。它不替代 Agent DAG,也不等同于已移除的顺序式 `run loop`。
132
+
133
+ 当前已可用的最小入口:
134
+
135
+ ```bash
136
+ loop-agent loop init <task-id>
137
+ loop-agent loop status <task-id>
138
+ loop-agent loop run <task-id> --action shell-verify --command "bash scripts/check-repo.sh"
139
+ loop-agent loop run <task-id> --action pi-review
140
+ loop-agent loop run <task-id> --action cursor-fix --model composer-2.5
141
+ loop-agent loop run <task-id> --action dag
142
+ loop-agent loop run <task-id> --action dag --execute
143
+ loop-agent loop run <task-id> --auto --max-rounds 3
144
+ loop-agent loop run <task-id> --auto --max-rounds 3 --allow-cursor-fix
145
+ loop-agent loop add-signal <task-id> --type human_followup --message "review this boundary before closeout"
146
+ loop-agent loop closeout <task-id>
147
+ loop-agent loop record-round <task-id> \
148
+ --action manual \
149
+ --result "summary" \
150
+ --lesson "what to carry forward" \
151
+ --next "next bounded action" \
152
+ --decision continue \
153
+ --ref ".harness/runs/completed/<run-id>/result.json"
154
+ ```
155
+
156
+ 规则:
157
+
158
+ - `loop/objective.md` 与 `loop/context.md` 是运行态投影;exec plan / task source 仍是需求状态源。
159
+ - `rounds.jsonl` 只引用 canonical facts,不复制完整 executor 日志。
160
+ - `context.md` 每轮重写为压缩记忆,不无限 append。
161
+ - `loop run --action shell-verify` 是 deterministic action;命令 exit code 决定 verification result,输出摘要写入 `loop/verification/round-N.json`。
162
+ - `loop run --action pi-review` 必须保持 read-only;工具 allowlist 固定为 `read,grep,find,ls`,输出必须包含 `findingSummary`、`failureCategory`、`nextHypothesis`、`recommendedAction`、`fixScope`、`rootCause`,其中 `recommendedAction` 只能是 `implement_fix|replan|pause|done`。
163
+ - `loop run --action cursor-fix` 必须读取 task `allowedPaths` / `forbiddenPaths`,拒绝空 allowedPaths 或 allowed/forbidden overlap;对 `complexity=medium|large` 的任务,还必须已有 loop `dag` round 证据,或在 `task.json.dagFallbackReason` 中写明 DAG runtime fallback 原因。调用现有 Cursor bounded executor,并把 one-shot evidence 归档到 `.harness/runs/completed|failed/`。
164
+ - `cursor-fix` 只表示 bounded write round 已执行;它不会把 loop 标记 complete,下一步必须进入 `shell-verify` 或 review。
165
+ - `loop run --action dag` 默认是 review mode:调用 `dag run-task <task-id> --profile auto --strict-models` 生成 DAG,再用 `dag validate --strict-models --strict-governance` 校验,并记录 review packet。
166
+ - `loop run --action dag --execute` 才会调用 `run-dag`,随后读取 `dag report --json` 作为 round result;paused DAG 会让 loop 进入 `paused`。
167
+ - `loop run --auto --max-rounds N` 使用 deterministic policy 选择下一轮 action;默认只会自动选择 shell-verify、pi-review、dag review 或 policy pause/block,不自动触发 Cursor 写入。
168
+ - 自动 `cursor-fix` 必须显式 opt-in:`task.json.loopAutoWritePolicy="enabled"`,或 `loopAutoWritePolicy="approval-required"` 加 pending approval signal / `--allow-cursor-fix`。即使 opt-in,也必须通过 `allowedPaths`/`forbiddenPaths`/DAG evidence guard;guard 失败会 pause,不会绕过写入边界。
169
+ - `loop add-signal` 写入 durable `signals.jsonl`,支持 `human_followup|approval|scope_changed|review_feedback`;urgent/scope_changed 会 pause,review feedback / human follow-up 先走 read-only Pi review,approval 触发下一轮 DAG review packet。
170
+ - Signals 不直接覆盖 `objective.md`;DAG decision envelope / approve / reject / resume 仍由 DAG action 机制管理,loop 只记录 refs。
171
+ - `loop closeout` 从 loop state、objective/context、rounds 和 signals 派生 `loop/closeout.md` draft;draft 会标出 workflow path(`dag` / `explicit-fallback` / `missing-dag-evidence` / `micro-or-small`)与 fallback reason。非 complete 状态必须标 partial/paused/blocked,不能修改 completed facts;medium/large loop 若缺少 DAG round 且没有 `dagFallbackReason`,必须把缺失 DAG 证据列为 remaining risk。
172
+ - `events.jsonl` 只用于 observability,覆盖 loop_start、round_start、action_start、action_finish、context_rewrite、decision、loop_finish;不要把 events 当状态源。
173
+ - auto mode 遇到同类 failure streak 达阈值会 blocked,避免无限重试。
174
+ - 完成声明仍必须由 shell verification、review verdict 和 success criteria coverage 证明。
175
+
176
+ ## Three-Pass Convergence
177
+
178
+ Supervised DAG convergence is opt-in through task config:
179
+
180
+ ```json
181
+ {
182
+ "convergence": {
183
+ "enabled": true,
184
+ "maxPasses": 3,
185
+ "stopOnHardVerifyPass": true,
186
+ "pauseOnRegression": true
187
+ }
188
+ }
189
+ ```
190
+
191
+ Rules:
192
+
193
+ - The feature flag `HARNESS_DAG_CONVERGENCE=off` disables DAG convergence and restores single-repair behavior.
194
+ - `process-supervisor-pi` output must include first-line `VERDICT:` plus a `REPAIR_ARTIFACT_JSON` fenced block; `repair-pi` / optional `repair-cursor` should use artifact `failureClass`, `rootCause`, `fixScope`, and `invariant` before raw logs.
195
+ - When `hard-verify-shell` fails with a retryable category and `currentPass < maxPasses`, the runner preserves current pass artifacts under `convergence/pass-N/`, resets the supervisor/process-gate/repair/hard-verify segment plus blocked downstream nodes, and re-enters the DAG ranks.
196
+ - `write-guard`, timeout, spawn/auth, and human-gate failures do not auto-retry.
197
+ - Regression signals such as lower shell success count pause the run as `convergence-regression`.
198
+ - `dag report --json` / markdown exposes `convergence.passHistory`.
199
+ - Final completion still requires full shell verification; intermediate quota/focused checks are cost controls only.
200
+
201
+ ## Repair Artifact / Spine / Knowledge
202
+
203
+ - `process-supervisor-pi` output for gated supervised DAGs must include first-line `VERDICT:` plus a `REPAIR_ARTIFACT_JSON` fenced block.
204
+ - `process-gate-shell` may set `shell.repairArtifactGate.fromNodeId`; the runner fails closed when the artifact is missing, schema-invalid, or its `fixScope` escapes the downstream repair writer allowedPaths/writeSet.
205
+ - `spine audit <task-id>` checks minimal spec spine evidence: source files, path ownership, allowed/forbidden overlap, requirement coverage, and final verification command labels.
206
+ - `dag validate --strict-governance --spine-task <task-id>` consumes the same spine audit and fails on error findings.
207
+ - `knowledge curate` turns completed convergence patterns into a human-gated learned guidance proposal and runs skill safety preflight; it never edits accepted learned guidance directly.
208
+
209
+ ## SePO-Lite Prompt Evolution
210
+
211
+ - Learned prompt deltas are human-gated proposals under task source or skill references.
212
+ - Prompt deltas must be Markdown-only process guidance; they must not add shell commands, credential handling, tool permission expansion, or completion-authority bypass rules.
213
+ - Accepted learned patterns live in `./skill/references/learned/<repo>.md` or `default.md`.
214
+ - DAG implementer prompts that already request the `loop-agent` skill may inline up to three learned Markdown sections as bounded guidance.
215
+ - Learned guidance is advisory and cannot replace shell verification or write governance.
216
+
217
+ ## Source Layout
218
+
219
+ 新代码优先从这些目录进入:
220
+
221
+ | Area | Entry |
222
+ |---|---|
223
+ | CLI command tree / help / commander program | `src/cli/` |
224
+ | DAG workflow | `src/workflows/dag/` |
225
+ | Long-running loop workflow | `src/workflows/loop/` |
226
+ | Task runtime | `src/task/` |
227
+ | Executors | `src/executors/` |
228
+ | Run records / promotion / closeout | `src/records/` |
229
+ | Governance | `src/governance/` |
230
+ | Shared helpers | `src/shared/` |
231
+ | Repo adapters | `src/adapters/` |
232
+
233
+ 不要新增平行兼容入口。CLI public export 的唯一入口是 `src/cli/index.ts`;commander command tree 和 help 实现在 `src/cli/program.ts`。
234
+
235
+ ## Hard Rules
236
+
237
+ 1. One task = one bounded work chunk.
238
+ 2. Source materials are mandatory: `source/需求.md` and `source/执行约束.md`.
239
+ 3. Agent DAG is the implementation workflow.
240
+ 4. DAG `pi` executor stays read-only unless the node sets `toolProfile: "write"`; `pi-prompt` / `cursor-prompt` are full-capability one-shot helpers and must be bounded per call.
241
+ 5. Pi writer nodes and optional Cursor write execution must be bounded by explicit allowed / forbidden paths.
242
+ 6. Completed DAG and one-shot run facts are read-only.
243
+ 7. Do not write root `artifacts/` from read-only DAG or sidecar steps.
244
+ 8. Do not keep hidden workflow state in chat only; write durable conclusions to repo artifacts.
245
+ 9. Verify before completion.
246
+
247
+ ## References
248
+
249
+ - `references/harness-policy.md`
250
+ - `references/hybrid-dag.md`
251
+ - `references/orchestrator-and-interventions.md`
252
+ - `references/command-reference.md`
253
+ - `references/task-workflow.md`
254
+ - `references/pi-prompt.md`
255
+ - `references/one-shot-runs.md`
256
+ - `references/pi-subagent-assisted-mode.md`
257
+ - `references/model-routing.md`
258
+ - `references/multi-worktree.md`
259
+ - `references/post-implementation-and-patterns.md`
260
+ - `references/verification-and-failure-handling.md`