@mobrienv/autoloop 0.3.0 → 0.7.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 (415) hide show
  1. package/README.md +140 -43
  2. package/bin/autoloop +1 -1
  3. package/dist/index.d.ts +6 -0
  4. package/dist/index.js +19 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/testing/mock-backend.js +3 -5
  7. package/dist/testing/mock-backend.js.map +1 -1
  8. package/package.json +32 -10
  9. package/plugins/autoloop/.claude-plugin/plugin.json +1 -1
  10. package/dist/agent-map.d.ts +0 -10
  11. package/dist/agent-map.js +0 -58
  12. package/dist/agent-map.js.map +0 -1
  13. package/dist/backend/acp-client.d.ts +0 -38
  14. package/dist/backend/acp-client.js +0 -288
  15. package/dist/backend/acp-client.js.map +0 -1
  16. package/dist/backend/index.d.ts +0 -10
  17. package/dist/backend/index.js +0 -71
  18. package/dist/backend/index.js.map +0 -1
  19. package/dist/backend/kiro-bridge.d.ts +0 -17
  20. package/dist/backend/kiro-bridge.js +0 -84
  21. package/dist/backend/kiro-bridge.js.map +0 -1
  22. package/dist/backend/kiro-worker.d.ts +0 -1
  23. package/dist/backend/kiro-worker.js +0 -92
  24. package/dist/backend/kiro-worker.js.map +0 -1
  25. package/dist/backend/run-command.d.ts +0 -7
  26. package/dist/backend/run-command.js +0 -50
  27. package/dist/backend/run-command.js.map +0 -1
  28. package/dist/backend/run-kiro.d.ts +0 -3
  29. package/dist/backend/run-kiro.js +0 -16
  30. package/dist/backend/run-kiro.js.map +0 -1
  31. package/dist/backend/run-mock.d.ts +0 -1
  32. package/dist/backend/run-mock.js +0 -6
  33. package/dist/backend/run-mock.js.map +0 -1
  34. package/dist/backend/run-pi.d.ts +0 -5
  35. package/dist/backend/run-pi.js +0 -5
  36. package/dist/backend/run-pi.js.map +0 -1
  37. package/dist/backend/types.d.ts +0 -21
  38. package/dist/backend/types.js +0 -2
  39. package/dist/backend/types.js.map +0 -1
  40. package/dist/chains/budget.d.ts +0 -7
  41. package/dist/chains/budget.js +0 -54
  42. package/dist/chains/budget.js.map +0 -1
  43. package/dist/chains/load.d.ts +0 -18
  44. package/dist/chains/load.js +0 -129
  45. package/dist/chains/load.js.map +0 -1
  46. package/dist/chains/render.d.ts +0 -2
  47. package/dist/chains/render.js +0 -74
  48. package/dist/chains/render.js.map +0 -1
  49. package/dist/chains/run.d.ts +0 -17
  50. package/dist/chains/run.js +0 -260
  51. package/dist/chains/run.js.map +0 -1
  52. package/dist/chains/types.d.ts +0 -38
  53. package/dist/chains/types.js +0 -2
  54. package/dist/chains/types.js.map +0 -1
  55. package/dist/chains.d.ts +0 -6
  56. package/dist/chains.js +0 -5
  57. package/dist/chains.js.map +0 -1
  58. package/dist/commands/chain.d.ts +0 -1
  59. package/dist/commands/chain.js +0 -53
  60. package/dist/commands/chain.js.map +0 -1
  61. package/dist/commands/config.d.ts +0 -1
  62. package/dist/commands/config.js +0 -74
  63. package/dist/commands/config.js.map +0 -1
  64. package/dist/commands/dashboard.d.ts +0 -1
  65. package/dist/commands/dashboard.js +0 -68
  66. package/dist/commands/dashboard.js.map +0 -1
  67. package/dist/commands/guide.d.ts +0 -1
  68. package/dist/commands/guide.js +0 -33
  69. package/dist/commands/guide.js.map +0 -1
  70. package/dist/commands/inspect.d.ts +0 -1
  71. package/dist/commands/inspect.js +0 -203
  72. package/dist/commands/inspect.js.map +0 -1
  73. package/dist/commands/list.d.ts +0 -1
  74. package/dist/commands/list.js +0 -15
  75. package/dist/commands/list.js.map +0 -1
  76. package/dist/commands/loops.d.ts +0 -1
  77. package/dist/commands/loops.js +0 -72
  78. package/dist/commands/loops.js.map +0 -1
  79. package/dist/commands/memory.d.ts +0 -1
  80. package/dist/commands/memory.js +0 -65
  81. package/dist/commands/memory.js.map +0 -1
  82. package/dist/commands/pi-adapter.d.ts +0 -1
  83. package/dist/commands/pi-adapter.js +0 -6
  84. package/dist/commands/pi-adapter.js.map +0 -1
  85. package/dist/commands/run.d.ts +0 -1
  86. package/dist/commands/run.js +0 -292
  87. package/dist/commands/run.js.map +0 -1
  88. package/dist/commands/runs.d.ts +0 -1
  89. package/dist/commands/runs.js +0 -50
  90. package/dist/commands/runs.js.map +0 -1
  91. package/dist/commands/task.d.ts +0 -1
  92. package/dist/commands/task.js +0 -74
  93. package/dist/commands/task.js.map +0 -1
  94. package/dist/commands/worktree.d.ts +0 -1
  95. package/dist/commands/worktree.js +0 -162
  96. package/dist/commands/worktree.js.map +0 -1
  97. package/dist/config.d.ts +0 -31
  98. package/dist/config.js +0 -261
  99. package/dist/config.js.map +0 -1
  100. package/dist/dashboard/app.d.ts +0 -12
  101. package/dist/dashboard/app.js +0 -23
  102. package/dist/dashboard/app.js.map +0 -1
  103. package/dist/dashboard/routes/api.d.ts +0 -3
  104. package/dist/dashboard/routes/api.js +0 -130
  105. package/dist/dashboard/routes/api.js.map +0 -1
  106. package/dist/dashboard/routes/pages.d.ts +0 -2
  107. package/dist/dashboard/routes/pages.js +0 -14
  108. package/dist/dashboard/routes/pages.js.map +0 -1
  109. package/dist/dashboard/views/alpine-vendor.d.ts +0 -1
  110. package/dist/dashboard/views/alpine-vendor.js +0 -10
  111. package/dist/dashboard/views/alpine-vendor.js.map +0 -1
  112. package/dist/dashboard/views/shell.d.ts +0 -1
  113. package/dist/dashboard/views/shell.js +0 -746
  114. package/dist/dashboard/views/shell.js.map +0 -1
  115. package/dist/events/decode.d.ts +0 -2
  116. package/dist/events/decode.js +0 -45
  117. package/dist/events/decode.js.map +0 -1
  118. package/dist/events/encode.d.ts +0 -2
  119. package/dist/events/encode.js +0 -33
  120. package/dist/events/encode.js.map +0 -1
  121. package/dist/events/guards.d.ts +0 -5
  122. package/dist/events/guards.js +0 -42
  123. package/dist/events/guards.js.map +0 -1
  124. package/dist/events/types.d.ts +0 -26
  125. package/dist/events/types.js +0 -2
  126. package/dist/events/types.js.map +0 -1
  127. package/dist/harness/config-helpers.d.ts +0 -35
  128. package/dist/harness/config-helpers.js +0 -411
  129. package/dist/harness/config-helpers.js.map +0 -1
  130. package/dist/harness/coordination.d.ts +0 -1
  131. package/dist/harness/coordination.js +0 -127
  132. package/dist/harness/coordination.js.map +0 -1
  133. package/dist/harness/display.d.ts +0 -21
  134. package/dist/harness/display.js +0 -176
  135. package/dist/harness/display.js.map +0 -1
  136. package/dist/harness/emit.d.ts +0 -15
  137. package/dist/harness/emit.js +0 -240
  138. package/dist/harness/emit.js.map +0 -1
  139. package/dist/harness/index.d.ts +0 -13
  140. package/dist/harness/index.js +0 -240
  141. package/dist/harness/index.js.map +0 -1
  142. package/dist/harness/iteration.d.ts +0 -16
  143. package/dist/harness/iteration.js +0 -131
  144. package/dist/harness/iteration.js.map +0 -1
  145. package/dist/harness/journal.d.ts +0 -31
  146. package/dist/harness/journal.js +0 -178
  147. package/dist/harness/journal.js.map +0 -1
  148. package/dist/harness/metareview.d.ts +0 -4
  149. package/dist/harness/metareview.js +0 -48
  150. package/dist/harness/metareview.js.map +0 -1
  151. package/dist/harness/metrics.d.ts +0 -12
  152. package/dist/harness/metrics.js +0 -180
  153. package/dist/harness/metrics.js.map +0 -1
  154. package/dist/harness/parallel.d.ts +0 -37
  155. package/dist/harness/parallel.js +0 -237
  156. package/dist/harness/parallel.js.map +0 -1
  157. package/dist/harness/prompt.d.ts +0 -46
  158. package/dist/harness/prompt.js +0 -403
  159. package/dist/harness/prompt.js.map +0 -1
  160. package/dist/harness/scratchpad.d.ts +0 -2
  161. package/dist/harness/scratchpad.js +0 -67
  162. package/dist/harness/scratchpad.js.map +0 -1
  163. package/dist/harness/stop.d.ts +0 -5
  164. package/dist/harness/stop.js +0 -70
  165. package/dist/harness/stop.js.map +0 -1
  166. package/dist/harness/tools.d.ts +0 -3
  167. package/dist/harness/tools.js +0 -65
  168. package/dist/harness/tools.js.map +0 -1
  169. package/dist/harness/types.d.ts +0 -110
  170. package/dist/harness/types.js +0 -2
  171. package/dist/harness/types.js.map +0 -1
  172. package/dist/harness/wave/finalize-wave.d.ts +0 -9
  173. package/dist/harness/wave/finalize-wave.js +0 -87
  174. package/dist/harness/wave/finalize-wave.js.map +0 -1
  175. package/dist/harness/wave/launch-branches.d.ts +0 -6
  176. package/dist/harness/wave/launch-branches.js +0 -314
  177. package/dist/harness/wave/launch-branches.js.map +0 -1
  178. package/dist/harness/wave/parse-objectives.d.ts +0 -3
  179. package/dist/harness/wave/parse-objectives.js +0 -32
  180. package/dist/harness/wave/parse-objectives.js.map +0 -1
  181. package/dist/harness/wave/types.d.ts +0 -43
  182. package/dist/harness/wave/types.js +0 -2
  183. package/dist/harness/wave/types.js.map +0 -1
  184. package/dist/harness/wave.d.ts +0 -6
  185. package/dist/harness/wave.js +0 -159
  186. package/dist/harness/wave.js.map +0 -1
  187. package/dist/isolation/index.d.ts +0 -4
  188. package/dist/isolation/index.js +0 -3
  189. package/dist/isolation/index.js.map +0 -1
  190. package/dist/isolation/resolve.d.ts +0 -39
  191. package/dist/isolation/resolve.js +0 -118
  192. package/dist/isolation/resolve.js.map +0 -1
  193. package/dist/isolation/run-scope.d.ts +0 -21
  194. package/dist/isolation/run-scope.js +0 -50
  195. package/dist/isolation/run-scope.js.map +0 -1
  196. package/dist/json.d.ts +0 -8
  197. package/dist/json.js +0 -82
  198. package/dist/json.js.map +0 -1
  199. package/dist/loops/health.d.ts +0 -16
  200. package/dist/loops/health.js +0 -152
  201. package/dist/loops/health.js.map +0 -1
  202. package/dist/loops/list.d.ts +0 -6
  203. package/dist/loops/list.js +0 -21
  204. package/dist/loops/list.js.map +0 -1
  205. package/dist/loops/policy.d.ts +0 -6
  206. package/dist/loops/policy.js +0 -41
  207. package/dist/loops/policy.js.map +0 -1
  208. package/dist/loops/render.d.ts +0 -19
  209. package/dist/loops/render.js +0 -100
  210. package/dist/loops/render.js.map +0 -1
  211. package/dist/loops/show.d.ts +0 -8
  212. package/dist/loops/show.js +0 -31
  213. package/dist/loops/show.js.map +0 -1
  214. package/dist/loops/watch.d.ts +0 -14
  215. package/dist/loops/watch.js +0 -143
  216. package/dist/loops/watch.js.map +0 -1
  217. package/dist/main.d.ts +0 -1
  218. package/dist/main.js +0 -148
  219. package/dist/main.js.map +0 -1
  220. package/dist/markdown.d.ts +0 -10
  221. package/dist/markdown.js +0 -66
  222. package/dist/markdown.js.map +0 -1
  223. package/dist/memory-render.d.ts +0 -6
  224. package/dist/memory-render.js +0 -81
  225. package/dist/memory-render.js.map +0 -1
  226. package/dist/memory.d.ts +0 -22
  227. package/dist/memory.js +0 -318
  228. package/dist/memory.js.map +0 -1
  229. package/dist/pi-adapter.d.ts +0 -1
  230. package/dist/pi-adapter.js +0 -220
  231. package/dist/pi-adapter.js.map +0 -1
  232. package/dist/profiles.d.ts +0 -12
  233. package/dist/profiles.js +0 -71
  234. package/dist/profiles.js.map +0 -1
  235. package/dist/registry/derive.d.ts +0 -8
  236. package/dist/registry/derive.js +0 -88
  237. package/dist/registry/derive.js.map +0 -1
  238. package/dist/registry/discover.d.ts +0 -20
  239. package/dist/registry/discover.js +0 -98
  240. package/dist/registry/discover.js.map +0 -1
  241. package/dist/registry/harness.d.ts +0 -7
  242. package/dist/registry/harness.js +0 -63
  243. package/dist/registry/harness.js.map +0 -1
  244. package/dist/registry/index.d.ts +0 -6
  245. package/dist/registry/index.js +0 -6
  246. package/dist/registry/index.js.map +0 -1
  247. package/dist/registry/read.d.ts +0 -11
  248. package/dist/registry/read.js +0 -50
  249. package/dist/registry/read.js.map +0 -1
  250. package/dist/registry/rebuild.d.ts +0 -5
  251. package/dist/registry/rebuild.js +0 -22
  252. package/dist/registry/rebuild.js.map +0 -1
  253. package/dist/registry/types.d.ts +0 -28
  254. package/dist/registry/types.js +0 -2
  255. package/dist/registry/types.js.map +0 -1
  256. package/dist/registry/update.d.ts +0 -2
  257. package/dist/registry/update.js +0 -7
  258. package/dist/registry/update.js.map +0 -1
  259. package/dist/tasks-render.d.ts +0 -2
  260. package/dist/tasks-render.js +0 -44
  261. package/dist/tasks-render.js.map +0 -1
  262. package/dist/tasks.d.ts +0 -24
  263. package/dist/tasks.js +0 -184
  264. package/dist/tasks.js.map +0 -1
  265. package/dist/topology.d.ts +0 -31
  266. package/dist/topology.js +0 -309
  267. package/dist/topology.js.map +0 -1
  268. package/dist/usage.d.ts +0 -9
  269. package/dist/usage.js +0 -159
  270. package/dist/usage.js.map +0 -1
  271. package/dist/utils.d.ts +0 -21
  272. package/dist/utils.js +0 -349
  273. package/dist/utils.js.map +0 -1
  274. package/dist/worktree/clean.d.ts +0 -12
  275. package/dist/worktree/clean.js +0 -98
  276. package/dist/worktree/clean.js.map +0 -1
  277. package/dist/worktree/create.d.ts +0 -14
  278. package/dist/worktree/create.js +0 -71
  279. package/dist/worktree/create.js.map +0 -1
  280. package/dist/worktree/index.d.ts +0 -10
  281. package/dist/worktree/index.js +0 -6
  282. package/dist/worktree/index.js.map +0 -1
  283. package/dist/worktree/list.d.ts +0 -9
  284. package/dist/worktree/list.js +0 -24
  285. package/dist/worktree/list.js.map +0 -1
  286. package/dist/worktree/merge.d.ts +0 -11
  287. package/dist/worktree/merge.js +0 -129
  288. package/dist/worktree/merge.js.map +0 -1
  289. package/dist/worktree/meta.d.ts +0 -17
  290. package/dist/worktree/meta.js +0 -34
  291. package/dist/worktree/meta.js.map +0 -1
  292. package/presets/autocode/README.md +0 -81
  293. package/presets/autocode/autoloops.toml +0 -30
  294. package/presets/autocode/harness.md +0 -26
  295. package/presets/autocode/miniloops.toml +0 -22
  296. package/presets/autocode/roles/build.md +0 -34
  297. package/presets/autocode/roles/critic.md +0 -40
  298. package/presets/autocode/roles/finalizer.md +0 -43
  299. package/presets/autocode/roles/planner.md +0 -40
  300. package/presets/autocode/topology.toml +0 -32
  301. package/presets/autodoc/README.md +0 -42
  302. package/presets/autodoc/autoloops.toml +0 -21
  303. package/presets/autodoc/harness.md +0 -19
  304. package/presets/autodoc/miniloops.toml +0 -21
  305. package/presets/autodoc/roles/auditor.md +0 -39
  306. package/presets/autodoc/roles/checker.md +0 -43
  307. package/presets/autodoc/roles/publisher.md +0 -51
  308. package/presets/autodoc/roles/writer.md +0 -37
  309. package/presets/autodoc/topology.toml +0 -31
  310. package/presets/autofix/README.md +0 -56
  311. package/presets/autofix/autoloops.toml +0 -24
  312. package/presets/autofix/harness.md +0 -25
  313. package/presets/autofix/miniloops.toml +0 -21
  314. package/presets/autofix/roles/closer.md +0 -48
  315. package/presets/autofix/roles/diagnoser.md +0 -43
  316. package/presets/autofix/roles/fixer.md +0 -28
  317. package/presets/autofix/roles/verifier.md +0 -31
  318. package/presets/autofix/topology.toml +0 -33
  319. package/presets/autoideas/README.md +0 -73
  320. package/presets/autoideas/autoloops.toml +0 -18
  321. package/presets/autoideas/harness.md +0 -31
  322. package/presets/autoideas/miniloops.toml +0 -18
  323. package/presets/autoideas/roles/analyst.md +0 -32
  324. package/presets/autoideas/roles/reviewer.md +0 -36
  325. package/presets/autoideas/roles/scanner.md +0 -26
  326. package/presets/autoideas/roles/synthesizer.md +0 -61
  327. package/presets/autoideas/topology.toml +0 -32
  328. package/presets/automerge/README.md +0 -3
  329. package/presets/automerge/autoloops.toml +0 -12
  330. package/presets/automerge/harness.md +0 -10
  331. package/presets/automerge/miniloops.toml +0 -12
  332. package/presets/automerge/roles/merge.md +0 -10
  333. package/presets/automerge/topology.toml +0 -10
  334. package/presets/autoperf/README.md +0 -56
  335. package/presets/autoperf/autoloops.toml +0 -21
  336. package/presets/autoperf/harness.md +0 -21
  337. package/presets/autoperf/miniloops.toml +0 -21
  338. package/presets/autoperf/roles/judge.md +0 -38
  339. package/presets/autoperf/roles/measurer.md +0 -36
  340. package/presets/autoperf/roles/optimizer.md +0 -35
  341. package/presets/autoperf/roles/profiler.md +0 -38
  342. package/presets/autoperf/topology.toml +0 -32
  343. package/presets/autopr/README.md +0 -99
  344. package/presets/autopr/autoloops.toml +0 -22
  345. package/presets/autopr/harness.md +0 -27
  346. package/presets/autopr/miniloops.toml +0 -22
  347. package/presets/autopr/roles/collector.md +0 -55
  348. package/presets/autopr/roles/drafter.md +0 -38
  349. package/presets/autopr/roles/publisher.md +0 -28
  350. package/presets/autopr/roles/validator.md +0 -31
  351. package/presets/autopr/topology.toml +0 -32
  352. package/presets/autoqa/README.md +0 -76
  353. package/presets/autoqa/autoloops.toml +0 -21
  354. package/presets/autoqa/harness.md +0 -30
  355. package/presets/autoqa/miniloops.toml +0 -21
  356. package/presets/autoqa/roles/executor.md +0 -43
  357. package/presets/autoqa/roles/inspector.md +0 -45
  358. package/presets/autoqa/roles/planner.md +0 -55
  359. package/presets/autoqa/roles/reporter.md +0 -74
  360. package/presets/autoqa/topology.toml +0 -31
  361. package/presets/autoresearch/README.md +0 -63
  362. package/presets/autoresearch/autoloops.toml +0 -18
  363. package/presets/autoresearch/harness.md +0 -28
  364. package/presets/autoresearch/miniloops.toml +0 -18
  365. package/presets/autoresearch/roles/benchmarker.md +0 -34
  366. package/presets/autoresearch/roles/evaluator.md +0 -33
  367. package/presets/autoresearch/roles/implementer.md +0 -26
  368. package/presets/autoresearch/roles/strategist.md +0 -43
  369. package/presets/autoresearch/topology.toml +0 -31
  370. package/presets/autoreview/README.md +0 -51
  371. package/presets/autoreview/autoloops.toml +0 -21
  372. package/presets/autoreview/harness.md +0 -20
  373. package/presets/autoreview/miniloops.toml +0 -21
  374. package/presets/autoreview/roles/checker.md +0 -36
  375. package/presets/autoreview/roles/reader.md +0 -33
  376. package/presets/autoreview/roles/suggester.md +0 -26
  377. package/presets/autoreview/roles/summarizer.md +0 -57
  378. package/presets/autoreview/topology.toml +0 -31
  379. package/presets/autosec/README.md +0 -51
  380. package/presets/autosec/autoloops.toml +0 -21
  381. package/presets/autosec/harness.md +0 -20
  382. package/presets/autosec/miniloops.toml +0 -21
  383. package/presets/autosec/roles/analyst.md +0 -38
  384. package/presets/autosec/roles/hardener.md +0 -36
  385. package/presets/autosec/roles/reporter.md +0 -63
  386. package/presets/autosec/roles/scanner.md +0 -38
  387. package/presets/autosec/topology.toml +0 -31
  388. package/presets/autosimplify/README.md +0 -83
  389. package/presets/autosimplify/autoloops.toml +0 -26
  390. package/presets/autosimplify/harness.md +0 -25
  391. package/presets/autosimplify/miniloops.toml +0 -22
  392. package/presets/autosimplify/roles/reviewer.md +0 -38
  393. package/presets/autosimplify/roles/scoper.md +0 -42
  394. package/presets/autosimplify/roles/simplifier.md +0 -51
  395. package/presets/autosimplify/roles/verifier.md +0 -40
  396. package/presets/autosimplify/topology.toml +0 -32
  397. package/presets/autospec/README.md +0 -84
  398. package/presets/autospec/autoloops.toml +0 -21
  399. package/presets/autospec/harness.md +0 -23
  400. package/presets/autospec/miniloops.toml +0 -21
  401. package/presets/autospec/roles/clarifier.md +0 -39
  402. package/presets/autospec/roles/critic.md +0 -41
  403. package/presets/autospec/roles/designer.md +0 -37
  404. package/presets/autospec/roles/planner.md +0 -38
  405. package/presets/autospec/roles/researcher.md +0 -33
  406. package/presets/autospec/topology.toml +0 -38
  407. package/presets/autotest/README.md +0 -55
  408. package/presets/autotest/autoloops.toml +0 -21
  409. package/presets/autotest/harness.md +0 -21
  410. package/presets/autotest/miniloops.toml +0 -21
  411. package/presets/autotest/roles/assessor.md +0 -57
  412. package/presets/autotest/roles/runner.md +0 -31
  413. package/presets/autotest/roles/surveyor.md +0 -39
  414. package/presets/autotest/roles/writer.md +0 -37
  415. package/presets/autotest/topology.toml +0 -32
@@ -1,129 +0,0 @@
1
- import { execSync } from "node:child_process";
2
- import { shellQuote } from "../utils.js";
3
- import { readMeta, updateStatus } from "./meta.js";
4
- const DEFAULT_GIT_NAME = "autoloop";
5
- const DEFAULT_GIT_EMAIL = "autoloop@local";
6
- export function mergeWorktree(opts) {
7
- const { mainProjectDir, metaDir, strategy = "squash" } = opts;
8
- const meta = readMeta(metaDir);
9
- if (!meta)
10
- throw new Error(`no worktree meta found in ${metaDir}`);
11
- validateMergeStatus(meta);
12
- const baseBranch = meta.base_branch;
13
- const branch = meta.branch;
14
- const gitEnv = resolveGitEnv(mainProjectDir);
15
- // Checkout base branch
16
- exec(mainProjectDir, `git checkout ${shellQuote(baseBranch)}`, gitEnv);
17
- try {
18
- if (strategy === "squash") {
19
- exec(mainProjectDir, `git merge --squash ${shellQuote(branch)}`, gitEnv);
20
- exec(mainProjectDir, `git commit --no-edit -m ${shellQuote(`merge worktree ${meta.run_id} (squash)`)}`, gitEnv);
21
- }
22
- else if (strategy === "rebase") {
23
- exec(mainProjectDir, `git rebase ${shellQuote(branch)}`, gitEnv);
24
- }
25
- else {
26
- exec(mainProjectDir, `git merge --no-ff ${shellQuote(branch)} -m ${shellQuote(`merge worktree ${meta.run_id}`)}`, gitEnv);
27
- }
28
- }
29
- catch (err) {
30
- // Attempt to detect conflicts and abort
31
- const msg = err instanceof Error ? err.message : String(err);
32
- const conflicts = detectConflicts(mainProjectDir);
33
- try {
34
- if (strategy === "rebase") {
35
- exec(mainProjectDir, "git rebase --abort", gitEnv);
36
- }
37
- else {
38
- exec(mainProjectDir, "git merge --abort", gitEnv);
39
- }
40
- }
41
- catch {
42
- /* abort best-effort */
43
- }
44
- if (conflicts.length > 0) {
45
- return {
46
- success: false,
47
- conflicts,
48
- recoveryHint: `Resolve conflicts manually, then run: git merge ${branch}`,
49
- };
50
- }
51
- throw new Error(`merge failed: ${msg}`);
52
- }
53
- updateStatus(metaDir, "merged");
54
- return { success: true };
55
- }
56
- function validateMergeStatus(meta) {
57
- if (meta.status === "running") {
58
- throw new Error(`cannot merge worktree ${meta.run_id}: still running`);
59
- }
60
- if (meta.status === "merged") {
61
- throw new Error(`worktree ${meta.run_id} is already merged`);
62
- }
63
- if (meta.status === "removed") {
64
- throw new Error(`worktree ${meta.run_id} has been removed`);
65
- }
66
- }
67
- function detectConflicts(cwd) {
68
- try {
69
- const out = execSync("git diff --name-only --diff-filter=U", {
70
- cwd,
71
- encoding: "utf-8",
72
- stdio: "pipe",
73
- }).trim();
74
- return out ? out.split("\n") : [];
75
- }
76
- catch {
77
- return [];
78
- }
79
- }
80
- function resolveGitEnv(cwd) {
81
- const configuredName = readGitConfig(cwd, "user.name");
82
- const configuredEmail = readGitConfig(cwd, "user.email");
83
- const hasIdentityEnv = hasText(process.env.GIT_AUTHOR_NAME) ||
84
- hasText(process.env.GIT_AUTHOR_EMAIL) ||
85
- hasText(process.env.GIT_COMMITTER_NAME) ||
86
- hasText(process.env.GIT_COMMITTER_EMAIL);
87
- if (!hasIdentityEnv && configuredName && configuredEmail) {
88
- return undefined;
89
- }
90
- const fallbackName = textOr(process.env.AUTOLOOP_GIT_NAME, DEFAULT_GIT_NAME);
91
- const fallbackEmail = textOr(process.env.AUTOLOOP_GIT_EMAIL, DEFAULT_GIT_EMAIL);
92
- const authorName = textOr(process.env.GIT_AUTHOR_NAME) ?? configuredName ?? fallbackName;
93
- const authorEmail = textOr(process.env.GIT_AUTHOR_EMAIL) ?? configuredEmail ?? fallbackEmail;
94
- const committerName = textOr(process.env.GIT_COMMITTER_NAME) ?? configuredName ?? authorName;
95
- const committerEmail = textOr(process.env.GIT_COMMITTER_EMAIL) ?? configuredEmail ?? authorEmail;
96
- return {
97
- ...process.env,
98
- GIT_AUTHOR_NAME: authorName,
99
- GIT_AUTHOR_EMAIL: authorEmail,
100
- GIT_COMMITTER_NAME: committerName,
101
- GIT_COMMITTER_EMAIL: committerEmail,
102
- };
103
- }
104
- function readGitConfig(cwd, key) {
105
- try {
106
- const value = execSync(`git config --get ${shellQuote(key)}`, {
107
- cwd,
108
- encoding: "utf-8",
109
- stdio: "pipe",
110
- }).trim();
111
- return value === "" ? undefined : value;
112
- }
113
- catch {
114
- return undefined;
115
- }
116
- }
117
- function hasText(value) {
118
- return value !== undefined && value.trim() !== "";
119
- }
120
- function textOr(value, fallback) {
121
- if (value === undefined)
122
- return fallback;
123
- const trimmed = value.trim();
124
- return trimmed === "" ? fallback : trimmed;
125
- }
126
- function exec(cwd, cmd, env) {
127
- return execSync(cmd, { cwd, encoding: "utf-8", env, stdio: "pipe" });
128
- }
129
- //# sourceMappingURL=merge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"merge.js","sourceRoot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I,EAAE,KAAK,EAAE,CAAC;AACpD,CAAC;AAED,SAAS,MAAM,CACb,KAAyB,EACzB,QAAiB;IAEjB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IACzC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,OAAO,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;AAC7C,CAAC;AAED,SAAS,IAAI,CAAC,GAAW,EAAE,GAAW,EAAE,GAAuB;IAC7D,OAAO,QAAQ,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;AACvE,CAAC"}
@@ -1,17 +0,0 @@
1
- export type WorktreeStatus = "running" | "completed" | "failed" | "merged" | "removed";
2
- export interface WorktreeMeta {
3
- run_id: string;
4
- branch: string;
5
- worktree_path: string;
6
- base_branch: string;
7
- status: WorktreeStatus;
8
- merge_strategy: string;
9
- created_at: string;
10
- merged_at: string | null;
11
- removed_at: string | null;
12
- }
13
- export declare function metaDirForRun(mainStateDir: string, runId: string): string;
14
- export declare function writeMeta(metaDir: string, meta: WorktreeMeta): void;
15
- export declare function readMeta(metaDir: string): WorktreeMeta | null;
16
- export declare function isOrphanWorktree(meta: WorktreeMeta): boolean;
17
- export declare function updateStatus(metaDir: string, status: WorktreeStatus): void;
@@ -1,34 +0,0 @@
1
- import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync, } from "node:fs";
2
- import { join } from "node:path";
3
- const META_FILE = "meta.json";
4
- export function metaDirForRun(mainStateDir, runId) {
5
- return join(mainStateDir, "worktrees", runId);
6
- }
7
- export function writeMeta(metaDir, meta) {
8
- mkdirSync(metaDir, { recursive: true });
9
- const target = join(metaDir, META_FILE);
10
- const tmp = `${target}.tmp`;
11
- writeFileSync(tmp, `${JSON.stringify(meta, null, 2)}\n`);
12
- renameSync(tmp, target);
13
- }
14
- export function readMeta(metaDir) {
15
- const target = join(metaDir, META_FILE);
16
- if (!existsSync(target))
17
- return null;
18
- return JSON.parse(readFileSync(target, "utf-8"));
19
- }
20
- export function isOrphanWorktree(meta) {
21
- return meta.status !== "removed" && !existsSync(meta.worktree_path);
22
- }
23
- export function updateStatus(metaDir, status) {
24
- const meta = readMeta(metaDir);
25
- if (!meta)
26
- throw new Error(`no worktree meta found in ${metaDir}`);
27
- meta.status = status;
28
- if (status === "merged")
29
- meta.merged_at = new Date().toISOString();
30
- if (status === "removed")
31
- meta.removed_at = new Date().toISOString();
32
- writeMeta(metaDir, meta);
33
- }
34
- //# sourceMappingURL=meta.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../src/worktree/meta.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,UAAU,EACV,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAqBjC,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B,MAAM,UAAU,aAAa,CAAC,YAAoB,EAAE,KAAa;IAC/D,OAAO,IAAI,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,OAAe,EAAE,IAAkB;IAC3D,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACxC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,GAAG,MAAM,MAAM,CAAC;IAC5B,aAAa,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACzD,UAAU,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,OAAe;IACtC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACxC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAiB,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAkB;IACjD,OAAO,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,OAAe,EAAE,MAAsB;IAClE,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,OAAO,EAAE,CAAC,CAAC;IACnE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,MAAM,KAAK,QAAQ;QAAE,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACnE,IAAI,MAAM,KAAK,SAAS;QAAE,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrE,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC"}
@@ -1,81 +0,0 @@
1
- # Autocode miniloop
2
-
3
- Use when you need to implement a feature, refactor code, or make structured changes across a codebase.
4
-
5
- Shape:
6
- - planner
7
- - builder
8
- - critic
9
- - finalizer
10
-
11
- Shared state lives in project files plus the autoloops journal. One active step is tracked in `.autoloop/progress.md`.
12
-
13
- ## Fail-closed contract
14
-
15
- Autocode is not an approval machine.
16
-
17
- - Planner decomposes work into the next smallest slice.
18
- - Builder implements and proves the slice.
19
- - Critic tries to break the slice, including independently running a manual smoke test that exercises the builder's changed code path whenever a practical manual surface is available, and rejects on missing evidence.
20
- - Finalizer tries to prove the whole task is still incomplete before allowing completion.
21
-
22
- Success is evidence-based, not prose-based. Only the finalizer may emit `task.complete`.
23
-
24
- ## Files
25
-
26
- - `autoloops.toml` — loop + backend config
27
- - `topology.toml` — role deck + handoff graph
28
- - `harness.md` — shared harness rules loaded every iteration
29
- - `roles/planner.md`
30
- - `roles/build.md`
31
- - `roles/critic.md`
32
- - `roles/finalizer.md`
33
-
34
- ## Shared working files created by the loop
35
-
36
- The planner is expected to create and maintain:
37
- - `.autoloop/context.md`
38
- - `.autoloop/plan.md`
39
- - `.autoloop/progress.md`
40
- - `.autoloop/logs/`
41
-
42
- ## Backend
43
-
44
- This preset assumes the built-in Pi adapter:
45
-
46
- ```toml
47
- backend.kind = "pi"
48
- backend.command = "pi"
49
- ```
50
-
51
- Pi is the only supported real adapter path here.
52
-
53
- For deterministic local harness debugging only, switch to the repo mock backend:
54
-
55
- ```toml
56
- backend.kind = "command"
57
- backend.command = "../../examples/mock-backend.sh"
58
- ```
59
-
60
- ## Run
61
-
62
- From this repo root:
63
-
64
- ```bash
65
- autoloop run autocode "Add a --verbose flag to the CLI"
66
- ```
67
-
68
- For a one-off Claude dogfood run without editing config:
69
-
70
- ```bash
71
- autoloop -b claude -p autocode "Add a --verbose flag to the CLI"
72
- ```
73
-
74
- ## Intended input styles
75
-
76
- The planner prompt supports the same three broad entry modes as Ralph's code-assist preset:
77
- - a rough implementation request
78
- - a single `.code-task.md` file path
79
- - an existing implementation/spec directory
80
-
81
- The planner must normalize that into the shared working files and then hand off one concrete next slice.
@@ -1,30 +0,0 @@
1
- event_loop.max_iterations = 100
2
- event_loop.completion_event = "task.complete"
3
- event_loop.completion_promise = "LOOP_COMPLETE"
4
- # Require the critic and finalizer gates before completion is considered valid.
5
- event_loop.required_events = ["review.passed"]
6
-
7
- backend.kind = "command"
8
- backend.command = "claude"
9
- backend.timeout_ms = 3000000
10
- # For deterministic local harness testing only:
11
- # backend.kind = "command"
12
- # backend.command = "../../examples/mock-backend.sh"
13
-
14
- review.enabled = true
15
- review.timeout_ms = 300000
16
-
17
- memory.prompt_budget_chars = 8000
18
- harness.instructions_file = "harness.md"
19
-
20
- core.state_dir = ".autoloop"
21
- core.journal_file = ".autoloop/journal.jsonl"
22
- core.memory_file = ".autoloop/memory.jsonl"
23
-
24
- # Kiro backend (persistent ACP session):
25
- # backend.kind = "kiro"
26
- # backend.command = "kiro-cli"
27
- # backend.args = ["acp"]
28
- # backend.trust_all_tools = true
29
- # backend.agent = ""
30
- # backend.model = ""
@@ -1,26 +0,0 @@
1
- This project is a autoloops-native port of Ralph's code-assist/autocode preset.
2
-
3
- Global rules:
4
- - Shared working files are the source of truth: `{{STATE_DIR}}/context.md`, `{{STATE_DIR}}/plan.md`, `{{STATE_DIR}}/progress.md`, and `{{STATE_DIR}}/logs/`.
5
- - Keep only one concrete slice active at a time.
6
- - Use the event tool instead of prose-only handoffs.
7
- - Fresh context every iteration: re-read the shared working files and the relevant source before acting.
8
- - Prefer small, verifiable changes.
9
- - Verification is mandatory before `review.ready`, `review.passed`, or `task.complete`.
10
- - The critic should independently run a manual smoke test that exercises the builder's changed code path whenever the repo exposes a practical manual surface; otherwise the critic should say why no such smoke path exists.
11
- - Missing evidence means no success. No role may treat another role's assertion as proof.
12
- - Every success handoff should cite exact files changed, exact verification command(s), and commit hash when applicable.
13
- - After a slice is implemented and verified, commit it before `review.ready` or any later handoff. Every completed slice should land as its own commit. Avoid carrying verified but uncommitted work into the next iteration.
14
- - Do not dismiss a relevant issue as merely pre-existing. If it matters to the current objective, touched surface, or verification path, you must fix it now, make it the next slice, explicitly defer it with rationale in `{{STATE_DIR}}/progress.md`, or prove it is out of scope.
15
- - Maintain a `Relevant Issues` section in `{{STATE_DIR}}/progress.md`. Every relevant issue must have an explicit disposition: `fix-now`, `fix-next`, `deferred`, or `out-of-scope`.
16
- - Use `{{TOOL_PATH}} memory add learning ...` for durable repo/process learnings.
17
- - Do not invent extra phases. Stay inside planner → builder → critic → finalizer.
18
- - Only the finalizer may emit `task.complete`.
19
- - If the prompt is a path to a `.code-task.md` file or an existing implementation directory, use that as source material instead of treating it like plain prose.
20
-
21
- Role boundaries (strict):
22
- - The planner MUST NOT implement code, run tests, or make commits. It writes shared working files and emits `tasks.ready`.
23
- - The builder implements the active slice, verifies it, commits it, and emits `review.ready`. It does not plan or review.
24
- - The critic independently verifies the builder's work and emits `review.passed` or `review.rejected`. It does not build.
25
- - The finalizer checks whole-task completeness and emits `queue.advance` or `task.complete`.
26
- - If the routing topology says your next event is X, emit X — do not attempt completion or skip-ahead events.
@@ -1,22 +0,0 @@
1
- event_loop.max_iterations = 100
2
- event_loop.completion_event = "task.complete"
3
- event_loop.completion_promise = "LOOP_COMPLETE"
4
- # Require the critic and finalizer gates before completion is considered valid.
5
- event_loop.required_events = ["review.passed"]
6
-
7
- backend.kind = "pi"
8
- backend.command = "pi"
9
- backend.timeout_ms = 3000000
10
- # For deterministic local harness testing only:
11
- # backend.kind = "command"
12
- # backend.command = "../../examples/mock-backend.sh"
13
-
14
- review.enabled = true
15
- review.timeout_ms = 300000
16
-
17
- memory.prompt_budget_chars = 8000
18
- harness.instructions_file = "harness.md"
19
-
20
- core.state_dir = ".miniloop"
21
- core.journal_file = ".miniloop/journal.jsonl"
22
- core.memory_file = ".miniloop/memory.jsonl"
@@ -1,34 +0,0 @@
1
- You are the builder.
2
-
3
- Implement exactly the active slice from the latest `tasks.ready` handoff.
4
-
5
- On every activation:
6
- - Re-read `{{STATE_DIR}}/context.md`, `{{STATE_DIR}}/plan.md`, and `{{STATE_DIR}}/progress.md`.
7
- - Re-read the source files named in the current slice.
8
- - Update `{{STATE_DIR}}/progress.md` with what you are doing and how you will verify it.
9
-
10
- Process:
11
- 1. Understand the active slice and its acceptance criteria.
12
- 2. Prefer test-first work when the repo has a test harness for the area.
13
- 3. Make the smallest code change that satisfies the slice.
14
- 4. Run the strongest focused verification you can for that slice.
15
- 5. Commit the completed slice before handoff. Each completed slice should land as its own commit.
16
- 6. Record concise evidence in `{{STATE_DIR}}/progress.md` and longer output in `{{STATE_DIR}}/logs/` when useful, including the commit hash when available.
17
- 7. Emit `review.ready` with:
18
- - what changed
19
- - what was verified
20
- - the slice commit hash
21
- - any known risk or uncertainty
22
-
23
- If blocked:
24
- - Record the reason in `{{STATE_DIR}}/progress.md`.
25
- - Emit `build.blocked` with a concrete blocker and the safest next planning move.
26
-
27
- Rules:
28
- - One slice per turn.
29
- - No opportunistic side quests.
30
- - No final completion decisions.
31
- - No fake verification.
32
- - Do not emit `review.ready` for an uncommitted completed slice.
33
- - If confidence is shaky, choose the narrower, more reversible change and document why.
34
- - You MUST emit `review.ready` (or `build.blocked`) — never `review.passed`, `task.complete`, or any other event. The critic reviews your work; you do not self-approve.
@@ -1,40 +0,0 @@
1
- You are the critic.
2
-
3
- You are not the builder. Fresh eyes matter.
4
-
5
- Your job is to challenge the latest increment and try to prove it is not ready.
6
-
7
- On activation:
8
- - Re-read `{{STATE_DIR}}/context.md`, `{{STATE_DIR}}/plan.md`, and `{{STATE_DIR}}/progress.md`.
9
- - Inspect the changed files and the builder's stated verification.
10
- - Re-run the strongest relevant checks yourself when possible.
11
- - Run at least one manual smoke test that actually exercises the builder's changed code path whenever the repo exposes a practical manual surface (for example an existing smoke script, CLI invocation, dev server flow, or reproducible app path). Run it yourself instead of relying only on the builder's checks. If no practical manual smoke path exists, say that explicitly.
12
- - Treat the builder's summary as a hint, not proof.
13
-
14
- Review checklist:
15
- - Did the builder actually satisfy the active slice?
16
- - Did they silently skip an obvious edge case or acceptance criterion?
17
- - Is there needless complexity or speculative work?
18
- - Does the code fit the surrounding repo style?
19
- - Did the claimed verification really cover the change?
20
- - Did you run your own manual smoke test that exercised the builder's changed code path when a practical manual path existed?
21
- - Can you independently validate the claim from code plus evidence?
22
- - Is the verified slice committed, with `git status --short` clean except for intentional unrelated files?
23
- - Were all relevant issues discovered during the slice given an explicit disposition in `{{STATE_DIR}}/progress.md`?
24
- - Did anyone try to dismiss a relevant issue just because it was pre-existing?
25
-
26
- Emit (only these two events — never emit builder events like `review.ready` or `build.blocked`):
27
- - `review.rejected` when there is a concrete miss, bug, regression risk, failed verification, untested acceptance criterion, overbuilt solution worth fixing now, verified-but-uncommitted work that should be committed before handoff, or any relevant issue that was left unowned / untracked / ambiguously deferred.
28
- - `review.passed` only when the current slice survives skeptical review, the verified slice is committed, and all relevant issues have explicit ownership or disposition.
29
-
30
- Rules:
31
- - Default to rejection when evidence is incomplete.
32
- - Be concrete, not vague.
33
- - Prefer one strong objection over a pile of weak ones.
34
- - Do not rewrite the whole solution unless the current slice is fundamentally wrong.
35
- - Do not approve with "fix later" caveats.
36
- - If checks passed but the builder left the repo dirty, require a commit before `review.passed`.
37
- - Reject any slice that mentions or reveals a relevant issue without recording whether it is `fix-now`, `fix-next`, `deferred`, or `out-of-scope`.
38
- - `pre-existing` is never by itself a valid reason to ignore a relevant issue.
39
- - If you cannot independently validate the builder's claim from code plus evidence, reject.
40
- - If the changed code had a practical manual execution path and you did not run it yourself, treat the evidence as incomplete and reject. If no such path existed, say that explicitly.
@@ -1,43 +0,0 @@
1
- You are the finalizer.
2
-
3
- You are the last gate before loop completion.
4
-
5
- Your job is not just to ask whether the latest diff is okay.
6
- Your job is to decide whether the whole requested outcome is complete or whether the loop should continue.
7
-
8
- On activation:
9
- - Re-read `{{STATE_DIR}}/context.md`, `{{STATE_DIR}}/plan.md`, and `{{STATE_DIR}}/progress.md`.
10
- - Reconcile the latest reviewed slice against the whole request.
11
- - Check whether the numbered plan still has unfinished steps.
12
- - Check whether the current step is truly exhausted.
13
- - Run the strongest end-to-end verification you can for the whole visible outcome.
14
- - Build an explicit completion checklist before deciding.
15
-
16
- Emit (only these three events — never emit critic events like `review.passed` or `review.rejected`):
17
- - `queue.advance` if the latest slice passed review but more planned work remains or whole-task proof is still incomplete.
18
- - `finalization.failed` if the latest slice is not good enough or whole-task consistency is still broken.
19
- - `task.complete` only when:
20
- - the requested outcome is satisfied,
21
- - the numbered plan is complete,
22
- - no obvious missing slice remains,
23
- - the strongest available verification passed,
24
- - the repo is in a clean committed state for the accepted work,
25
- - and no relevant issue remains unowned, ambiguously deferred, or hand-waved as pre-existing.
26
-
27
- Required completion checklist:
28
- - requested outcome satisfied
29
- - numbered plan complete
30
- - end-to-end verification recorded
31
- - accepted work committed
32
- - repo clean
33
- - remaining issues all explicitly dispositioned
34
-
35
- Rules:
36
- - Be stricter than the critic about whole-task completeness.
37
- - Prefer one more loop over premature completion.
38
- - Do not invent new requirements.
39
- - Do not use `task.complete` just because one small slice passed review.
40
- - If the work is done but the accepted changes are still uncommitted, commit them before `task.complete`.
41
- - Do not allow `task.complete` while `{{STATE_DIR}}/progress.md` still contains a relevant issue with no clear disposition or owner.
42
- - `pre-existing` is not a valid completion rationale for a relevant issue.
43
- - Missing evidence means no completion.
@@ -1,40 +0,0 @@
1
- You are the planner.
2
-
3
- Do not implement. Do not review.
4
-
5
- Your job:
6
- 1. Normalize the user's request into shared working files.
7
- 2. Decide the next smallest meaningful slice.
8
- 3. Hand exactly one concrete slice to the builder.
9
-
10
- On every activation:
11
- - Read `{{STATE_DIR}}/context.md`, `{{STATE_DIR}}/plan.md`, and `{{STATE_DIR}}/progress.md` if they exist.
12
- - If the objective text points at a `.code-task.md` file, read it.
13
- - If the objective text points at an existing implementation/spec directory, inspect that directory.
14
- - Re-read the latest scratchpad/journal context before deciding the next slice.
15
-
16
- On first activation:
17
- - Overwrite (not append) these files to clear any stale state from prior runs:
18
- - `{{STATE_DIR}}/context.md` — request summary, source type, constraints, repo patterns, acceptance criteria
19
- - `{{STATE_DIR}}/plan.md` — numbered high-level steps, not a blob checklist
20
- - `{{STATE_DIR}}/progress.md` — current step, active slice, verification notes, completed steps
21
- - `{{STATE_DIR}}/logs/` directory if useful
22
- - Choose only Step 1's current slice.
23
- - Emit `tasks.ready` with a payload that includes:
24
- - current step
25
- - active slice
26
- - files likely to change
27
- - verification target
28
-
29
- On later activations (`queue.advance` or `build.blocked`):
30
- - Re-read the shared working files.
31
- - If the current step still has unfinished work, hand the next smallest slice in the same step.
32
- - If the current step is complete, mark it complete in `{{STATE_DIR}}/progress.md`, advance to the next numbered step, and emit the next `tasks.ready`.
33
- - Planner never emits completion. If the plan appears done, leave that proof to the critic/finalizer path instead of self-certifying success.
34
-
35
- Rules:
36
- - One active slice only.
37
- - Be specific enough that the builder can act without guessing.
38
- - Prefer vertical slices over broad refactors.
39
- - Do not create future-step work early just because you can imagine it.
40
- - Do not treat another role's summary as proof. The slice should be defined so later roles can reject it from concrete evidence.
@@ -1,32 +0,0 @@
1
- name = "autocode"
2
- completion = "task.complete"
3
-
4
- [[role]]
5
- id = "planner"
6
- emits = ["tasks.ready"]
7
- prompt_file = "roles/planner.md"
8
-
9
- [[role]]
10
- id = "builder"
11
- emits = ["review.ready", "build.blocked"]
12
- prompt_file = "roles/build.md"
13
-
14
- [[role]]
15
- id = "critic"
16
- emits = ["review.passed", "review.rejected"]
17
- prompt_file = "roles/critic.md"
18
-
19
- [[role]]
20
- id = "finalizer"
21
- emits = ["queue.advance", "finalization.failed", "task.complete"]
22
- prompt_file = "roles/finalizer.md"
23
-
24
- [handoff]
25
- "loop.start" = ["planner"]
26
- "queue.advance" = ["planner"]
27
- "build.blocked" = ["planner"]
28
- "tasks.ready" = ["builder"]
29
- "review.ready" = ["critic"]
30
- "review.rejected" = ["builder"]
31
- "review.passed" = ["finalizer"]
32
- "finalization.failed" = ["builder"]
@@ -1,42 +0,0 @@
1
- # AutoDoc miniloop
2
-
3
- Use when you need to generate or update documentation to match current code.
4
-
5
- AutoDoc audits existing documentation against the codebase, identifies gaps and staleness, writes or updates docs, verifies accuracy, and tracks progress — iterating until documentation is current.
6
-
7
- Shape:
8
- - auditor — compares docs to code, finds gaps and staleness
9
- - writer — writes or updates documentation for identified gaps
10
- - checker — verifies documentation accuracy against actual code
11
- - publisher — records completed work, manages gap queue
12
-
13
- ## How it works
14
-
15
- 1. **Auditor** inventories existing docs, compares against the codebase, identifies gaps and stale content, and prioritizes.
16
- 2. **Writer** writes or updates documentation for the highest-priority gap, matching the project's existing style, and leaves a claim-level verification checklist in `.autoloop/progress.md`.
17
- 3. **Checker** tries to disprove the new docs against the actual code, fails closed on unverified claims, and only approves documentation that survives adversarial checking.
18
- 4. **Publisher** records the completed update and decides whether to continue.
19
-
20
- ## Files
21
-
22
- - `autoloops.toml` — loop + backend config
23
- - `topology.toml` — role deck + handoff graph
24
- - `harness.md` — shared harness rules loaded every iteration
25
- - `roles/auditor.md`
26
- - `roles/writer.md`
27
- - `roles/checker.md`
28
- - `roles/publisher.md`
29
-
30
- ## Shared working files created by the loop
31
-
32
- - `.autoloop/doc-plan.md` — audit results, gaps, staleness, prioritized list
33
- - `.autoloop/doc-report.md` — compiled report of documentation changes
34
- - `.autoloop/progress.md` — current gap tracking plus the writer's claim-level verification checklist for the checker
35
-
36
- ## Run
37
-
38
- From the repo root:
39
-
40
- ```bash
41
- autoloop run presets/autodoc /path/to/target-repo
42
- ```
@@ -1,21 +0,0 @@
1
- event_loop.max_iterations = 100
2
- event_loop.completion_event = "task.complete"
3
- event_loop.completion_promise = "LOOP_COMPLETE"
4
- event_loop.required_events = ["doc.checked"]
5
-
6
- backend.kind = "command"
7
- backend.command = "claude"
8
- backend.timeout_ms = 3000000
9
- # For deterministic local harness testing only:
10
- # backend.kind = "command"
11
- # backend.command = "../../examples/mock-backend.sh"
12
-
13
- review.enabled = true
14
- review.timeout_ms = 300000
15
-
16
- memory.prompt_budget_chars = 8000
17
- harness.instructions_file = "harness.md"
18
-
19
- core.state_dir = ".autoloop"
20
- core.journal_file = ".autoloop/journal.jsonl"
21
- core.memory_file = ".autoloop/memory.jsonl"
@@ -1,19 +0,0 @@
1
- This is a autoloops-native autodoc loop for documentation generation and maintenance.
2
-
3
- The loop audits existing documentation against the codebase, identifies gaps and staleness, writes or updates docs, verifies accuracy, and compiles a report — iterating until the documentation is current.
4
-
5
- Global rules:
6
- - Shared working files are the source of truth: `{{STATE_DIR}}/doc-plan.md`, `{{STATE_DIR}}/doc-report.md`, `{{STATE_DIR}}/progress.md`.
7
- - One documentation gap at a time. Do not start writing the next doc before the current one is checked.
8
- - Use the event tool instead of prose-only handoffs.
9
- - Fresh context every iteration: re-read the shared working files and the relevant source before acting.
10
- - Write documentation that matches the project's existing style and tone.
11
- - The writer should leave a claim-level verification checklist in `{{STATE_DIR}}/progress.md` so the checker can attack specific claims, commands, paths, defaults, and examples.
12
- - Documentation must be accurate — the checker should verify every claim against the actual code and default to rejection when a meaningful claim is unverified.
13
- - Use `{{TOOL_PATH}} memory add learning ...` for durable learnings.
14
- - Do not invent extra phases. Stay inside auditor → writer → checker → publisher.
15
-
16
- State files:
17
- - `{{STATE_DIR}}/doc-plan.md` — audit results: existing docs inventory, gaps found, staleness detected, prioritized list.
18
- - `{{STATE_DIR}}/doc-report.md` — compiled report: docs written/updated, accuracy verification results.
19
- - `{{STATE_DIR}}/progress.md` — current gap being addressed, what the next role should do.