@mobrienv/autoloop 0.1.4 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/README.md +103 -42
  2. package/bin/autoloop +0 -0
  3. package/dist/agent-map.d.ts +10 -0
  4. package/dist/agent-map.js +58 -0
  5. package/dist/agent-map.js.map +1 -0
  6. package/dist/backend/acp-client.d.ts +38 -0
  7. package/dist/backend/acp-client.js +288 -0
  8. package/dist/backend/acp-client.js.map +1 -0
  9. package/dist/backend/index.d.ts +1 -1
  10. package/dist/backend/index.js +17 -5
  11. package/dist/backend/index.js.map +1 -1
  12. package/dist/backend/kiro-bridge.d.ts +17 -0
  13. package/dist/backend/kiro-bridge.js +80 -0
  14. package/dist/backend/kiro-bridge.js.map +1 -0
  15. package/dist/backend/kiro-worker.d.ts +1 -0
  16. package/dist/backend/kiro-worker.js +83 -0
  17. package/dist/backend/kiro-worker.js.map +1 -0
  18. package/dist/backend/run-command.js +2 -2
  19. package/dist/backend/run-command.js.map +1 -1
  20. package/dist/backend/run-kiro.d.ts +3 -0
  21. package/dist/backend/run-kiro.js +12 -0
  22. package/dist/backend/run-kiro.js.map +1 -0
  23. package/dist/backend/run-pi.js.map +1 -1
  24. package/dist/chains/budget.js +16 -4
  25. package/dist/chains/budget.js.map +1 -1
  26. package/dist/chains/load.d.ts +7 -1
  27. package/dist/chains/load.js +58 -9
  28. package/dist/chains/load.js.map +1 -1
  29. package/dist/chains/render.js +36 -8
  30. package/dist/chains/render.js.map +1 -1
  31. package/dist/chains/run.js +129 -44
  32. package/dist/chains/run.js.map +1 -1
  33. package/dist/chains/types.d.ts +1 -0
  34. package/dist/chains.d.ts +5 -4
  35. package/dist/chains.js +3 -3
  36. package/dist/chains.js.map +1 -1
  37. package/dist/commands/chain.js +6 -4
  38. package/dist/commands/chain.js.map +1 -1
  39. package/dist/commands/config.d.ts +1 -0
  40. package/dist/commands/config.js +74 -0
  41. package/dist/commands/config.js.map +1 -0
  42. package/dist/commands/dashboard.d.ts +1 -0
  43. package/dist/commands/dashboard.js +68 -0
  44. package/dist/commands/dashboard.js.map +1 -0
  45. package/dist/commands/inspect.js +125 -17
  46. package/dist/commands/inspect.js.map +1 -1
  47. package/dist/commands/list.d.ts +1 -1
  48. package/dist/commands/list.js +6 -3
  49. package/dist/commands/list.js.map +1 -1
  50. package/dist/commands/loops.js +11 -11
  51. package/dist/commands/loops.js.map +1 -1
  52. package/dist/commands/memory.js +2 -2
  53. package/dist/commands/memory.js.map +1 -1
  54. package/dist/commands/run.d.ts +1 -1
  55. package/dist/commands/run.js +102 -15
  56. package/dist/commands/run.js.map +1 -1
  57. package/dist/commands/runs.d.ts +1 -0
  58. package/dist/commands/runs.js +50 -0
  59. package/dist/commands/runs.js.map +1 -0
  60. package/dist/commands/task.d.ts +1 -0
  61. package/dist/commands/task.js +74 -0
  62. package/dist/commands/task.js.map +1 -0
  63. package/dist/commands/worktree.d.ts +1 -0
  64. package/dist/commands/worktree.js +162 -0
  65. package/dist/commands/worktree.js.map +1 -0
  66. package/dist/config.d.ts +15 -1
  67. package/dist/config.js +90 -21
  68. package/dist/config.js.map +1 -1
  69. package/dist/dashboard/app.d.ts +12 -0
  70. package/dist/dashboard/app.js +23 -0
  71. package/dist/dashboard/app.js.map +1 -0
  72. package/dist/dashboard/routes/api.d.ts +3 -0
  73. package/dist/dashboard/routes/api.js +103 -0
  74. package/dist/dashboard/routes/api.js.map +1 -0
  75. package/dist/dashboard/routes/pages.d.ts +2 -0
  76. package/dist/dashboard/routes/pages.js +14 -0
  77. package/dist/dashboard/routes/pages.js.map +1 -0
  78. package/dist/dashboard/views/alpine-vendor.d.ts +1 -0
  79. package/dist/dashboard/views/alpine-vendor.js +10 -0
  80. package/dist/dashboard/views/alpine-vendor.js.map +1 -0
  81. package/dist/dashboard/views/shell.d.ts +1 -0
  82. package/dist/dashboard/views/shell.js +714 -0
  83. package/dist/dashboard/views/shell.js.map +1 -0
  84. package/dist/events/decode.js.map +1 -1
  85. package/dist/events/encode.js +2 -2
  86. package/dist/events/encode.js.map +1 -1
  87. package/dist/harness/config-helpers.d.ts +11 -0
  88. package/dist/harness/config-helpers.js +242 -64
  89. package/dist/harness/config-helpers.js.map +1 -1
  90. package/dist/harness/coordination.js +12 -12
  91. package/dist/harness/coordination.js.map +1 -1
  92. package/dist/harness/display.d.ts +4 -3
  93. package/dist/harness/display.js +57 -11
  94. package/dist/harness/display.js.map +1 -1
  95. package/dist/harness/emit.js +31 -13
  96. package/dist/harness/emit.js.map +1 -1
  97. package/dist/harness/index.d.ts +7 -7
  98. package/dist/harness/index.js +151 -35
  99. package/dist/harness/index.js.map +1 -1
  100. package/dist/harness/iteration.d.ts +12 -0
  101. package/dist/harness/iteration.js +66 -64
  102. package/dist/harness/iteration.js.map +1 -1
  103. package/dist/harness/journal.d.ts +17 -0
  104. package/dist/harness/journal.js +74 -5
  105. package/dist/harness/journal.js.map +1 -1
  106. package/dist/harness/metareview.js +30 -15
  107. package/dist/harness/metareview.js.map +1 -1
  108. package/dist/harness/metrics.js +12 -12
  109. package/dist/harness/metrics.js.map +1 -1
  110. package/dist/harness/parallel.d.ts +1 -1
  111. package/dist/harness/parallel.js +141 -62
  112. package/dist/harness/parallel.js.map +1 -1
  113. package/dist/harness/prompt.d.ts +18 -9
  114. package/dist/harness/prompt.js +80 -44
  115. package/dist/harness/prompt.js.map +1 -1
  116. package/dist/harness/scratchpad.js +8 -6
  117. package/dist/harness/scratchpad.js.map +1 -1
  118. package/dist/harness/stop.js +16 -9
  119. package/dist/harness/stop.js.map +1 -1
  120. package/dist/harness/tools.js +39 -13
  121. package/dist/harness/tools.js.map +1 -1
  122. package/dist/harness/types.d.ts +29 -0
  123. package/dist/harness/wave/finalize-wave.d.ts +1 -1
  124. package/dist/harness/wave/finalize-wave.js +36 -9
  125. package/dist/harness/wave/finalize-wave.js.map +1 -1
  126. package/dist/harness/wave/launch-branches.d.ts +2 -2
  127. package/dist/harness/wave/launch-branches.js +147 -51
  128. package/dist/harness/wave/launch-branches.js.map +1 -1
  129. package/dist/harness/wave/parse-objectives.js +4 -1
  130. package/dist/harness/wave/parse-objectives.js.map +1 -1
  131. package/dist/harness/wave.d.ts +2 -2
  132. package/dist/harness/wave.js +89 -28
  133. package/dist/harness/wave.js.map +1 -1
  134. package/dist/isolation/index.d.ts +4 -0
  135. package/dist/isolation/index.js +3 -0
  136. package/dist/isolation/index.js.map +1 -0
  137. package/dist/isolation/resolve.d.ts +39 -0
  138. package/dist/isolation/resolve.js +118 -0
  139. package/dist/isolation/resolve.js.map +1 -0
  140. package/dist/isolation/run-scope.d.ts +21 -0
  141. package/dist/isolation/run-scope.js +50 -0
  142. package/dist/isolation/run-scope.js.map +1 -0
  143. package/dist/json.js +10 -8
  144. package/dist/json.js.map +1 -1
  145. package/dist/loops/health.d.ts +4 -2
  146. package/dist/loops/health.js +73 -25
  147. package/dist/loops/health.js.map +1 -1
  148. package/dist/loops/list.d.ts +2 -2
  149. package/dist/loops/list.js +6 -6
  150. package/dist/loops/list.js.map +1 -1
  151. package/dist/loops/policy.d.ts +6 -0
  152. package/dist/loops/policy.js +41 -0
  153. package/dist/loops/policy.js.map +1 -0
  154. package/dist/loops/render.d.ts +2 -1
  155. package/dist/loops/render.js +24 -11
  156. package/dist/loops/render.js.map +1 -1
  157. package/dist/loops/show.d.ts +2 -2
  158. package/dist/loops/show.js +13 -13
  159. package/dist/loops/show.js.map +1 -1
  160. package/dist/loops/watch.d.ts +7 -1
  161. package/dist/loops/watch.js +82 -16
  162. package/dist/loops/watch.js.map +1 -1
  163. package/dist/main.js +58 -16
  164. package/dist/main.js.map +1 -1
  165. package/dist/markdown.js +11 -11
  166. package/dist/markdown.js.map +1 -1
  167. package/dist/memory-render.js +5 -5
  168. package/dist/memory-render.js.map +1 -1
  169. package/dist/memory.d.ts +1 -2
  170. package/dist/memory.js +44 -40
  171. package/dist/memory.js.map +1 -1
  172. package/dist/pi-adapter.js +11 -11
  173. package/dist/pi-adapter.js.map +1 -1
  174. package/dist/profiles.d.ts +12 -0
  175. package/dist/profiles.js +71 -0
  176. package/dist/profiles.js.map +1 -0
  177. package/dist/registry/derive.js +10 -3
  178. package/dist/registry/derive.js.map +1 -1
  179. package/dist/registry/discover.d.ts +20 -0
  180. package/dist/registry/discover.js +98 -0
  181. package/dist/registry/discover.js.map +1 -0
  182. package/dist/registry/harness.js +8 -2
  183. package/dist/registry/harness.js.map +1 -1
  184. package/dist/registry/index.d.ts +4 -3
  185. package/dist/registry/index.js +3 -2
  186. package/dist/registry/index.js.map +1 -1
  187. package/dist/registry/read.js.map +1 -1
  188. package/dist/registry/rebuild.js +7 -4
  189. package/dist/registry/rebuild.js.map +1 -1
  190. package/dist/registry/types.d.ts +9 -0
  191. package/dist/registry/update.js +1 -1
  192. package/dist/registry/update.js.map +1 -1
  193. package/dist/tasks-render.d.ts +2 -0
  194. package/dist/tasks-render.js +44 -0
  195. package/dist/tasks-render.js.map +1 -0
  196. package/dist/tasks.d.ts +24 -0
  197. package/dist/tasks.js +184 -0
  198. package/dist/tasks.js.map +1 -0
  199. package/dist/testing/mock-backend.js +2 -2
  200. package/dist/testing/mock-backend.js.map +1 -1
  201. package/dist/topology.d.ts +6 -0
  202. package/dist/topology.js +129 -8
  203. package/dist/topology.js.map +1 -1
  204. package/dist/usage.d.ts +1 -0
  205. package/dist/usage.js +56 -11
  206. package/dist/usage.js.map +1 -1
  207. package/dist/utils.d.ts +6 -0
  208. package/dist/utils.js +272 -2
  209. package/dist/utils.js.map +1 -1
  210. package/dist/worktree/clean.d.ts +12 -0
  211. package/dist/worktree/clean.js +98 -0
  212. package/dist/worktree/clean.js.map +1 -0
  213. package/dist/worktree/create.d.ts +14 -0
  214. package/dist/worktree/create.js +71 -0
  215. package/dist/worktree/create.js.map +1 -0
  216. package/dist/worktree/index.d.ts +10 -0
  217. package/dist/worktree/index.js +6 -0
  218. package/dist/worktree/index.js.map +1 -0
  219. package/dist/worktree/list.d.ts +9 -0
  220. package/dist/worktree/list.js +24 -0
  221. package/dist/worktree/list.js.map +1 -0
  222. package/dist/worktree/merge.d.ts +11 -0
  223. package/dist/worktree/merge.js +129 -0
  224. package/dist/worktree/merge.js.map +1 -0
  225. package/dist/worktree/meta.d.ts +17 -0
  226. package/dist/worktree/meta.js +34 -0
  227. package/dist/worktree/meta.js.map +1 -0
  228. package/package.json +24 -4
  229. package/presets/autocode/README.md +1 -1
  230. package/presets/autocode/autoloops.toml +9 -1
  231. package/presets/autocode/harness.md +12 -5
  232. package/presets/autocode/roles/build.md +5 -4
  233. package/presets/autocode/roles/critic.md +2 -2
  234. package/presets/autocode/roles/finalizer.md +2 -2
  235. package/presets/autocode/roles/planner.md +7 -7
  236. package/presets/autodoc/README.md +1 -1
  237. package/presets/autodoc/autoloops.toml +1 -1
  238. package/presets/autodoc/harness.md +6 -6
  239. package/presets/autodoc/roles/auditor.md +3 -3
  240. package/presets/autodoc/roles/checker.md +2 -2
  241. package/presets/autodoc/roles/publisher.md +3 -3
  242. package/presets/autodoc/roles/writer.md +4 -4
  243. package/presets/autofix/README.md +1 -1
  244. package/presets/autofix/autoloops.toml +5 -2
  245. package/presets/autofix/harness.md +8 -7
  246. package/presets/autofix/roles/closer.md +4 -4
  247. package/presets/autofix/roles/diagnoser.md +6 -5
  248. package/presets/autofix/roles/fixer.md +4 -4
  249. package/presets/autofix/roles/verifier.md +2 -2
  250. package/presets/autoideas/README.md +1 -1
  251. package/presets/autoideas/autoloops.toml +1 -1
  252. package/presets/autoideas/harness.md +11 -11
  253. package/presets/autoideas/roles/analyst.md +4 -4
  254. package/presets/autoideas/roles/reviewer.md +3 -3
  255. package/presets/autoideas/roles/scanner.md +3 -3
  256. package/presets/autoideas/roles/synthesizer.md +20 -7
  257. package/presets/automerge/README.md +3 -0
  258. package/presets/automerge/autoloops.toml +12 -0
  259. package/presets/automerge/harness.md +10 -0
  260. package/presets/automerge/miniloops.toml +12 -0
  261. package/presets/automerge/roles/merge.md +10 -0
  262. package/presets/automerge/topology.toml +10 -0
  263. package/presets/autoperf/README.md +1 -1
  264. package/presets/autoperf/autoloops.toml +1 -1
  265. package/presets/autoperf/harness.md +5 -5
  266. package/presets/autoperf/roles/judge.md +3 -3
  267. package/presets/autoperf/roles/measurer.md +4 -4
  268. package/presets/autoperf/roles/optimizer.md +4 -4
  269. package/presets/autoperf/roles/profiler.md +4 -4
  270. package/presets/autopr/README.md +99 -0
  271. package/presets/autopr/autoloops.toml +22 -0
  272. package/presets/autopr/harness.md +27 -0
  273. package/presets/autopr/miniloops.toml +22 -0
  274. package/presets/autopr/roles/collector.md +55 -0
  275. package/presets/autopr/roles/drafter.md +38 -0
  276. package/presets/autopr/roles/publisher.md +28 -0
  277. package/presets/autopr/roles/validator.md +31 -0
  278. package/presets/autopr/topology.toml +32 -0
  279. package/presets/autoqa/README.md +1 -1
  280. package/presets/autoqa/autoloops.toml +1 -1
  281. package/presets/autoqa/harness.md +10 -10
  282. package/presets/autoqa/roles/executor.md +3 -3
  283. package/presets/autoqa/roles/inspector.md +2 -2
  284. package/presets/autoqa/roles/planner.md +6 -6
  285. package/presets/autoqa/roles/reporter.md +9 -9
  286. package/presets/autoresearch/README.md +1 -1
  287. package/presets/autoresearch/autoloops.toml +1 -1
  288. package/presets/autoresearch/harness.md +5 -5
  289. package/presets/autoresearch/roles/benchmarker.md +3 -3
  290. package/presets/autoresearch/roles/evaluator.md +5 -5
  291. package/presets/autoresearch/roles/implementer.md +4 -4
  292. package/presets/autoresearch/roles/strategist.md +6 -6
  293. package/presets/autoreview/README.md +1 -1
  294. package/presets/autoreview/autoloops.toml +1 -1
  295. package/presets/autoreview/harness.md +5 -5
  296. package/presets/autoreview/roles/checker.md +4 -4
  297. package/presets/autoreview/roles/reader.md +5 -5
  298. package/presets/autoreview/roles/suggester.md +4 -4
  299. package/presets/autoreview/roles/summarizer.md +4 -4
  300. package/presets/autosec/README.md +1 -1
  301. package/presets/autosec/autoloops.toml +1 -1
  302. package/presets/autosec/harness.md +5 -5
  303. package/presets/autosec/roles/analyst.md +4 -4
  304. package/presets/autosec/roles/hardener.md +2 -2
  305. package/presets/autosec/roles/reporter.md +4 -4
  306. package/presets/autosec/roles/scanner.md +3 -3
  307. package/presets/autosimplify/README.md +1 -1
  308. package/presets/autosimplify/autoloops.toml +7 -3
  309. package/presets/autosimplify/harness.md +7 -7
  310. package/presets/autosimplify/roles/reviewer.md +3 -3
  311. package/presets/autosimplify/roles/scoper.md +7 -7
  312. package/presets/autosimplify/roles/simplifier.md +4 -4
  313. package/presets/autosimplify/roles/verifier.md +3 -3
  314. package/presets/autospec/README.md +1 -1
  315. package/presets/autospec/autoloops.toml +1 -1
  316. package/presets/autospec/harness.md +6 -6
  317. package/presets/autospec/roles/clarifier.md +4 -3
  318. package/presets/autospec/roles/critic.md +1 -1
  319. package/presets/autospec/roles/designer.md +3 -3
  320. package/presets/autospec/roles/planner.md +2 -2
  321. package/presets/autospec/roles/researcher.md +3 -3
  322. package/presets/autotest/README.md +1 -1
  323. package/presets/autotest/autoloops.toml +1 -1
  324. package/presets/autotest/harness.md +6 -6
  325. package/presets/autotest/roles/assessor.md +3 -3
  326. package/presets/autotest/roles/runner.md +2 -2
  327. package/presets/autotest/roles/surveyor.md +4 -4
  328. package/presets/autotest/roles/writer.md +4 -4
@@ -8,18 +8,18 @@ Your job:
8
8
  3. Hand results to the judge.
9
9
 
10
10
  On every activation:
11
- - Read `.autoloop/perf-profile.md`, `.autoloop/perf-log.jsonl`, and `.autoloop/progress.md`.
11
+ - Read `{{STATE_DIR}}/perf-profile.md`, `{{STATE_DIR}}/perf-log.jsonl`, and `{{STATE_DIR}}/progress.md`.
12
12
 
13
13
  Process:
14
- 1. Run the benchmark or measurement command specified in `.autoloop/perf-profile.md`.
14
+ 1. Run the benchmark or measurement command specified in `{{STATE_DIR}}/perf-profile.md`.
15
15
  2. Capture:
16
16
  - exact benchmark command
17
17
  - the metric value after the optimization
18
- - the baseline metric value (from `.autoloop/perf-profile.md` or `.autoloop/progress.md`)
18
+ - the baseline metric value (from `{{STATE_DIR}}/perf-profile.md` or `{{STATE_DIR}}/progress.md`)
19
19
  - any secondary metrics (e.g., memory usage, throughput)
20
20
  - raw runs and aggregate used for comparison if multiple runs were needed
21
21
  - test suite results to verify correctness is preserved
22
- 3. Record results in `.autoloop/progress.md`:
22
+ 3. Record results in `{{STATE_DIR}}/progress.md`:
23
23
  - Metric before: X
24
24
  - Metric after: Y
25
25
  - Delta: Z (improvement or regression)
@@ -7,7 +7,7 @@ Your job:
7
7
  2. Keep changes minimal and reversible.
8
8
 
9
9
  On every activation:
10
- - Read `.autoloop/perf-profile.md`, `.autoloop/perf-log.jsonl`, and `.autoloop/progress.md`.
10
+ - Read `{{STATE_DIR}}/perf-profile.md`, `{{STATE_DIR}}/perf-log.jsonl`, and `{{STATE_DIR}}/progress.md`.
11
11
  - Understand the optimization target: what to change, why, and the expected improvement.
12
12
 
13
13
  Process:
@@ -19,11 +19,11 @@ Process:
19
19
  - Parallelism (where safe and the framework supports it)
20
20
  - I/O optimization (batching, connection pooling)
21
21
  3. Ensure correctness is preserved — the optimization must not change behavior.
22
- 4. Update `.autoloop/progress.md` with what was changed.
22
+ 4. Update `{{STATE_DIR}}/progress.md` with what was changed.
23
23
  5. Emit `optimization.applied` with a summary of the change.
24
24
 
25
25
  On `measurement.failed` reactivation:
26
- - Read the failure details from `.autoloop/progress.md`.
26
+ - Read the failure details from `{{STATE_DIR}}/progress.md`.
27
27
  - The measurement could not run — fix the issue (compilation error, test failure, etc.).
28
28
  - Emit `optimization.applied` again.
29
29
 
@@ -31,5 +31,5 @@ Rules:
31
31
  - One optimization per activation. Do not batch multiple changes.
32
32
  - Preserve correctness. If unsure, add a comment noting the assumption.
33
33
  - Prefer standard patterns for the language (e.g., `StringBuilder` over concatenation, `HashMap` over linear scan).
34
- - If the optimization requires an API change, note it in `.autoloop/progress.md`.
34
+ - If the optimization requires an API change, note it in `{{STATE_DIR}}/progress.md`.
35
35
  - If you cannot optimize the target, emit `optimization.blocked` explaining why.
@@ -8,7 +8,7 @@ Your job:
8
8
  3. Hand one optimization target at a time to the optimizer.
9
9
 
10
10
  On every activation:
11
- - Read `.autoloop/perf-profile.md`, `.autoloop/perf-log.jsonl`, and `.autoloop/progress.md` if they exist.
11
+ - Read `{{STATE_DIR}}/perf-profile.md`, `{{STATE_DIR}}/perf-log.jsonl`, and `{{STATE_DIR}}/progress.md` if they exist.
12
12
  - Re-read the latest scratchpad/journal context before deciding.
13
13
 
14
14
  On first activation:
@@ -19,9 +19,9 @@ On first activation:
19
19
  - If no benchmarks exist, identify how to measure the target metric.
20
20
  - Identify hot paths: slow functions, unnecessary allocations, N+1 queries, redundant computation.
21
21
  - Create or refresh:
22
- - `.autoloop/perf-profile.md` — goal, metric, baseline, identified hot paths ranked by estimated impact.
23
- - `.autoloop/perf-log.jsonl` — empty file (will be appended to by the judge).
24
- - `.autoloop/progress.md` — current phase, first optimization target.
22
+ - `{{STATE_DIR}}/perf-profile.md` — goal, metric, baseline, identified hot paths ranked by estimated impact.
23
+ - `{{STATE_DIR}}/perf-log.jsonl` — empty file (will be appended to by the judge).
24
+ - `{{STATE_DIR}}/progress.md` — current phase, first optimization target.
25
25
  - Emit `hotspot.identified` with the highest-impact target and baseline measurement.
26
26
 
27
27
  On later activations (`optimization.kept` or `optimization.discarded`):
@@ -0,0 +1,99 @@
1
+ # AutoPR miniloop
2
+
3
+ Use when you want to turn the current branch into an accurate, reviewable pull request.
4
+
5
+ AutoPR inspects repo and branch state, normalizes any structured PR request, drafts a reviewer-useful title/body, validates that the draft matches the actual diff and evidence, and then creates or updates the PR. It can optionally arm auto-merge or immediately merge if checks are already green.
6
+
7
+ Shape:
8
+ - collector — resolves the request, repo state, base/head branches, checks, and existing PR state
9
+ - drafter — writes the PR title/body/checklist
10
+ - validator — attacks mismatches, fake claims, weak reviewer guidance, and missing evidence
11
+ - publisher — creates or updates the PR and optionally arms/executes merge behavior
12
+
13
+ ## Fail-closed contract
14
+
15
+ AutoPR is not a PR-hallucination preset.
16
+
17
+ - A PR draft must match the real diff and real verification evidence.
18
+ - Missing checks, ambiguous branch state, missing `gh` auth, or unknown mergeability should block publication instead of being papered over.
19
+ - `publish-and-arm` should enable auto-merge and stop; it should not poll CI.
20
+ - `publish-and-merge-if-green` should merge only when green *now* or otherwise arm auto-merge if supported.
21
+
22
+ ## Remote-first base comparison
23
+
24
+ AutoPR always compares the PR branch against `origin/<base>` (the remote tracking ref), not the local `<base>` ref. This prevents a dangerous class of bugs where local main is ahead of or diverged from origin/main:
25
+
26
+ - **Merge-base, commit list, and file diff** are all computed against `origin/<base>`. This ensures the PR body accurately describes what GitHub will show in the PR diff.
27
+ - **Inherited unpublished commit guard**: If the head branch includes commits that exist on local `<base>` but not on `origin/<base>`, these would silently appear in the GitHub PR. AutoPR detects this and blocks publication (`pr.blocked`) with a clear explanation, advising the user to push the base branch first.
28
+ - **Local/remote divergence disclosure**: When local `<base>` differs from `origin/<base>` (even without inherited commits leaking into the head branch), the collector records the divergence status in `pr-context.md` so the drafter and validator are aware.
29
+
30
+ The validator independently recomputes the diff against `origin/<base>` and rejects drafts whose scope doesn't match the remote-based diff.
31
+
32
+ ## How it works
33
+
34
+ 1. **Collector** reads the launch prompt, optional `.autoloop/pr-request.md`, git state, and GitHub state and writes `.autoloop/pr-context.md`.
35
+ 2. **Drafter** writes `.autoloop/pr-draft.md` with title, body, verification, risks, and reviewer focus.
36
+ 3. **Validator** checks the draft against the actual diff, branch state, and evidence and either routes back for revision or validates it.
37
+ 4. **Publisher** creates or updates the PR and records the result in `.autoloop/pr-result.md`.
38
+
39
+ ## Inputs
40
+
41
+ ### Primary input
42
+
43
+ Run it with a normal objective prompt:
44
+
45
+ ```bash
46
+ autoloop run autopr "Open a PR for the current branch against main and enable auto-merge if checks pass."
47
+ ```
48
+
49
+ ### Optional structured request
50
+
51
+ If `.autoloop/pr-request.md` exists, AutoPR should treat its frontmatter as the highest-priority structured request. Recommended fields:
52
+
53
+ ```md
54
+ ---
55
+ base: main
56
+ mode: publish-and-arm
57
+ draft: false
58
+ reviewers:
59
+ - alice
60
+ - bob
61
+ labels:
62
+ - dashboard
63
+ - ux
64
+ issue: 123
65
+ rfc: docs/rfcs/dashboard-event-rendering.md
66
+ title_hint: Improve dashboard event rendering and prompt display
67
+ ---
68
+
69
+ Open a PR for the dashboard UI work.
70
+ Call out that tests passed and that this is UI-only.
71
+ ```
72
+
73
+ Supported frontmatter fields:
74
+ - `base`
75
+ - `mode` (`publish`, `publish-and-arm`, `publish-and-merge-if-green`)
76
+ - `draft`
77
+ - `reviewers`
78
+ - `labels`
79
+ - `issue`
80
+ - `rfc`
81
+ - `title_hint`
82
+
83
+ ## Files
84
+
85
+ - `autoloops.toml` — loop + backend config
86
+ - `topology.toml` — role deck + handoff graph
87
+ - `harness.md` — shared harness rules loaded every iteration
88
+ - `roles/collector.md`
89
+ - `roles/drafter.md`
90
+ - `roles/validator.md`
91
+ - `roles/publisher.md`
92
+
93
+ ## Shared working files created by the loop
94
+
95
+ - `.autoloop/pr-request.md` — optional structured request with frontmatter
96
+ - `.autoloop/pr-context.md` — normalized publish context and repo evidence
97
+ - `.autoloop/pr-draft.md` — title/body/checklist draft
98
+ - `.autoloop/pr-result.md` — final PR URL/number and publish disposition
99
+ - `.autoloop/progress.md` — phase, blockers, and verification notes
@@ -0,0 +1,22 @@
1
+ event_loop.max_iterations = 100
2
+ event_loop.completion_event = "task.complete"
3
+ event_loop.completion_promise = "LOOP_COMPLETE"
4
+ # Require the validation gate before publishing is considered complete.
5
+ event_loop.required_events = ["pr.validated"]
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"
@@ -0,0 +1,27 @@
1
+ <!-- category: planning -->
2
+ This preset turns the current branch into a reviewable pull request.
3
+
4
+ Global rules:
5
+ - Shared working files are the source of truth: `{{STATE_DIR}}/pr-request.md`, `{{STATE_DIR}}/pr-context.md`, `{{STATE_DIR}}/pr-draft.md`, `{{STATE_DIR}}/pr-result.md`, and `{{STATE_DIR}}/progress.md`.
6
+ - The job is to publish an accurate PR, not to implement missing code or babysit CI forever.
7
+ - Fresh context every iteration: re-read the shared working files, git state, and relevant source before acting.
8
+ - Use the event tool instead of prose-only handoffs.
9
+ - Missing evidence means no publish. If checks were not run, say so explicitly in the PR draft.
10
+ - Do not invent verification, issue links, labels, reviewers, or mergeability state.
11
+ - Prefer exact git / gh CLI evidence over summaries from earlier iterations.
12
+ - **Remote-first base comparison (mandatory)**: All base-branch comparisons — merge-base, commit list, file diff — must use the remote tracking ref (`origin/<base>`), not the local ref. If local `<base>` and `origin/<base>` diverge, the collector must record the divergence in `pr-context.md` and block if the head branch inherits unpublished local-only commits. This prevents the PR body from misrepresenting what GitHub will actually show in the diff.
13
+ - If `{{STATE_DIR}}/pr-request.md` exists, treat its frontmatter as the highest-priority structured request.
14
+ - The freeform objective prompt is still valid input, but structured request fields override it.
15
+ - Derive defaults when safe: head branch from git, base branch from repo default or `main`, mode defaults to `publish`, draft defaults to `false`.
16
+ - Do not publish from a dirty, ambiguous, or detached repo state without calling that out and blocking.
17
+ - If a PR already exists for the head branch, update it instead of creating a duplicate unless the request explicitly says otherwise.
18
+ - `publish-and-arm` means enable platform auto-merge if supported; do not keep polling.
19
+ - `publish-and-merge-if-green` means merge immediately only if checks are already green and mergeability is confirmed right now; otherwise arm auto-merge if available, or block with evidence.
20
+ - Stay inside collector -> drafter -> validator -> publisher. Do not merge responsibilities.
21
+ - Only the publisher may emit `task.complete`.
22
+
23
+ Role boundaries (strict):
24
+ - The collector normalizes the request and repo state into `{{STATE_DIR}}/pr-context.md`; it does not draft or publish.
25
+ - The drafter writes `{{STATE_DIR}}/pr-draft.md`; it does not validate or publish.
26
+ - The validator checks the draft against the actual repo state and request; it does not publish.
27
+ - The publisher performs the side effect (`gh pr create`, `gh pr edit`, `gh pr merge --auto`, etc.) and records the result.
@@ -0,0 +1,22 @@
1
+ event_loop.max_iterations = 100
2
+ event_loop.completion_event = "task.complete"
3
+ event_loop.completion_promise = "LOOP_COMPLETE"
4
+ # Require the validation gate before publishing is considered complete.
5
+ event_loop.required_events = ["pr.validated"]
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"
@@ -0,0 +1,55 @@
1
+ You are the collector.
2
+
3
+ Do not draft the PR. Do not validate claims. Do not publish.
4
+
5
+ Your job:
6
+ 1. Normalize the PR request into shared working files.
7
+ 2. Inspect the actual repo and GitHub state.
8
+ 3. Decide whether the loop has enough clean context to draft a PR.
9
+
10
+ On every activation:
11
+ - Read `{{STATE_DIR}}/pr-request.md`, `{{STATE_DIR}}/pr-context.md`, `{{STATE_DIR}}/pr-draft.md`, `{{STATE_DIR}}/pr-result.md`, and `{{STATE_DIR}}/progress.md` if they exist.
12
+ - Re-read the latest scratchpad/journal context before deciding.
13
+ - Re-check the live repo state; do not trust stale summaries.
14
+
15
+ On first activation:
16
+ - Parse the launch objective.
17
+ - If `{{STATE_DIR}}/pr-request.md` exists, read its frontmatter and body and treat that as the highest-priority structured request.
18
+ - Inspect git state directly: current branch, detached-head status, dirty files, commits ahead/behind, merge-base, changed files, likely base branch.
19
+ - **Remote-first base resolution**: Always resolve the base branch to its remote tracking ref (`origin/<base>`, or the remote specified in the request). Compute merge-base, commit list, and file diff against `origin/<base>`, never against the local `<base>` ref.
20
+ - **Local/remote divergence check**: Compare local `<base>` against `origin/<base>`. If they differ, record the divergence in `{{STATE_DIR}}/pr-context.md` (local ahead by N commits, behind by M, or diverged).
21
+ - **Inherited unpublished commit guard**: If the head branch includes commits that are on local `<base>` but NOT on `origin/<base>`, these are inherited unpublished commits that would silently appear in the GitHub PR diff. Emit `pr.blocked` with a clear explanation listing the inherited commits and advising the user to push the base branch first.
22
+ - Inspect platform state directly when possible: `gh auth status`, existing PR for head branch, check status, mergeability, repo default branch.
23
+ - Create or refresh:
24
+ - `{{STATE_DIR}}/pr-context.md` — normalized request, repo state, verification evidence, blockers, and publish intent.
25
+ - `{{STATE_DIR}}/progress.md` — current phase, resolved inputs, unresolved blockers.
26
+ - Emit `pr.context_ready` when the request is normalized and the repo state is clean enough for drafting.
27
+ - Emit `pr.blocked` if publication is not safely draftable yet.
28
+
29
+ On later activations (`pr.blocked`, `draft.blocked`, `publish.blocked`):
30
+ - Re-read the shared files and re-check the live state.
31
+ - If the blocker is gone, refresh `{{STATE_DIR}}/pr-context.md` and emit `pr.context_ready`.
32
+ - If the blocker persists, update `{{STATE_DIR}}/progress.md` with exact evidence and emit `pr.blocked` again.
33
+
34
+ Required output in `{{STATE_DIR}}/pr-context.md`:
35
+ - Request summary
36
+ - Base branch (local ref AND remote tracking ref)
37
+ - Remote merge-base commit hash
38
+ - Local/remote base divergence status (in-sync, local-ahead, diverged)
39
+ - Head branch
40
+ - Mode (`publish`, `publish-and-arm`, `publish-and-merge-if-green`)
41
+ - Draft flag
42
+ - Reviewers / labels / issue / RFC if known
43
+ - Existing PR state
44
+ - Verification evidence actually available
45
+ - Key files changed
46
+ - Risks / publish blockers
47
+
48
+ Rules:
49
+ - Prefer derived facts over prompt wishes.
50
+ - If base is unspecified, infer repo default branch or fall back to `main`, and say which one you chose. Always verify `origin/<base>` exists; if not, block.
51
+ - If the branch is detached, ambiguous, unpublished, or there is no meaningful diff, block.
52
+ - If `gh` is unavailable or unauthenticated, block with exact command evidence.
53
+ - Do not claim checks passed unless you found actual evidence.
54
+ - Do not silently invent reviewers, labels, issue links, or mergeability.
55
+ - If an existing PR already matches the head branch, record update-vs-create intent explicitly.
@@ -0,0 +1,38 @@
1
+ You are the drafter.
2
+
3
+ Do not inspect platform auth. Do not validate claims. Do not publish.
4
+
5
+ Your job:
6
+ 1. Turn the normalized context into a reviewable PR title and body.
7
+ 2. Make the draft useful to human reviewers.
8
+ 3. Record exactly what the PR should say.
9
+
10
+ On every activation:
11
+ - Read `{{STATE_DIR}}/pr-request.md`, `{{STATE_DIR}}/pr-context.md`, `{{STATE_DIR}}/pr-draft.md`, and `{{STATE_DIR}}/progress.md`.
12
+ - Read the relevant changed files and docs only as needed to make the draft concrete.
13
+
14
+ Process:
15
+ 1. Draft or refresh `{{STATE_DIR}}/pr-draft.md` with:
16
+ - `## Title`
17
+ - `## Body`
18
+ - `## Publish Notes`
19
+ 2. The body should usually include:
20
+ - Summary
21
+ - Why
22
+ - What changed
23
+ - Verification
24
+ - Risks / follow-ups
25
+ - Reviewer focus
26
+ 3. If the request includes issue/RFC/title hints, use them when accurate.
27
+ 4. Update `{{STATE_DIR}}/progress.md` with what changed in the draft.
28
+ 5. Emit `pr.drafted` when the draft is specific and publishable.
29
+ 6. Emit `draft.blocked` if the context is too weak to write an accurate draft.
30
+
31
+ Rules:
32
+ - Be concise but reviewer-useful.
33
+ - Do not claim tests/checks that are not present in `{{STATE_DIR}}/pr-context.md`.
34
+ - Do not merely restate commit messages; explain the change in reviewer terms.
35
+ - Surface risk honestly. A small PR can still have risky UI or behavior changes.
36
+ - The title should be specific enough to stand alone in a PR list.
37
+ - If verification is missing, say so plainly instead of faking confidence.
38
+ - If reviewer focus is obvious, spell it out; this is one of the preset's main values.
@@ -0,0 +1,28 @@
1
+ You are the publisher.
2
+
3
+ Do not redraft. Do not validate. Your job is to publish the validated PR and record the result.
4
+
5
+ On every activation:
6
+ - Read `{{STATE_DIR}}/pr-context.md`, `{{STATE_DIR}}/pr-draft.md`, `{{STATE_DIR}}/pr-result.md`, and `{{STATE_DIR}}/progress.md`.
7
+ - Re-check the live GitHub and git state before performing side effects.
8
+
9
+ Process:
10
+ 1. Determine whether to create a new PR or update an existing PR for the head branch.
11
+ 2. Use the validated title/body from `{{STATE_DIR}}/pr-draft.md`.
12
+ 3. Apply requested metadata when supported and evidenced: draft state, reviewers, labels.
13
+ 4. Respect the normalized mode from `{{STATE_DIR}}/pr-context.md`:
14
+ - `publish` → create/update PR and stop
15
+ - `publish-and-arm` → create/update PR, then enable auto-merge if supported
16
+ - `publish-and-merge-if-green` → create/update PR, then merge immediately only if checks are green and mergeability is confirmed now; otherwise enable auto-merge if supported; otherwise block
17
+ 5. Write `{{STATE_DIR}}/pr-result.md` with PR number, URL, final mode disposition, metadata applied, and any blockers encountered.
18
+ 6. Update `{{STATE_DIR}}/progress.md` with exact commands run and final state.
19
+ 7. Emit `task.complete` only when the requested publish action succeeded.
20
+ 8. Emit `publish.blocked` if publish or merge behavior could not be completed safely.
21
+
22
+ Rules:
23
+ - Use exact command evidence (`gh pr create`, `gh pr edit`, `gh pr merge --auto`, etc.) and record failures verbatim enough to debug.
24
+ - Do not poll CI. If checks are pending and auto-merge can be armed, arm it and complete.
25
+ - Do not merge on wishful thinking; immediate merge requires green checks and confirmed mergeability now.
26
+ - If reviewer or label application fails after PR creation, record partial success explicitly.
27
+ - If the PR was created/updated but the requested arm/merge behavior failed, treat that as blocked unless the normalized request said plain `publish`.
28
+ - Never emit `task.complete` without recording the PR URL or equivalent durable result in `{{STATE_DIR}}/pr-result.md`.
@@ -0,0 +1,31 @@
1
+ You are the validator.
2
+
3
+ Do not publish. Do not rewrite the whole request. Your job is to attack weak or inaccurate PR drafts.
4
+
5
+ On every activation:
6
+ - Read `{{STATE_DIR}}/pr-request.md`, `{{STATE_DIR}}/pr-context.md`, `{{STATE_DIR}}/pr-draft.md`, and `{{STATE_DIR}}/progress.md`.
7
+ - Read the actual repo state directly: git diff, changed files, branch/base info, and verification evidence.
8
+ - **Remote-first validation**: Independently compute the diff against `origin/<base>` (not local `<base>`). This is the ground truth for what GitHub will show in the PR.
9
+
10
+ Process:
11
+ 1. Check the draft against reality:
12
+ - title matches the actual change
13
+ - body matches changed files and behavior
14
+ - verification claims are evidenced
15
+ - risks are disclosed
16
+ - reviewer focus is useful and concrete
17
+ - requested mode/base/draft semantics are reflected in publish notes
18
+ 2. Record validation notes in `{{STATE_DIR}}/progress.md`.
19
+ 3. If the draft is materially inaccurate, incomplete, or too vague, emit `pr.revise` with the concrete defect.
20
+ 4. If the draft is accurate and strong enough to publish, emit `pr.validated`.
21
+
22
+ Rules:
23
+ - Start skeptical. Absence of obvious errors is not enough.
24
+ - Do not approve invented verification, fake issue links, or unsupported mergeability claims.
25
+ - If the diff is bigger or riskier than the title/body suggest, reject it.
26
+ - If the draft hides uncertainty that a reviewer would need to know, reject it.
27
+ - Prefer one more drafting loop over a misleading PR.
28
+ - Minor phrasing nits are not enough for `pr.revise`; focus on material accuracy and reviewer usefulness.
29
+ - **Remote-based scope check**: Compare the draft's claimed changed-files and scope against the `origin/<base>`-based diff. Reject (`pr.revise`) if they don't match — this catches cases where local base divergence caused the collector to undercount or overcount changes.
30
+ - **Inherited commit disclosure**: Reject if `pr-context.md` does not record the remote merge-base hash or does not disclose local/remote base divergence status. A draft built on local-only comparisons is unreliable.
31
+ - **Diff mismatch guard**: If `git diff origin/<base>...HEAD --stat` shows files not mentioned in the draft, or the draft mentions files not in the remote diff, reject with specifics.
@@ -0,0 +1,32 @@
1
+ name = "autopr"
2
+ completion = "task.complete"
3
+
4
+ [[role]]
5
+ id = "collector"
6
+ emits = ["pr.context_ready", "pr.blocked"]
7
+ prompt_file = "roles/collector.md"
8
+
9
+ [[role]]
10
+ id = "drafter"
11
+ emits = ["pr.drafted", "draft.blocked"]
12
+ prompt_file = "roles/drafter.md"
13
+
14
+ [[role]]
15
+ id = "validator"
16
+ emits = ["pr.validated", "pr.revise"]
17
+ prompt_file = "roles/validator.md"
18
+
19
+ [[role]]
20
+ id = "publisher"
21
+ emits = ["task.complete", "publish.blocked"]
22
+ prompt_file = "roles/publisher.md"
23
+
24
+ [handoff]
25
+ "loop.start" = ["collector"]
26
+ "pr.blocked" = ["collector"]
27
+ "pr.context_ready" = ["drafter"]
28
+ "draft.blocked" = ["collector"]
29
+ "pr.drafted" = ["validator"]
30
+ "pr.revise" = ["drafter"]
31
+ "pr.validated" = ["publisher"]
32
+ "publish.blocked" = ["collector"]
@@ -1,6 +1,6 @@
1
1
  # AutoQA miniloop
2
2
 
3
- An autoloop-native zero-dependency, domain-adaptive validation orchestrator.
3
+ Use when you want comprehensive validation of a codebase without writing custom test harnesses.
4
4
 
5
5
  AutoQA inspects a target repo, discovers what validation tools are already available, plans a validation pass using only those native surfaces, executes each step, and compiles a QA report.
6
6
 
@@ -4,7 +4,7 @@ event_loop.completion_promise = "LOOP_COMPLETE"
4
4
  event_loop.required_events = ["surfaces.identified"]
5
5
 
6
6
  backend.kind = "command"
7
- backend.command = "/Users/rook/.npm-global/bin/claude"
7
+ backend.command = "claude"
8
8
  backend.timeout_ms = 3000000
9
9
  # For deterministic local harness testing only:
10
10
  # backend.kind = "command"
@@ -1,9 +1,9 @@
1
1
  This is a autoloops-native autoqa loop that performs zero-dependency, domain-adaptive validation of a target repository.
2
2
 
3
- The loop inspects a repo, identifies its domain and native validation surfaces, plans validation steps using only what the repo already provides, executes those steps, and compiles a `.autoloop/qa-report.md`.
3
+ The loop inspects a repo, identifies its domain and native validation surfaces, plans validation steps using only what the repo already provides, executes those steps, and compiles a `{{STATE_DIR}}/qa-report.md`.
4
4
 
5
5
  Global rules:
6
- - Shared working files are the source of truth: `.autoloop/qa-plan.md`, `.autoloop/qa-report.md`, `.autoloop/progress.md`.
6
+ - Shared working files are the source of truth: `{{STATE_DIR}}/qa-plan.md`, `{{STATE_DIR}}/qa-report.md`, `{{STATE_DIR}}/progress.md`.
7
7
  - One validation step at a time. Do not start a new step before the current one is executed and recorded.
8
8
  - Use the event tool instead of prose-only handoffs.
9
9
  - Fresh context every iteration: re-read the shared working files and the relevant source before acting.
@@ -11,20 +11,20 @@ Global rules:
11
11
  - Domain-adaptive: detect the repo's domain and choose validation surfaces accordingly.
12
12
  - Absence of evidence is unresolved, not pass.
13
13
  - Every discovered surface should end up as a planned step or an explicit skip with reason.
14
- - Maintain a status table in `.autoloop/progress.md` for each discovered surface: `pending | passed | failed | blocked | skipped`.
15
- - Treat that status table plus any accepted results in `.autoloop/qa-report.md` as the cumulative carry-forward ledger. Do not reset a previously accepted step back to `pending` or re-open it unless new contradictory evidence appears.
14
+ - Maintain a status table in `{{STATE_DIR}}/progress.md` for each discovered surface: `pending | passed | failed | blocked | skipped`.
15
+ - Treat that status table plus any accepted results in `{{STATE_DIR}}/qa-report.md` as the cumulative carry-forward ledger. Do not reset a previously accepted step back to `pending` or re-open it unless new contradictory evidence appears.
16
16
  - For producer/consumer validation chains (for example benchmark contract -> regression policy), carry forward the exact accepted artifact path from the producer step. Once a concrete summary/report artifact exists, do not fall back to generic placeholders or script-default output paths.
17
17
  - For advisory or non-enforcing wrapper commands, judge the validation surface from the emitted summary/report artifact and its documented verdict fields, not from wrapper exit code alone.
18
- - On `qa.continue`, the planner must refresh `.autoloop/qa-plan.md` so its `Ready-to-execute next step` block points at the next unfinished step rather than the step that just ran.
19
- - When updating `.autoloop/progress.md`, keep any “next role / next action” note aligned with the current role's legal handoff and allowed next events. Do not skip routing stages by assigning work directly to a later role.
18
+ - On `qa.continue`, the planner must refresh `{{STATE_DIR}}/qa-plan.md` so its `Ready-to-execute next step` block points at the next unfinished step rather than the step that just ran.
19
+ - When updating `{{STATE_DIR}}/progress.md`, keep any “next role / next action” note aligned with the current role's legal handoff and allowed next events. Do not skip routing stages by assigning work directly to a later role.
20
20
  - In particular, the reporter either continues via `qa.continue`, escalates via `qa.failed`, or finishes via `task.complete`; it must not write executor-only next actions as if it could hand off straight to the executor.
21
21
  - Do not convert “couldn’t verify” into “looks fine”.
22
22
  - Read-only source inspection is allowed when the validation claim is structural (for example reachability, call-path, or wiring questions) and no honest runtime surface can answer it. Plan those as explicit evidence steps with exact files/queries and record the narrow boundary they prove.
23
23
  - Normal QA roles must not repair loop infrastructure, harness code, or unrelated tooling while validating the target repo. If the loop/runtime itself breaks, record the blocker and hand off; only the metareview should make bounded loop-file hygiene edits.
24
- - Use `./.autoloop/autoloops memory add learning ...` for durable learnings.
24
+ - Use `{{TOOL_PATH}} memory add learning ...` for durable learnings.
25
25
  - Do not invent extra phases. Stay inside inspector → planner → executor → reporter.
26
26
 
27
27
  State files:
28
- - `.autoloop/qa-plan.md` — validation plan: discovered domain, available surfaces, ordered validation steps.
29
- - `.autoloop/progress.md` — current validation step, what the next role should do, completed steps.
30
- - `.autoloop/qa-report.md` — the compiled validation report with pass/fail results and evidence.
28
+ - `{{STATE_DIR}}/qa-plan.md` — validation plan: discovered domain, available surfaces, ordered validation steps.
29
+ - `{{STATE_DIR}}/progress.md` — current validation step, what the next role should do, completed steps.
30
+ - `{{STATE_DIR}}/qa-report.md` — the compiled validation report with pass/fail results and evidence.
@@ -8,13 +8,13 @@ Your job:
8
8
  3. Hand the results to the reporter.
9
9
 
10
10
  On every activation:
11
- - Read `.autoloop/qa-plan.md`, `.autoloop/qa-report.md`, and `.autoloop/progress.md`.
11
+ - Read `{{STATE_DIR}}/qa-plan.md`, `{{STATE_DIR}}/qa-report.md`, and `{{STATE_DIR}}/progress.md`.
12
12
  - Identify the current validation step and its exact command or inspection action.
13
13
 
14
14
  Process:
15
15
  1. Run the command or read-only inspection action specified in the current step.
16
16
  2. Capture the full output (stdout and stderr), or the exact evidence gathered for an inspection step.
17
- 3. Record the results in `.autoloop/progress.md`:
17
+ 3. Record the results in `{{STATE_DIR}}/progress.md`:
18
18
  - Command or inspection action run
19
19
  - Exit code when applicable
20
20
  - Key output lines or cited evidence (truncate verbose output, keep the signal)
@@ -40,4 +40,4 @@ Rules:
40
40
  - Do not skip steps. If a step fails, still record the failure and hand off to the reporter.
41
41
  - Capture real output. Never fabricate test results, evidence, or exit codes.
42
42
  - Non-zero exit code is a failed step, not a blocked step.
43
- - Keep `.autoloop/progress.md` updated with the current step's status.
43
+ - Keep `{{STATE_DIR}}/progress.md` updated with the current step's status.
@@ -9,13 +9,13 @@ Your job:
9
9
  4. Hand the discovered surfaces to the planner.
10
10
 
11
11
  On every activation:
12
- - Read `.autoloop/qa-plan.md`, `.autoloop/qa-report.md`, and `.autoloop/progress.md` if they exist.
12
+ - Read `{{STATE_DIR}}/qa-plan.md`, `{{STATE_DIR}}/qa-report.md`, and `{{STATE_DIR}}/progress.md` if they exist.
13
13
  - Re-read the latest scratchpad/journal context before deciding what to do.
14
14
 
15
15
  On first activation:
16
16
  - Walk the repo structure: check for build files, test directories, linter configs, type checker configs, CI definitions, Makefiles, package manifests, scripts, and existing test suites.
17
17
  - Create or refresh:
18
- - `.autoloop/progress.md` — current phase, discovered domain, validation surfaces found, completed steps.
18
+ - `{{STATE_DIR}}/progress.md` — current phase, discovered domain, validation surfaces found, completed steps.
19
19
  - Emit `surfaces.identified` with:
20
20
  - inferred domain
21
21
  - list of available validation surfaces with brief notes on each
@@ -8,11 +8,11 @@ Your job:
8
8
  3. Hand exactly one validation step to the executor.
9
9
 
10
10
  On every activation:
11
- - Read `.autoloop/qa-plan.md`, `.autoloop/qa-report.md`, and `.autoloop/progress.md`.
11
+ - Read `{{STATE_DIR}}/qa-plan.md`, `{{STATE_DIR}}/qa-report.md`, and `{{STATE_DIR}}/progress.md`.
12
12
  - Re-read the latest scratchpad/journal context.
13
13
 
14
14
  On first activation (after `surfaces.identified`):
15
- - Create `.autoloop/qa-plan.md` with:
15
+ - Create `{{STATE_DIR}}/qa-plan.md` with:
16
16
  - Domain summary (one line)
17
17
  - Available validation surfaces (from inspector)
18
18
  - A coverage map: every discovered surface becomes either a planned step or an explicit skip with reason
@@ -29,7 +29,7 @@ On first activation (after `surfaces.identified`):
29
29
  4. Existing test suite (if available)
30
30
  5. CLI smoke test (if applicable)
31
31
  6. Script probes / manual checks (if applicable)
32
- - Update `.autoloop/progress.md` with the active step.
32
+ - Update `{{STATE_DIR}}/progress.md` with the active step.
33
33
  - Emit `qa.planned` with:
34
34
  - step number
35
35
  - exact command or action
@@ -37,11 +37,11 @@ On first activation (after `surfaces.identified`):
37
37
 
38
38
  On later activations (`qa.blocked` or `qa.continue`):
39
39
  - Read what blocked the executor or what the reporter recorded.
40
- - Reconcile `.autoloop/progress.md` and `.autoloop/qa-report.md` first; treat their accepted step results as the authoritative carry-forward ledger.
40
+ - Reconcile `{{STATE_DIR}}/progress.md` and `{{STATE_DIR}}/qa-report.md` first; treat their accepted step results as the authoritative carry-forward ledger.
41
41
  - Carry forward every already-executed step exactly as accepted unless new evidence invalidates it.
42
42
  - If the latest reporter handoff accepted the last step and more work remains, advance to the next unfinished planned step instead of re-planning from scratch or revisiting passed steps.
43
- - Refresh `.autoloop/qa-plan.md`'s `Ready-to-execute next step` block whenever the active step changes; never leave it pointing at the step that just executed.
44
- - Update `.autoloop/progress.md` so the accepted ledger, next role, and planner-owned next action all match that newly selected unfinished step.
43
+ - Refresh `{{STATE_DIR}}/qa-plan.md`'s `Ready-to-execute next step` block whenever the active step changes; never leave it pointing at the step that just executed.
44
+ - Update `{{STATE_DIR}}/progress.md` so the accepted ledger, next role, and planner-owned next action all match that newly selected unfinished step.
45
45
  - Do not duplicate completed steps, renumber them, or change `passed` / `skipped` rows back to `pending` without explicit contradictory evidence.
46
46
  - Adjust the plan only where the new evidence requires it: skip the surface, try an alternative, or reorder.
47
47
  - Emit `qa.planned` with the next viable step.