@cluesmith/codev 3.2.4 → 3.3.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 (358) hide show
  1. package/dashboard-dist/assets/index-BZRTEMtH.css +32 -0
  2. package/dashboard-dist/assets/{index-BZ1x7x1X.js → index-JCbkpAcV.js} +33 -33
  3. package/dashboard-dist/assets/index-JCbkpAcV.js.map +1 -0
  4. package/dashboard-dist/index.html +2 -2
  5. package/dist/agent-farm/cli.d.ts.map +1 -1
  6. package/dist/agent-farm/cli.js +142 -0
  7. package/dist/agent-farm/cli.js.map +1 -1
  8. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
  9. package/dist/agent-farm/commands/cleanup.js +16 -0
  10. package/dist/agent-farm/commands/cleanup.js.map +1 -1
  11. package/dist/agent-farm/commands/inbox.d.ts +42 -0
  12. package/dist/agent-farm/commands/inbox.d.ts.map +1 -0
  13. package/dist/agent-farm/commands/inbox.js +129 -0
  14. package/dist/agent-farm/commands/inbox.js.map +1 -0
  15. package/dist/agent-farm/commands/interrupt.d.ts +20 -0
  16. package/dist/agent-farm/commands/interrupt.d.ts.map +1 -0
  17. package/dist/agent-farm/commands/interrupt.js +65 -0
  18. package/dist/agent-farm/commands/interrupt.js.map +1 -0
  19. package/dist/agent-farm/commands/reset/constants.d.ts +52 -0
  20. package/dist/agent-farm/commands/reset/constants.d.ts.map +1 -0
  21. package/dist/agent-farm/commands/reset/constants.js +52 -0
  22. package/dist/agent-farm/commands/reset/constants.js.map +1 -0
  23. package/dist/agent-farm/commands/reset/context.d.ts +230 -0
  24. package/dist/agent-farm/commands/reset/context.d.ts.map +1 -0
  25. package/dist/agent-farm/commands/reset/context.js +428 -0
  26. package/dist/agent-farm/commands/reset/context.js.map +1 -0
  27. package/dist/agent-farm/commands/reset/index.d.ts +192 -0
  28. package/dist/agent-farm/commands/reset/index.d.ts.map +1 -0
  29. package/dist/agent-farm/commands/reset/index.js +488 -0
  30. package/dist/agent-farm/commands/reset/index.js.map +1 -0
  31. package/dist/agent-farm/commands/reset/receipt.d.ts +97 -0
  32. package/dist/agent-farm/commands/reset/receipt.d.ts.map +1 -0
  33. package/dist/agent-farm/commands/reset/receipt.js +149 -0
  34. package/dist/agent-farm/commands/reset/receipt.js.map +1 -0
  35. package/dist/agent-farm/commands/reset/reorient.d.ts +117 -0
  36. package/dist/agent-farm/commands/reset/reorient.d.ts.map +1 -0
  37. package/dist/agent-farm/commands/reset/reorient.js +313 -0
  38. package/dist/agent-farm/commands/reset/reorient.js.map +1 -0
  39. package/dist/agent-farm/commands/reset.d.ts +19 -0
  40. package/dist/agent-farm/commands/reset.d.ts.map +1 -0
  41. package/dist/agent-farm/commands/reset.js +292 -0
  42. package/dist/agent-farm/commands/reset.js.map +1 -0
  43. package/dist/agent-farm/commands/send.d.ts.map +1 -1
  44. package/dist/agent-farm/commands/send.js +49 -8
  45. package/dist/agent-farm/commands/send.js.map +1 -1
  46. package/dist/agent-farm/commands/spawn-worktree.d.ts +105 -6
  47. package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
  48. package/dist/agent-farm/commands/spawn-worktree.js +289 -66
  49. package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
  50. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  51. package/dist/agent-farm/commands/spawn.js +13 -1
  52. package/dist/agent-farm/commands/spawn.js.map +1 -1
  53. package/dist/agent-farm/commands/status.d.ts.map +1 -1
  54. package/dist/agent-farm/commands/status.js +80 -8
  55. package/dist/agent-farm/commands/status.js.map +1 -1
  56. package/dist/agent-farm/db/index.d.ts +1 -1
  57. package/dist/agent-farm/db/index.d.ts.map +1 -1
  58. package/dist/agent-farm/db/index.js +80 -1
  59. package/dist/agent-farm/db/index.js.map +1 -1
  60. package/dist/agent-farm/db/mailbox.d.ts +222 -0
  61. package/dist/agent-farm/db/mailbox.d.ts.map +1 -0
  62. package/dist/agent-farm/db/mailbox.js +304 -0
  63. package/dist/agent-farm/db/mailbox.js.map +1 -0
  64. package/dist/agent-farm/db/schema.d.ts +1 -1
  65. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  66. package/dist/agent-farm/db/schema.js +35 -0
  67. package/dist/agent-farm/db/schema.js.map +1 -1
  68. package/dist/agent-farm/db/types.d.ts +45 -0
  69. package/dist/agent-farm/db/types.d.ts.map +1 -1
  70. package/dist/agent-farm/db/types.js.map +1 -1
  71. package/dist/agent-farm/lib/builder-lookup.d.ts +1 -1
  72. package/dist/agent-farm/lib/builder-lookup.js +2 -2
  73. package/dist/agent-farm/lib/builder-lookup.js.map +1 -1
  74. package/dist/agent-farm/lib/reconnect-backoff.d.ts +54 -0
  75. package/dist/agent-farm/lib/reconnect-backoff.d.ts.map +1 -0
  76. package/dist/agent-farm/lib/reconnect-backoff.js +47 -0
  77. package/dist/agent-farm/lib/reconnect-backoff.js.map +1 -0
  78. package/dist/agent-farm/lib/tower-client.d.ts +16 -6
  79. package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
  80. package/dist/agent-farm/lib/tower-client.js +37 -6
  81. package/dist/agent-farm/lib/tower-client.js.map +1 -1
  82. package/dist/agent-farm/lib/tunnel-client.d.ts +69 -1
  83. package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -1
  84. package/dist/agent-farm/lib/tunnel-client.js +218 -27
  85. package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
  86. package/dist/agent-farm/servers/cron-delivery.d.ts +72 -0
  87. package/dist/agent-farm/servers/cron-delivery.d.ts.map +1 -0
  88. package/dist/agent-farm/servers/cron-delivery.js +80 -0
  89. package/dist/agent-farm/servers/cron-delivery.js.map +1 -0
  90. package/dist/agent-farm/servers/delayed-send.d.ts +85 -0
  91. package/dist/agent-farm/servers/delayed-send.d.ts.map +1 -0
  92. package/dist/agent-farm/servers/delayed-send.js +165 -0
  93. package/dist/agent-farm/servers/delayed-send.js.map +1 -0
  94. package/dist/agent-farm/servers/gate-profiles.d.ts +67 -0
  95. package/dist/agent-farm/servers/gate-profiles.d.ts.map +1 -0
  96. package/dist/agent-farm/servers/gate-profiles.js +113 -0
  97. package/dist/agent-farm/servers/gate-profiles.js.map +1 -0
  98. package/dist/agent-farm/servers/mailbox-delivery.d.ts +370 -0
  99. package/dist/agent-farm/servers/mailbox-delivery.d.ts.map +1 -0
  100. package/dist/agent-farm/servers/mailbox-delivery.js +617 -0
  101. package/dist/agent-farm/servers/mailbox-delivery.js.map +1 -0
  102. package/dist/agent-farm/servers/mailbox-wiring.d.ts +125 -0
  103. package/dist/agent-farm/servers/mailbox-wiring.d.ts.map +1 -0
  104. package/dist/agent-farm/servers/mailbox-wiring.js +425 -0
  105. package/dist/agent-farm/servers/mailbox-wiring.js.map +1 -0
  106. package/dist/agent-farm/servers/message-write.d.ts +53 -1
  107. package/dist/agent-farm/servers/message-write.d.ts.map +1 -1
  108. package/dist/agent-farm/servers/message-write.js +63 -0
  109. package/dist/agent-farm/servers/message-write.js.map +1 -1
  110. package/dist/agent-farm/servers/overview.d.ts.map +1 -1
  111. package/dist/agent-farm/servers/overview.js +23 -4
  112. package/dist/agent-farm/servers/overview.js.map +1 -1
  113. package/dist/agent-farm/servers/render-gate.d.ts +141 -0
  114. package/dist/agent-farm/servers/render-gate.d.ts.map +1 -0
  115. package/dist/agent-farm/servers/render-gate.js +251 -0
  116. package/dist/agent-farm/servers/render-gate.js.map +1 -0
  117. package/dist/agent-farm/servers/session-submit.d.ts +90 -0
  118. package/dist/agent-farm/servers/session-submit.d.ts.map +1 -0
  119. package/dist/agent-farm/servers/session-submit.js +127 -0
  120. package/dist/agent-farm/servers/session-submit.js.map +1 -0
  121. package/dist/agent-farm/servers/tower-cron.d.ts +10 -7
  122. package/dist/agent-farm/servers/tower-cron.d.ts.map +1 -1
  123. package/dist/agent-farm/servers/tower-cron.js +58 -53
  124. package/dist/agent-farm/servers/tower-cron.js.map +1 -1
  125. package/dist/agent-farm/servers/tower-instances.d.ts +14 -2
  126. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
  127. package/dist/agent-farm/servers/tower-instances.js +78 -16
  128. package/dist/agent-farm/servers/tower-instances.js.map +1 -1
  129. package/dist/agent-farm/servers/tower-messages.d.ts +38 -1
  130. package/dist/agent-farm/servers/tower-messages.d.ts.map +1 -1
  131. package/dist/agent-farm/servers/tower-messages.js +106 -1
  132. package/dist/agent-farm/servers/tower-messages.js.map +1 -1
  133. package/dist/agent-farm/servers/tower-routes.d.ts +16 -4
  134. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
  135. package/dist/agent-farm/servers/tower-routes.js +670 -105
  136. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  137. package/dist/agent-farm/servers/tower-server.js +163 -31
  138. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  139. package/dist/agent-farm/servers/tower-terminals.d.ts +17 -2
  140. package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
  141. package/dist/agent-farm/servers/tower-terminals.js +104 -122
  142. package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
  143. package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -1
  144. package/dist/agent-farm/servers/tower-tunnel.js +63 -4
  145. package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
  146. package/dist/agent-farm/servers/tower-types.d.ts +2 -1
  147. package/dist/agent-farm/servers/tower-types.d.ts.map +1 -1
  148. package/dist/agent-farm/servers/tower-utils.d.ts +64 -1
  149. package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
  150. package/dist/agent-farm/servers/tower-utils.js +168 -1
  151. package/dist/agent-farm/servers/tower-utils.js.map +1 -1
  152. package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
  153. package/dist/agent-farm/servers/tower-websocket.js +6 -21
  154. package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
  155. package/dist/agent-farm/servers/write-queue.d.ts +35 -0
  156. package/dist/agent-farm/servers/write-queue.d.ts.map +1 -0
  157. package/dist/agent-farm/servers/write-queue.js +56 -0
  158. package/dist/agent-farm/servers/write-queue.js.map +1 -0
  159. package/dist/agent-farm/types.d.ts +39 -0
  160. package/dist/agent-farm/types.d.ts.map +1 -1
  161. package/dist/agent-farm/utils/agent-names.d.ts +2 -2
  162. package/dist/agent-farm/utils/agent-names.d.ts.map +1 -1
  163. package/dist/agent-farm/utils/agent-names.js +3 -3
  164. package/dist/agent-farm/utils/agent-names.js.map +1 -1
  165. package/dist/agent-farm/utils/architect-name.d.ts +2 -2
  166. package/dist/agent-farm/utils/architect-name.d.ts.map +1 -1
  167. package/dist/agent-farm/utils/architect-name.js +3 -3
  168. package/dist/agent-farm/utils/architect-name.js.map +1 -1
  169. package/dist/agent-farm/utils/config.d.ts +13 -0
  170. package/dist/agent-farm/utils/config.d.ts.map +1 -1
  171. package/dist/agent-farm/utils/config.js +33 -1
  172. package/dist/agent-farm/utils/config.js.map +1 -1
  173. package/dist/agent-farm/utils/harness.d.ts +103 -7
  174. package/dist/agent-farm/utils/harness.d.ts.map +1 -1
  175. package/dist/agent-farm/utils/harness.js +126 -19
  176. package/dist/agent-farm/utils/harness.js.map +1 -1
  177. package/dist/cli.d.ts.map +1 -1
  178. package/dist/cli.js +6 -32
  179. package/dist/cli.js.map +1 -1
  180. package/dist/commands/consult/cli-options.d.ts +34 -0
  181. package/dist/commands/consult/cli-options.d.ts.map +1 -0
  182. package/dist/commands/consult/cli-options.js +67 -0
  183. package/dist/commands/consult/cli-options.js.map +1 -0
  184. package/dist/commands/consult/index.d.ts +56 -2
  185. package/dist/commands/consult/index.d.ts.map +1 -1
  186. package/dist/commands/consult/index.js +272 -28
  187. package/dist/commands/consult/index.js.map +1 -1
  188. package/dist/commands/consult/metrics.d.ts +42 -0
  189. package/dist/commands/consult/metrics.d.ts.map +1 -1
  190. package/dist/commands/consult/metrics.js +129 -9
  191. package/dist/commands/consult/metrics.js.map +1 -1
  192. package/dist/commands/doctor.d.ts.map +1 -1
  193. package/dist/commands/doctor.js +71 -19
  194. package/dist/commands/doctor.js.map +1 -1
  195. package/dist/commands/porch/checks.d.ts +23 -0
  196. package/dist/commands/porch/checks.d.ts.map +1 -1
  197. package/dist/commands/porch/checks.js +60 -0
  198. package/dist/commands/porch/checks.js.map +1 -1
  199. package/dist/commands/porch/config.d.ts +20 -0
  200. package/dist/commands/porch/config.d.ts.map +1 -1
  201. package/dist/commands/porch/config.js +20 -0
  202. package/dist/commands/porch/config.js.map +1 -1
  203. package/dist/commands/porch/index.js +21 -28
  204. package/dist/commands/porch/index.js.map +1 -1
  205. package/dist/commands/porch/next.d.ts.map +1 -1
  206. package/dist/commands/porch/next.js +2 -41
  207. package/dist/commands/porch/next.js.map +1 -1
  208. package/dist/lib/config.d.ts +69 -3
  209. package/dist/lib/config.d.ts.map +1 -1
  210. package/dist/lib/config.js +67 -3
  211. package/dist/lib/config.js.map +1 -1
  212. package/dist/lib/consult-lanes.d.ts +149 -0
  213. package/dist/lib/consult-lanes.d.ts.map +1 -0
  214. package/dist/lib/consult-lanes.js +360 -0
  215. package/dist/lib/consult-lanes.js.map +1 -0
  216. package/dist/lib/github.js +1 -1
  217. package/dist/lib/github.js.map +1 -1
  218. package/dist/lib/prompt-behavior-metrics.d.ts +67 -0
  219. package/dist/lib/prompt-behavior-metrics.d.ts.map +1 -0
  220. package/dist/lib/prompt-behavior-metrics.js +290 -0
  221. package/dist/lib/prompt-behavior-metrics.js.map +1 -0
  222. package/dist/lib/skeleton.d.ts +22 -1
  223. package/dist/lib/skeleton.d.ts.map +1 -1
  224. package/dist/lib/skeleton.js +120 -0
  225. package/dist/lib/skeleton.js.map +1 -1
  226. package/dist/lib/test-env.d.ts +74 -0
  227. package/dist/lib/test-env.d.ts.map +1 -0
  228. package/dist/lib/test-env.js +92 -0
  229. package/dist/lib/test-env.js.map +1 -0
  230. package/dist/terminal/pty-manager.d.ts +2 -0
  231. package/dist/terminal/pty-manager.d.ts.map +1 -1
  232. package/dist/terminal/pty-manager.js +16 -6
  233. package/dist/terminal/pty-manager.js.map +1 -1
  234. package/dist/terminal/pty-session.d.ts +131 -0
  235. package/dist/terminal/pty-session.d.ts.map +1 -1
  236. package/dist/terminal/pty-session.js +232 -39
  237. package/dist/terminal/pty-session.js.map +1 -1
  238. package/dist/terminal/ring-buffer.d.ts +39 -6
  239. package/dist/terminal/ring-buffer.d.ts.map +1 -1
  240. package/dist/terminal/ring-buffer.js +74 -6
  241. package/dist/terminal/ring-buffer.js.map +1 -1
  242. package/dist/terminal/session-manager.d.ts +53 -0
  243. package/dist/terminal/session-manager.d.ts.map +1 -1
  244. package/dist/terminal/session-manager.js +94 -9
  245. package/dist/terminal/session-manager.js.map +1 -1
  246. package/dist/terminal/session-screen.d.ts +91 -0
  247. package/dist/terminal/session-screen.d.ts.map +1 -0
  248. package/dist/terminal/session-screen.js +135 -0
  249. package/dist/terminal/session-screen.js.map +1 -0
  250. package/dist/terminal/shellper-main.js +2 -1
  251. package/dist/terminal/shellper-main.js.map +1 -1
  252. package/dist/terminal/shellper-process.d.ts +1 -1
  253. package/dist/terminal/shellper-process.d.ts.map +1 -1
  254. package/dist/terminal/shellper-process.js +17 -8
  255. package/dist/terminal/shellper-process.js.map +1 -1
  256. package/dist/terminal/shellper-replay-buffer.d.ts +69 -7
  257. package/dist/terminal/shellper-replay-buffer.d.ts.map +1 -1
  258. package/dist/terminal/shellper-replay-buffer.js +167 -31
  259. package/dist/terminal/shellper-replay-buffer.js.map +1 -1
  260. package/package.json +8 -6
  261. package/skeleton/.claude/skills/afx/SKILL.md +14 -1
  262. package/skeleton/.claude/skills/arch-init/SKILL.md +22 -9
  263. package/skeleton/.claude/skills/arch-save/SKILL.md +183 -0
  264. package/skeleton/.claude/skills/codev/SKILL.md +31 -0
  265. package/skeleton/.claude/skills/runnable-worktrees/SKILL.md +119 -0
  266. package/skeleton/.codex/skills/afx/SKILL.md +14 -1
  267. package/skeleton/.codex/skills/arch-init/SKILL.md +22 -9
  268. package/skeleton/.codex/skills/arch-save/SKILL.md +183 -0
  269. package/skeleton/.codex/skills/codev/SKILL.md +31 -0
  270. package/skeleton/.codex/skills/runnable-worktrees/SKILL.md +119 -0
  271. package/skeleton/protocols/air/builder-prompt.md +28 -47
  272. package/skeleton/protocols/air/consult-types/impl-review.md +17 -34
  273. package/skeleton/protocols/air/consult-types/pr-review.md +14 -37
  274. package/skeleton/protocols/air/prompts/implement.md +20 -73
  275. package/skeleton/protocols/air/prompts/pr.md +22 -54
  276. package/skeleton/protocols/air/protocol.md +40 -71
  277. package/skeleton/protocols/aspir/builder-prompt.md +29 -66
  278. package/skeleton/protocols/aspir/consult-types/impl-review.md +17 -44
  279. package/skeleton/protocols/aspir/consult-types/phase-review.md +17 -44
  280. package/skeleton/protocols/aspir/consult-types/plan-review.md +14 -38
  281. package/skeleton/protocols/aspir/consult-types/pr-review.md +13 -39
  282. package/skeleton/protocols/aspir/consult-types/spec-review.md +13 -33
  283. package/skeleton/protocols/aspir/prompts/implement.md +27 -196
  284. package/skeleton/protocols/aspir/prompts/plan.md +21 -85
  285. package/skeleton/protocols/aspir/prompts/review.md +29 -228
  286. package/skeleton/protocols/aspir/prompts/specify.md +25 -111
  287. package/skeleton/protocols/aspir/protocol.json +10 -0
  288. package/skeleton/protocols/aspir/protocol.md +36 -82
  289. package/skeleton/protocols/bugfix/builder-prompt.md +23 -45
  290. package/skeleton/protocols/bugfix/consult-types/impl-review.md +21 -45
  291. package/skeleton/protocols/bugfix/consult-types/pr-review.md +18 -52
  292. package/skeleton/protocols/bugfix/prompts/fix.md +16 -61
  293. package/skeleton/protocols/bugfix/prompts/investigate.md +18 -62
  294. package/skeleton/protocols/bugfix/prompts/pr.md +22 -57
  295. package/skeleton/protocols/bugfix/protocol.md +44 -50
  296. package/skeleton/protocols/experiment/builder-prompt.md +25 -58
  297. package/skeleton/protocols/experiment/protocol.md +22 -188
  298. package/skeleton/protocols/experiment/templates/notes.md +11 -71
  299. package/skeleton/protocols/maintain/builder-prompt.md +24 -45
  300. package/skeleton/protocols/maintain/consult-types/impl-review.md +17 -44
  301. package/skeleton/protocols/maintain/consult-types/pr-review.md +13 -39
  302. package/skeleton/protocols/maintain/prompts/maintain.md +1 -1
  303. package/skeleton/protocols/maintain/protocol.md +32 -266
  304. package/skeleton/protocols/maintain/templates/maintenance-run.md +11 -0
  305. package/skeleton/protocols/pir/builder-prompt.md +30 -64
  306. package/skeleton/protocols/pir/consult-types/impl-review.md +17 -50
  307. package/skeleton/protocols/pir/consult-types/pr-review.md +11 -40
  308. package/skeleton/protocols/pir/prompts/implement.md +1 -2
  309. package/skeleton/protocols/pir/prompts/plan.md +0 -3
  310. package/skeleton/protocols/pir/prompts/review.md +1 -1
  311. package/skeleton/protocols/pir/protocol.md +54 -177
  312. package/skeleton/protocols/research/builder-prompt.md +27 -58
  313. package/skeleton/protocols/research/protocol.md +28 -153
  314. package/skeleton/protocols/spike/builder-prompt.md +30 -48
  315. package/skeleton/protocols/spike/protocol.md +24 -107
  316. package/skeleton/protocols/spike/templates/findings.md +9 -39
  317. package/skeleton/protocols/spir/builder-prompt.md +33 -62
  318. package/skeleton/protocols/spir/consult-types/impl-review.md +17 -44
  319. package/skeleton/protocols/spir/consult-types/phase-review.md +17 -44
  320. package/skeleton/protocols/spir/consult-types/plan-review.md +14 -38
  321. package/skeleton/protocols/spir/consult-types/pr-review.md +13 -39
  322. package/skeleton/protocols/spir/consult-types/spec-review.md +13 -33
  323. package/skeleton/protocols/spir/prompts/implement.md +26 -195
  324. package/skeleton/protocols/spir/prompts/plan.md +20 -84
  325. package/skeleton/protocols/spir/prompts/review.md +28 -227
  326. package/skeleton/protocols/spir/prompts/specify.md +24 -110
  327. package/skeleton/protocols/spir/protocol.json +10 -0
  328. package/skeleton/protocols/spir/protocol.md +84 -633
  329. package/skeleton/protocols/spir/templates/plan.md +28 -147
  330. package/skeleton/protocols/spir/templates/review.md +21 -80
  331. package/skeleton/protocols/spir/templates/spec.md +24 -118
  332. package/skeleton/resources/commands/agent-farm.md +259 -0
  333. package/skeleton/resources/commands/consult.md +236 -8
  334. package/skeleton/resources/commands/overview.md +1 -0
  335. package/skeleton/roles/architect.md +67 -317
  336. package/skeleton/roles/builder.md +77 -191
  337. package/skeleton/templates/AGENTS.md +2 -0
  338. package/skeleton/templates/CLAUDE.md +2 -0
  339. package/templates/tower.html +39 -2
  340. package/dashboard-dist/assets/index-BZ1x7x1X.js.map +0 -1
  341. package/dashboard-dist/assets/index-DB1KBSNE.css +0 -32
  342. package/dist/agent-farm/servers/send-buffer.d.ts +0 -59
  343. package/dist/agent-farm/servers/send-buffer.d.ts.map +0 -1
  344. package/dist/agent-farm/servers/send-buffer.js +0 -116
  345. package/dist/agent-farm/servers/send-buffer.js.map +0 -1
  346. package/skeleton/porch/prompts/defend.md +0 -108
  347. package/skeleton/porch/prompts/diagnose.md +0 -70
  348. package/skeleton/porch/prompts/evaluate.md +0 -132
  349. package/skeleton/porch/prompts/fix.md +0 -59
  350. package/skeleton/porch/prompts/implement.md +0 -88
  351. package/skeleton/porch/prompts/plan.md +0 -74
  352. package/skeleton/porch/prompts/pr.md +0 -84
  353. package/skeleton/porch/prompts/review.md +0 -249
  354. package/skeleton/porch/prompts/specify.md +0 -53
  355. package/skeleton/porch/prompts/test.md +0 -63
  356. package/skeleton/protocols/aspir/templates/plan.md +0 -184
  357. package/skeleton/protocols/aspir/templates/review.md +0 -120
  358. package/skeleton/protocols/aspir/templates/spec.md +0 -154
@@ -4,28 +4,21 @@ You are implementing {{input_description}}.
4
4
 
5
5
  {{#if mode_soft}}
6
6
  ## Mode: SOFT
7
- You are running in SOFT mode. This means:
8
- - You follow the BUGFIX protocol yourself (no porch orchestration)
9
- - The architect monitors your work and verifies you're adhering to the protocol
10
- - Run consultations manually when the protocol calls for them
11
- - You have flexibility in execution, but must stay compliant with the protocol
7
+
8
+ You follow the protocol yourself; the architect verifies compliance.
12
9
  {{/if}}
13
10
 
14
11
  {{#if mode_strict}}
15
12
  ## Mode: STRICT
16
- You are running in STRICT mode. This means:
17
- - Porch orchestrates your work
18
- - Run: `porch next` to get your next tasks
19
- - Follow porch signals and gate approvals
20
-
21
- ### ABSOLUTE RESTRICTIONS (STRICT MODE)
22
- - **NEVER edit `status.yaml` directly** — only porch commands may modify project state
23
- - **NEVER call `porch approve` without explicit human approval** — only run it after the architect says to
24
- - **NEVER skip the 3-way review** — always follow porch next → porch done cycle
13
+
14
+ Porch orchestrates. `porch next` gives you tasks; `porch done` signals completion. Never
15
+ hand-edit `status.yaml` — only porch commands modify project state.
25
16
  {{/if}}
26
17
 
27
18
  ## Protocol
28
- Follow the BUGFIX protocol. Read and internalize the protocol before starting any work. The full protocol text is included below under **## Protocol Reference (full text)**.
19
+
20
+ The full protocol text is inlined below under **## Protocol Reference (full text)** — you do not
21
+ need to fetch it.
29
22
 
30
23
  {{#if issue}}
31
24
  ## Issue #{{issue.number}}
@@ -33,43 +26,28 @@ Follow the BUGFIX protocol. Read and internalize the protocol before starting an
33
26
 
34
27
  **Description**:
35
28
  {{issue.body}}
29
+ {{/if}}
36
30
 
37
31
  ## Your Mission
32
+
38
33
  1. Reproduce the bug
39
- 2. Identify root cause
40
- 3. Implement fix (< 300 LOC)
41
- 4. Add regression test
42
- 5. Create PR with "Fixes #{{issue.number}}" in body
43
- 6. Notify architect via `afx send architect "PR #N ready for review (fixes #{{issue.number}})"`
34
+ 2. Identify the root cause — **no code in the investigate phase**
35
+ 3. Implement the minimal fix (<300 LOC)
36
+ 4. Add a regression test that **fails without the fix and passes with it**
37
+ 5. Open a PR with `Fixes #{{issue.number}}` in the body
38
+ 6. Notify: `afx send architect "PR #N ready for review (fixes #{{issue.number}})"`
39
+
40
+ When merging, use `gh pr merge --merge` **without** `--delete-branch` — you are checked out on
41
+ that branch in a worktree.
42
+
43
+ If the fix outgrows BUGFIX (>300 LOC, architectural impact, or an unclear root cause after
44
+ investigation), stop and say so:
44
45
 
45
- If the fix is too complex (> 300 LOC or architectural changes), notify the Architect via:
46
46
  ```bash
47
47
  afx send architect "Issue #{{issue.number}} is more complex than expected. [Reason]. Recommend escalating to SPIR."
48
48
  ```
49
49
 
50
50
  ## Notifications
51
- Always use `afx send architect "..."` to notify the architect at key moments:
52
- - **PR ready**: `afx send architect "PR #N ready for review (fixes #{{issue.number}})"`
53
- - **PR merged**: `afx send architect "PR #N merged for issue #{{issue.number}}. Ready for cleanup."`
54
- - **Blocked**: `afx send architect "Blocked on issue #{{issue.number}}: [reason]"`
55
- {{/if}}
56
-
57
- ## Handling Flaky Tests
58
-
59
- If you encounter **pre-existing flaky tests** (intermittent failures unrelated to your changes):
60
- 1. **DO NOT** edit `status.yaml` to bypass checks
61
- 2. **DO NOT** skip porch checks or use any workaround to avoid the failure
62
- 3. **DO** mark the test as skipped with a clear annotation (e.g., `it.skip('...') // FLAKY: skipped pending investigation`)
63
- 4. **DO** document each skipped flaky test in your review under a `## Flaky Tests` section
64
- 5. Commit the skip and continue with your work
65
-
66
- ## Getting Started
67
- 1. Read the BUGFIX protocol
68
- 2. Review the issue details
69
- 3. Reproduce the bug before fixing
70
-
71
- ---
72
-
73
- ## Protocol Reference (full text)
74
51
 
75
- {{protocol_reference}}
52
+ The architect is not watching. `afx send architect "..."` at each of: gate reached, PR ready, PR
53
+ merged, blocked.
@@ -1,58 +1,40 @@
1
1
  # Implementation Review Prompt (BUGFIX)
2
2
 
3
3
  ## Context
4
- You are reviewing in-progress fix work for a **BUGFIX protocol** project. A builder has investigated a GitHub Issue, identified a root cause, and is implementing the fix + regression test. Your job is to verify the fix matches the issue's symptom and meets BUGFIX standards.
5
4
 
6
- **BUGFIX is not SPIR.** There is **no spec, no plan, and no review document**. The GitHub Issue is the spec. The PR body will be the review. Do **not** request changes for missing `codev/specs/`, `codev/plans/`, or `codev/reviews/` artifacts.
5
+ You are reviewing in-progress fix work for a **BUGFIX protocol** project. A builder has investigated a GitHub Issue, identified a root cause, and is implementing the fix + regression test. Verify the fix matches the issue's symptom and meets BUGFIX standards.
7
6
 
8
- ## CRITICAL: Verify Before Flagging
7
+ **BUGFIX is not SPIR.** There is **no spec, no plan, and no review document** — the GitHub Issue is the spec, and the PR body will be the review. Do **not** request changes for missing `codev/specs/`, `codev/plans/`, or `codev/reviews/` artifacts.
9
8
 
10
- Before requesting changes for missing configuration, incorrect patterns, or framework issues:
11
- 1. **Check `package.json`** for actual dependency versions — framework conventions change between major versions.
12
- 2. **Read the actual config files** (or confirm their deliberate absence) before flagging missing configs.
13
- 3. **Do not assume** your training data reflects the version in use — verify against project files.
14
- 4. If "Previous Iteration Context" is provided, read it carefully before re-raising concerns that were already disputed.
9
+ ## Verify before flagging
15
10
 
16
- ## Focus Areas
17
-
18
- 1. **Issue Adherence**
19
- - Does the implementation actually resolve the symptom described in the GitHub Issue?
20
- - Is the root cause fix targeted, or is it a workaround that masks the symptom?
21
-
22
- 2. **Regression Test**
23
- - Is there a regression test that exercises the exact scenario from the issue?
24
- - Without the fix applied, would this test fail? (The whole point.)
25
- - Is the test deterministic?
26
- - If no test was added, has the builder justified why (e.g., docs-only change with no testable behavior)?
11
+ Before requesting changes for missing configuration, wrong patterns, or framework issues, confirm the claim against the project rather than your training data:
27
12
 
28
- 3. **Scope Discipline**
29
- - Is the change focused on the root cause only — no unrelated refactors, no drive-by fixes?
30
- - Is the net diff staying under ~300 LOC? If it has grown larger, should this escalate to SPIR/TICK?
13
+ - Check `package.json` for the actual dependency versions — framework conventions change between major versions.
14
+ - Read the actual config files (or confirm their deliberate absence) before flagging a missing config.
15
+ - If "Previous Iteration Context" is provided, read it before re-raising concerns already disputed.
31
16
 
32
- 4. **Code Quality**
33
- - Is the code readable and maintainable?
34
- - Are there obvious bugs or issues introduced by the fix?
35
- - Are error cases handled appropriately for the path that was changed?
36
- - No debug code, stray `console.log`, or commented-out code.
17
+ ## Focus Areas
37
18
 
38
- 5. **Test Status**
39
- - Existing tests still pass.
40
- - Build still passes.
41
- - No new flaky tests introduced.
19
+ - **Issue resolution** — the fix actually resolves the symptom in the issue, targeting the root cause rather than masking it with a workaround.
20
+ - **Regression test** — a deterministic test exercises the exact scenario from the issue and **would fail without the fix**. If none was added, the builder has justified why (e.g. a docs-only change with no testable behavior).
21
+ - **Scope discipline** — the change is focused on the root cause only (no unrelated refactors or drive-by fixes) and stays under ~300 LOC; if it grew larger, it should escalate to SPIR/TICK.
22
+ - **Code quality** — readable and maintainable; no bugs introduced; error cases on the changed path handled; no debug or commented-out code.
23
+ - **Test status** — existing tests and the build still pass; no new flaky tests.
42
24
 
43
25
  ## Out of Scope (Do NOT request changes for)
44
26
 
45
- The following are **not** part of the BUGFIX protocol and must **not** be cited as REQUEST_CHANGES reasons:
27
+ These are **not** part of the BUGFIX protocol and must **not** be cited as `REQUEST_CHANGES` reasons:
46
28
 
47
29
  - Missing `codev/specs/<N>-*.md`, `codev/plans/<N>-*.md`, or `codev/reviews/<N>-*.md` — BUGFIX produces none of these. The GitHub Issue is the spec; the PR body is the review.
48
- - Commit format `[Spec NNNN][Phase]` — BUGFIX uses `Fix #N: ...` or `[Bugfix #N] ...`. This is the protocol-mandated format, **not** a bug.
30
+ - Commit format `[Spec NNNN][Phase]` — BUGFIX uses `Fix #N: ...` or `[Bugfix #N] ...`. That is the protocol-mandated format, **not** a bug.
49
31
  - `status.yaml` fields such as `build_complete: false` — porch manages `status.yaml`; the builder is **forbidden** from editing it manually. Treat porch state as informational, not a fixable issue.
50
32
  - "Plan Alignment" or "Spec Adherence" — there is no plan and no spec to align with.
51
- - Phase-scoping concerns — BUGFIX is single-phase by design. There are no plan phases to scope against.
33
+ - Phase-scoping concerns — BUGFIX is single-phase by design; there are no plan phases to scope against.
52
34
 
53
35
  ## Verdict Format
54
36
 
55
- After your review, provide your verdict in exactly this format:
37
+ Provide your verdict in exactly this format — `consult` parses it:
56
38
 
57
39
  ```
58
40
  ---
@@ -66,14 +48,8 @@ KEY_ISSUES:
66
48
  ...
67
49
  ```
68
50
 
69
- **Verdict meanings:**
70
- - `APPROVE`: Fix and regression test are in good shape; builder can proceed to PR creation.
71
- - `REQUEST_CHANGES`: Real BUGFIX-relevant issues (fix doesn't resolve the symptom, missing regression test without justification, scope creep, broken existing tests, etc.).
72
- - `COMMENT`: Minor suggestions; builder can proceed but should consider the feedback.
73
-
74
- ## Notes
51
+ - `APPROVE`: fix and regression test are in good shape; builder can proceed to PR creation.
52
+ - `REQUEST_CHANGES`: real BUGFIX-relevant issues (fix doesn't resolve the symptom, missing regression test without justification, scope creep, broken existing tests).
53
+ - `COMMENT`: minor suggestions; builder can proceed but should consider the feedback.
75
54
 
76
- - This is an implementation-level review, not the final PR review.
77
- - Focus on "does this fix actually resolve the issue, and is it protected by a regression test" — not on artifacts from other protocols.
78
- - If referencing line numbers, use `file:line` format.
79
- - The builder needs actionable, protocol-correct feedback to continue.
55
+ This is an implementation-level review, not the final PR review — focus on "does this fix resolve the issue, protected by a regression test", not on artifacts from other protocols.
@@ -1,64 +1,35 @@
1
1
  # PR Ready Review Prompt (BUGFIX)
2
2
 
3
3
  ## Context
4
- You are performing a final self-check during the PR phase of the **BUGFIX protocol**. The builder has investigated a GitHub Issue, implemented a focused fix, and added a regression test. They are about to create — or have just created — a PR for the architect's integration review.
5
4
 
6
- **BUGFIX is not SPIR.** Do **not** review against the SPIR three-document trinity. The artifacts of a BUGFIX project are:
7
- - The originating **GitHub Issue** (serves as the spec)
8
- - The **code fix** (minimal, focused on root cause)
9
- - A **regression test** that fails without the fix and passes with it
10
- - The **PR body** (Summary, Root Cause, Fix, Test Plan)
5
+ You are performing the final self-check during the PR phase of the **BUGFIX protocol**. The builder has investigated a GitHub Issue, implemented a focused fix, and added a regression test, and is about to create — or has just created — the PR for the architect's integration review.
11
6
 
12
- There is **no `codev/specs/`, `codev/plans/`, or `codev/reviews/` file** for a BUGFIX, and there should not be one. The commit format is `Fix #NNNN: <description>` (or `[Bugfix #NNNN] ...`), **not** `[Spec NNNN][Phase]`.
7
+ **BUGFIX is not SPIR.** Do **not** review against the SPIR three-document trinity. A BUGFIX project's artifacts are the originating **GitHub Issue** (the spec), the **code fix** (minimal, root-cause-focused), a **regression test** that fails without the fix and passes with it, and the **PR body** (Summary, Root Cause, Fix, Test Plan). There is **no `codev/specs/`, `codev/plans/`, or `codev/reviews/` file**, and there should not be. The commit format is `Fix #NNNN: <description>` (or `[Bugfix #NNNN] ...`), **not** `[Spec NNNN][Phase]`.
13
8
 
14
9
  ## Focus Areas
15
10
 
16
- 1. **Issue Resolution**
17
- - Does the fix actually resolve the symptom described in the issue?
18
- - Does the PR body include `Fixes #<N>` so the issue auto-closes on merge?
19
- - Does the PR description cover: Summary, Root Cause, Fix, Test Plan?
20
-
21
- 2. **Regression Test**
22
- - Is there a regression test that targets the exact scenario from the issue?
23
- - Would the test fail without the fix? (If reviewers can't tell, ask the builder to demonstrate.)
24
- - Is the test deterministic (not flaky)?
25
- - If the fix is documentation-only or otherwise truly untestable, has the builder explicitly justified the absence of a test?
26
-
27
- 3. **Scope Discipline**
28
- - Is the change focused on the root cause? No unrelated refactors, no drive-by fixes for other bugs.
29
- - Is the net diff under ~300 LOC (additions + deletions, excluding generated/lockfiles)?
30
- - If the scope grew beyond a bugfix, should the builder have escalated to SPIR/TICK instead?
31
-
32
- 4. **Code Cleanliness**
33
- - No debug code, `console.log`, or commented-out blocks left behind.
34
- - No stray TODOs introduced by this fix.
35
- - Code follows existing project conventions.
36
-
37
- 5. **Test Status**
38
- - All existing tests pass.
39
- - Build passes.
40
- - No new flaky tests introduced.
41
-
42
- 6. **PR Hygiene**
43
- - Commits use the BUGFIX format: `Fix #<N>: ...` or `[Bugfix #<N>] ...` (**not** `[Spec NNNN][Phase]`).
44
- - Branch is up to date with its base (or close enough for clean merge).
45
- - PR is linked to the issue.
11
+ - **Issue resolution** — the fix resolves the symptom; the PR body includes `Fixes #<N>` (so the issue auto-closes on merge) and covers Summary, Root Cause, Fix, Test Plan.
12
+ - **Regression test** — a deterministic test targets the exact scenario and would fail without the fix; a truly untestable (e.g. docs-only) fix has the absence explicitly justified.
13
+ - **Scope discipline** — focused on the root cause, no unrelated refactors or drive-by fixes, net diff under ~300 LOC; if it grew beyond a bugfix, it should have escalated to SPIR/TICK.
14
+ - **Code cleanliness** — no debug code, `console.log`, commented-out blocks, or stray TODOs; follows project conventions.
15
+ - **Test status** — existing tests and the build pass; no new flaky tests.
16
+ - **PR hygiene** — commits use `Fix #<N>: ...` / `[Bugfix #<N>] ...` (**not** `[Spec NNNN][Phase]`), the branch is current with its base, and the PR is linked to the issue.
46
17
 
47
18
  ## Out of Scope (Do NOT request changes for)
48
19
 
49
- The following are **not** part of the BUGFIX protocol and must **not** be cited as REQUEST_CHANGES reasons:
20
+ These are **not** part of the BUGFIX protocol and must **not** be cited as `REQUEST_CHANGES` reasons:
50
21
 
51
22
  - Missing `codev/specs/<N>-*.md` — BUGFIX has no spec; the GitHub Issue is the spec.
52
23
  - Missing `codev/plans/<N>-*.md` — BUGFIX has no plan.
53
- - Missing `codev/reviews/<N>-*.md` — BUGFIX has no review document; review lives in the PR body.
24
+ - Missing `codev/reviews/<N>-*.md` — BUGFIX has no review document; the review lives in the PR body.
54
25
  - Commit format `[Spec NNNN][Phase]` — BUGFIX intentionally uses `Fix #N:` / `[Bugfix #N]`.
55
26
  - `status.yaml` fields like `build_complete: false` — porch manages `status.yaml`; the builder is **forbidden** from editing it directly. Treat porch state as informational, not a fixable issue.
56
27
  - Phase-scoping concerns — BUGFIX is a single-phase protocol; there are no plan phases to scope against.
57
- - **DO NOT** flag the syntax of `git diff` examples that appear in review-file prose (e.g., `git diff ci..HEAD` inside a "Files Changed" caption). Quoted diff syntax is documentation, not a command. Apply two-dot/three-dot scrutiny only to diffs you compute yourself.
28
+ - The syntax of `git diff` examples in review-file prose (e.g. `git diff ci..HEAD` in a "Files Changed" caption) — quoted diff syntax is documentation, not a command. Apply two-dot/three-dot scrutiny only to diffs you compute yourself.
58
29
 
59
30
  ## Verdict Format
60
31
 
61
- After your review, provide your verdict in exactly this format:
32
+ Provide your verdict in exactly this format — `consult` parses it:
62
33
 
63
34
  ```
64
35
  ---
@@ -76,23 +47,18 @@ PR_SUMMARY: |
76
47
  Fixes #<N>. [1-2 sentences on what was fixed.]
77
48
 
78
49
  ## Root Cause
79
- [Brief explanation of what caused the bug]
50
+ [What caused the bug]
80
51
 
81
52
  ## Fix
82
- [Brief explanation of the fix]
53
+ [What changed]
83
54
 
84
55
  ## Test Plan
85
56
  - [Regression test description]
86
57
  - [Manual verification, if applicable]
87
58
  ```
88
59
 
89
- **Verdict meanings:**
90
- - `APPROVE`: Bug is resolved, regression test is in place, PR is ready for architect review.
91
- - `REQUEST_CHANGES`: Real BUGFIX-relevant issues to fix (missing regression test, fix doesn't resolve the symptom, scope creep, etc.).
92
- - `COMMENT`: Minor items, can proceed but note feedback.
60
+ - `APPROVE`: bug resolved, regression test in place, PR ready for architect review.
61
+ - `REQUEST_CHANGES`: real BUGFIX-relevant issues (missing regression test, fix doesn't resolve the symptom, scope creep).
62
+ - `COMMENT`: minor items; can proceed but note the feedback.
93
63
 
94
- ## Notes
95
-
96
- - This is the builder's final self-review before hand-off to the architect.
97
- - The `PR_SUMMARY` block can be used directly as the PR description.
98
- - Focus on "is this bug actually fixed and protected by a test" — not on artifacts from other protocols.
64
+ The `PR_SUMMARY` block can be used directly as the PR description.
@@ -2,76 +2,31 @@
2
2
 
3
3
  You are executing the **FIX** phase of the BUGFIX protocol.
4
4
 
5
- ## Your Goal
5
+ ## Goal
6
6
 
7
- Implement the bug fix and add a regression test. Keep it minimal and focused.
7
+ Fix the bug with the minimum change, and add a regression test that pins it.
8
8
 
9
9
  ## Context
10
10
 
11
11
  - **Issue**: #{{issue.number}} — {{issue.title}}
12
12
  - **Current State**: {{current_state}}
13
13
 
14
- ## Process
14
+ ## What must be true when you finish
15
15
 
16
- ### 1. Implement the Fix
16
+ - **The change is minimal and targeted.** Fix the root cause from INVESTIGATE and nothing else — no refactoring of surrounding code, no unrelated features, no other bugs you happen to notice (file separate issues for those). Self-documenting code, no debug or commented-out code, existing project conventions.
17
+ - **A regression test pins the fix.** Every bugfix carries a test that **fails without the fix and passes with it**, covers the issue's scenario, and is deterministic. The only exception is a genuinely untestable change (e.g. a CSS-only tweak with no observable behavior) — and then you state why, in the commit message and PR description.
18
+ - **Build and tests pass.** Confirm the real project commands (check `package.json` if unsure) and run them; fix failures before signaling.
19
+ - **The change stays within BUGFIX scope.** If the fix grows past ~300 LOC, signal `TOO_COMPLEX` rather than pressing on.
17
20
 
18
- Apply the minimum change needed to resolve the bug:
19
- - Fix the root cause identified in the INVESTIGATE phase
20
- - Do NOT refactor surrounding code
21
- - Do NOT add features beyond what's needed
22
- - Do NOT fix other bugs you happen to notice (file separate issues)
23
-
24
- **Code Quality**:
25
- - Self-documenting code (clear names, obvious structure)
26
- - No commented-out code or debug prints
27
- - Follow existing project conventions
28
-
29
- ### 2. Add a Regression Test
30
-
31
- **A regression test is MANDATORY.** Every bugfix MUST include a test unless you provide explicit justification for why a test is impossible (e.g., pure CSS-only change with no testable behavior). If you skip the test, you MUST explain why in your commit message and PR description.
32
-
33
- Write a test that:
34
- - Fails without the fix (demonstrates the bug)
35
- - Passes with the fix (demonstrates the fix works)
36
- - Covers the specific scenario from the issue
37
- - Is deterministic (not flaky)
38
-
39
- Place tests following project conventions (`__tests__/`, `*.test.ts`, etc.).
40
-
41
- ### 3. Verify the Fix
42
-
43
- Run build and tests:
44
-
45
- ```bash
46
- npm run build # Must pass
47
- npm test # Must pass
48
- ```
49
-
50
- Fix any failures before proceeding. If build/test commands don't exist, check `package.json`.
51
-
52
- ### 4. Commit
53
-
54
- Stage and commit your changes:
55
- - Use explicit file paths (never `git add -A` or `git add .`)
56
- - Commit message: `Fix #{{issue.number}}: <brief description>`
21
+ Commit with an explicit staged path and the message `Fix #{{issue.number}}: <brief description>`.
57
22
 
58
23
  ## Signals
59
24
 
60
- When fix and tests are complete and passing:
61
-
62
- ```
63
- <signal>PHASE_COMPLETE</signal>
64
- ```
65
-
66
- If you encounter a blocker:
67
-
68
- ```
69
- <signal>BLOCKED:reason goes here</signal>
70
- ```
71
-
72
- ## Important Notes
73
-
74
- 1. **Minimal changes only** — Fix the bug, nothing else
75
- 2. **Regression test is MANDATORY** — No fix without a test. If truly untestable, justify in writing.
76
- 3. **Build AND tests must pass** — Don't signal complete until both pass
77
- 4. **Stay under 300 LOC** — If the fix grows beyond this, signal `TOO_COMPLEX`
25
+ - Fix and tests complete and passing:
26
+ ```
27
+ <signal>PHASE_COMPLETE</signal>
28
+ ```
29
+ - Blocked:
30
+ ```
31
+ <signal>BLOCKED:reason goes here</signal>
32
+ ```
@@ -2,76 +2,32 @@
2
2
 
3
3
  You are executing the **INVESTIGATE** phase of the BUGFIX protocol.
4
4
 
5
- ## Your Goal
5
+ ## Goal
6
6
 
7
- Understand the bug, reproduce it, identify the root cause, and assess whether it's fixable within BUGFIX scope (< 300 LOC).
7
+ Understand the bug, reproduce it, find the root cause, and decide whether it fits BUGFIX scope (a focused change under ~300 LOC).
8
8
 
9
9
  ## Context
10
10
 
11
11
  - **Issue**: #{{issue.number}} — {{issue.title}}
12
12
  - **Current State**: {{current_state}}
13
13
 
14
- ## Process
14
+ ## What must be true when you finish
15
15
 
16
- ### 1. Read the Issue
17
-
18
- Read the full issue description. Identify:
19
- - What is the expected behavior?
20
- - What is the actual behavior?
21
- - Are there reproduction steps?
22
- - Are there error messages or screenshots?
23
-
24
- ### 2. Reproduce the Bug
25
-
26
- Before fixing anything, confirm the bug exists:
27
- - Follow the reproduction steps from the issue
28
- - If no steps are given, infer them from the description
29
- - Document the exact reproduction steps you used
30
- - If you **cannot** reproduce, signal `BLOCKED` with details
31
-
32
- ### 3. Identify Root Cause
33
-
34
- Trace the bug to its source:
35
- - Read the relevant code paths
36
- - Use grep/search to find related code
37
- - Identify the exact file(s) and line(s) causing the issue
38
- - Understand **why** the bug occurs, not just **where**
39
-
40
- ### 4. Assess Complexity
41
-
42
- Determine if this is BUGFIX-appropriate:
43
- - **< 300 LOC change**: Proceed with BUGFIX
44
- - **> 300 LOC or architectural**: Signal `TOO_COMPLEX` to escalate
45
-
46
- Consider:
47
- - How many files need to change?
48
- - Does it require new abstractions or refactoring?
49
- - Are there cascading effects?
50
-
51
- ## Output
52
-
53
- By the end of this phase, you should know:
54
- 1. The exact root cause
55
- 2. Which files need to change
56
- 3. The approximate size of the fix
57
- 4. Whether it's BUGFIX-appropriate
16
+ - **The bug is reproduced, not assumed.** You have confirmed the expected-vs-actual behavior from the issue and established concrete reproduction steps (inferring them if the issue gives none). If you cannot reproduce it, that is a `BLOCKED` signal with what you tried.
17
+ - **The root cause is understood** — the exact file(s) and line(s), and *why* the bug happens, not just where. Trace the failure path rather than pattern-matching a symptom.
18
+ - **The scope is assessed against BUGFIX's ceiling.** A focused fix under ~300 LOC proceeds; anything larger or architectural (new abstractions, refactors, cascading effects across many files) is a `TOO_COMPLEX` signal to escalate.
58
19
 
59
20
  ## Signals
60
21
 
61
- When investigation is complete:
62
-
63
- ```
64
- <signal>PHASE_COMPLETE</signal>
65
- ```
66
-
67
- If the bug is too complex for BUGFIX:
68
-
69
- ```
70
- <signal>TOO_COMPLEX</signal>
71
- ```
72
-
73
- If you're blocked (can't reproduce, missing context, etc.):
74
-
75
- ```
76
- <signal>BLOCKED:reason goes here</signal>
77
- ```
22
+ - Investigation complete (root cause + fix scope known):
23
+ ```
24
+ <signal>PHASE_COMPLETE</signal>
25
+ ```
26
+ - Too large or architectural for BUGFIX:
27
+ ```
28
+ <signal>TOO_COMPLEX</signal>
29
+ ```
30
+ - Blocked (cannot reproduce, missing context):
31
+ ```
32
+ <signal>BLOCKED:reason goes here</signal>
33
+ ```
@@ -2,32 +2,18 @@
2
2
 
3
3
  You are executing the **PR** phase of the BUGFIX protocol.
4
4
 
5
- ## Your Goal
5
+ ## Goal
6
6
 
7
- Create a pull request, run CMAP review, and address feedback.
7
+ Open the PR, run CMAP review on it, address feedback, and hand off to the architect at the `pr` gate.
8
8
 
9
9
  ## Context
10
10
 
11
11
  - **Issue**: #{{issue.number}} — {{issue.title}}
12
12
  - **Current State**: {{current_state}}
13
13
 
14
- ## Process
14
+ ## Create the PR
15
15
 
16
- ### 1. Create the Pull Request
17
-
18
- Create a PR that links to the issue.
19
-
20
- **PR body requirements**: The PR body MUST include `Fixes #<N>` (where `<N>` is
21
- the driving issue number) so GitHub auto-closes the issue on merge. If the PR
22
- fixes multiple issues (e.g. duplicates consolidated), include one `Fixes #<N>`
23
- per issue. Without this, GitHub will not auto-close the issue.
24
-
25
- **Exception**: if this PR only partially addresses the issue, use `Refs #<N>`
26
- or `Part of #<N>` instead of `Fixes` — the issue stays open until a
27
- follow-up PR closes it.
28
-
29
- **Note**: substitute the real issue number for `<N>` — do not leave the
30
- placeholder or any `{{...}}` template tag in the committed PR body.
16
+ The PR body must carry `Fixes #<N>` for the driving issue — one per issue if several — so GitHub auto-closes it on merge. **Exception:** a PR that only partially addresses the issue uses `Refs #<N>` or `Part of #<N>` instead, leaving it open for the follow-up. Substitute the real number for `<N>`; leave no `{{...}}` tag or `<N>` placeholder in the committed body.
31
17
 
32
18
  ```bash
33
19
  gh pr create --title "Fix #<N>: <brief description>" --body "$(cat <<'EOF'
@@ -35,15 +21,15 @@ gh pr create --title "Fix #<N>: <brief description>" --body "$(cat <<'EOF'
35
21
 
36
22
  <1-2 sentence description of the bug and fix>
37
23
 
38
- Fixes #<N> <!-- Substitute <N> with the real issue number -->
24
+ Fixes #<N> <!-- Substitute <N>; use "Refs #<N>" for a partial fix -->
39
25
 
40
26
  ## Root Cause
41
27
 
42
- <Brief explanation of why the bug occurred>
28
+ <why the bug occurred>
43
29
 
44
30
  ## Fix
45
31
 
46
- <Brief explanation of what was changed>
32
+ <what changed>
47
33
 
48
34
  ## Test Plan
49
35
 
@@ -54,9 +40,9 @@ EOF
54
40
  )"
55
41
  ```
56
42
 
57
- ### 2. Run CMAP Review
43
+ ## Run CMAP review
58
44
 
59
- Run 3-way parallel consultation on the PR:
45
+ BUGFIX runs its own 3-way consultation on the PR (porch does not do it for you). Dispatch all three in the background:
60
46
 
61
47
  ```bash
62
48
  consult -m gemini --protocol bugfix --type pr &
@@ -64,47 +50,26 @@ consult -m codex --protocol bugfix --type pr &
64
50
  consult -m claude --protocol bugfix --type pr &
65
51
  ```
66
52
 
67
- All three should run in the background (`run_in_background: true`).
68
-
69
- ### 3. Wait for Results and Address Feedback
70
-
71
- **DO NOT proceed to step 4 until ALL THREE consultations have returned results.**
72
-
73
- Wait for each background consultation to complete, then read the results:
74
- - Use `TaskOutput` (with `block: true`) to retrieve each consultation result
75
- - Record each model's verdict (APPROVE or REQUEST_CHANGES)
76
- - Fix any issues identified by reviewers
77
- - Push updates to the PR branch
78
- - Re-run CMAP if substantial changes were made
79
-
80
- You must have three concrete verdicts (e.g., "gemini: APPROVE, codex: APPROVE, claude: APPROVE") before continuing.
53
+ Do not proceed until **ALL THREE consultations have returned results** — retrieve each with `TaskOutput` (`block: true`), record its verdict (APPROVE / REQUEST_CHANGES), fix real issues, push, and re-run CMAP if the changes were substantial. You must hold three concrete verdicts before you notify.
81
54
 
82
- ### 4. Notify Architect
55
+ ## Notify and hand off at the gate
83
56
 
84
- **DO NOT send this notification until you have all three CMAP verdicts from step 3.**
85
-
86
- Send a **single** notification that includes the PR link and each model's verdict:
57
+ **DO NOT send this notification until you have all three CMAP verdicts.** Send a **single** notification with the PR link and all three verdicts, then request the gate:
87
58
 
88
59
  ```bash
89
60
  afx send architect "PR #<number> ready for review (fixes issue #{{issue.number}}). CMAP: gemini=<APPROVE|REQUEST_CHANGES>, codex=<APPROVE|REQUEST_CHANGES>, claude=<APPROVE|REQUEST_CHANGES>"
61
+ porch done <project-id>
90
62
  ```
91
63
 
92
- Then run `porch done <project-id>` to auto-request the `pr` gate. The PR surfaces
93
- in Needs Attention from this point; **STOP and wait** for the architect to call
94
- `porch approve <project-id> pr`. After gate approval, porch will emit a merge task
95
- (via the next `porch next` call) — follow it to merge the PR and advance to
96
- `verified`.
64
+ `porch done` fires the `pr` gate and surfaces the PR in Needs Attention. Wait for the architect to approve it (`porch approve <project-id> pr`) — a CMAP APPROVE is not merge authorization. After gate approval, follow the merge task from `porch next` to merge and advance to `verified`.
97
65
 
98
66
  ## Signals
99
67
 
100
- When PR is created and reviews are complete:
101
-
102
- ```
103
- <signal>PHASE_COMPLETE</signal>
104
- ```
105
-
106
- If you're blocked:
107
-
108
- ```
109
- <signal>BLOCKED:reason goes here</signal>
110
- ```
68
+ - PR created and reviews complete:
69
+ ```
70
+ <signal>PHASE_COMPLETE</signal>
71
+ ```
72
+ - Blocked:
73
+ ```
74
+ <signal>BLOCKED:reason goes here</signal>
75
+ ```