@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
@@ -2,9 +2,9 @@
2
2
 
3
3
  You are executing the **IMPLEMENT** phase of the SPIR protocol.
4
4
 
5
- ## Your Goal
5
+ ## Goal
6
6
 
7
- Write clean, well-structured code AND tests that implement the current plan phase.
7
+ Implement the current plan phase — code and tests — so it matches the spec and passes build and tests.
8
8
 
9
9
  ## Context
10
10
 
@@ -13,203 +13,34 @@ Write clean, well-structured code AND tests that implement the current plan phas
13
13
  - **Current State**: {{current_state}}
14
14
  - **Plan Phase**: {{plan_phase_id}} - {{plan_phase_title}}
15
15
 
16
- ## ⚠️ SCOPE RESTRICTION — READ THIS FIRST
16
+ ## Scope: this phase only
17
17
 
18
- **You are implementing ONLY the current plan phase: {{plan_phase_id}} ({{plan_phase_title}}).**
18
+ Your scope is exactly `{{plan_phase_id}}` ({{plan_phase_title}}), whose details are included below under "Current Plan Phase Details". Other phases are handled in later porch iterations — do not implement them, and do not read the full plan and build everything you see. Read `codev/specs/{{project_id}}-*.md` for requirements, but implement only what this phase requires.
19
19
 
20
- - **DO NOT** implement other phases. Other phases will be handled in subsequent porch iterations.
21
- - **DO NOT** read the full plan file and implement everything you see.
22
- - The plan phase details are included below under "Current Plan Phase Details". That is your ONLY scope.
23
- - If you need to reference the spec for requirements, read `codev/specs/{{project_id}}-*.md` but ONLY implement what the current phase requires.
20
+ When you signal `PHASE_COMPLETE`, porch runs the 3-way consultation, checks that tests exist and pass, and either respawns you with feedback or commits and moves to the next phase.
24
21
 
25
- ## What Happens After You Finish
22
+ ## What must be true when you finish
26
23
 
27
- When you signal `PHASE_COMPLETE`, porch will:
28
- 1. Run 3-way consultation (Gemini, Codex, Claude) on your implementation
29
- 2. Check that tests exist and pass
30
- 3. If reviewers request changes, you'll be respawned with their feedback
31
- 4. Once approved, porch commits and moves to the next plan phase
32
-
33
- ## Spec Compliance (CRITICAL)
34
-
35
- **The spec is the source of truth. Code that doesn't match the spec is wrong, even if it "works".**
36
-
37
- ### Trust Hierarchy
38
-
39
- ```
40
- SPEC (source of truth)
41
- ↓
42
- PLAN (implementation guide derived from spec)
43
- ↓
44
- EXISTING CODE (NOT TRUSTED - must be validated against spec)
45
- ```
46
-
47
- **Never trust existing code over the spec.** Previous implementations may have drifted.
48
-
49
- ### Pre-Implementation Sanity Check (PISC)
50
-
51
- **Before writing ANY code:**
52
-
53
- 1. ✅ "Have I read the spec in the last 30 minutes?"
54
- 2. ✅ "If the spec has a 'Traps to Avoid' section, have I read it?"
55
- 3. ✅ "Does my approach match the spec's Technical Implementation section?"
56
- 4. ✅ "If the spec has code examples, am I following them?"
57
- 5. ✅ "Does the existing code I'm building on actually match the spec?"
58
-
59
- **If ANY answer is "no" or "unsure" → STOP and re-read the spec.**
60
-
61
- ### Avoiding "Fixing Mode"
62
-
63
- A dangerous pattern: You start looking at symptoms in code, making incremental fixes, copying existing patterns - without going back to the spec. This leads to:
64
- - Cargo-culting patterns that may be wrong
65
- - Building on broken foundations
66
- - Implementing something different from the spec
67
-
68
- **When you catch yourself "fixing" code:**
69
- 1. STOP
70
- 2. Ask: "What does the spec say about this?"
71
- 3. Re-read the spec's Traps to Avoid section
72
- 4. Verify existing code matches the spec before building on it
73
-
74
- ## Prerequisites
75
-
76
- Before implementing, verify:
77
- 1. Previous phase (if any) is committed to git
78
- 2. You've read the plan phase you're implementing
79
- 3. You understand the success criteria for this phase
80
- 4. Dependencies from earlier phases are available
81
-
82
- ## Process
83
-
84
- ### 1. Review the Plan Phase
85
-
86
- Read the current phase in the plan:
87
- - What is the objective?
88
- - What files need to be created/modified?
89
- - What are the success criteria?
90
- - What dependencies exist?
91
-
92
- ### 2. Set Up
93
-
94
- - Verify you're on the correct branch
95
- - Check that previous phase is committed: `git log --oneline -5`
96
- - Ensure build passes before starting: `npm run build` (or equivalent)
97
-
98
- ### 3. Implement the Code
99
-
100
- Write the code following these principles:
101
-
102
- **Code Quality Standards**:
103
- - Self-documenting code (clear names, obvious structure)
104
- - No commented-out code
105
- - No debug prints in final code
106
- - Explicit error handling
107
- - Follow project style guide
108
-
109
- **Implementation Approach**:
110
- - Work on one file at a time
111
- - Make small, incremental changes
112
- - Document complex logic with comments
113
-
114
- ### 4. Write Tests
115
-
116
- **Tests are required.** For each piece of functionality you implement:
117
-
118
- - Write unit tests for core logic
119
- - Write integration tests if the phase involves multiple components
120
- - Test error cases and edge conditions
121
- - Ensure tests are deterministic (no flaky tests)
122
-
123
- **Test file locations** (follow project conventions):
124
- - `tests/` or `__tests__/` directories
125
- - `*.test.ts` or `*.spec.ts` naming
126
-
127
- ### 5. Verify Everything Works
128
-
129
- Run both build and tests:
130
-
131
- ```bash
132
- npm run build # Must pass
133
- npm test # Must pass
134
- ```
135
-
136
- **Important**: Don't assume these commands exist. Check `package.json` first.
137
-
138
- Fix any errors before signaling completion.
139
-
140
- ### 6. Self-Review
141
-
142
- Before signaling completion:
143
- - Read through all code changes
144
- - Read through all test changes
145
- - Verify code matches the spec requirements
146
- - Ensure no accidental debug code
147
- - Check test coverage is adequate
148
-
149
- ## Output
150
-
151
- When complete, you should have:
152
- - Modified/created source files as specified in the plan phase
153
- - Tests covering the new functionality
154
- - All build checks passing
155
- - All tests passing
24
+ - **The implementation matches the spec.** The spec is the source of truth; the plan derives from it; existing code is not trusted until validated against the spec, because earlier work may have drifted. Code that "works" but diverges from the spec is wrong. When you notice yourself patching symptoms in existing code, stop and re-check what the spec actually requires before building further.
25
+ - **Tests exist and are meaningful.** Unit tests for the core logic, integration tests where the phase spans components, and coverage of error and edge cases. Tests are deterministic. Follow the project's existing test locations and naming.
26
+ - **Build and tests pass.** Confirm the actual project commands (check `package.json` rather than assuming `npm run build` / `npm test` exist) and run them; fix failures before signaling.
27
+ - **The change is clean.** Self-documenting names, explicit error handling, no commented-out or debug code, only the files this phase touches — the simplest solution that satisfies the phase, not more.
156
28
 
157
29
  ## Signals
158
30
 
159
- When implementation AND tests are complete and passing:
160
-
161
- ```
162
- <signal>PHASE_COMPLETE</signal>
163
- ```
164
-
165
- If you encounter a blocker:
166
-
167
- ```
168
- <signal>BLOCKED:reason goes here</signal>
169
- ```
170
-
171
- If you need spec/plan clarification:
172
-
173
- ```
174
- <signal type=AWAITING_INPUT>
175
- Your specific questions here
176
- </signal>
177
- ```
178
-
179
- ## Important Notes
180
-
181
- 1. **Follow the plan** - Implement what's specified, not more
182
- 2. **Don't over-engineer** - Simplest solution that works
183
- 3. **Don't skip error handling** - But don't go overboard either
184
- 4. **Keep changes focused** - Only touch files in this phase
185
- 5. **Build AND tests must pass** - Don't signal complete until both pass
186
- 6. **Write tests** - Every implementation phase needs tests
187
-
188
- ## What NOT to Do
189
-
190
- - Don't modify files outside this phase's scope
191
- - Don't add features not in the spec
192
- - Don't leave TODO comments for later (fix now or note as blocker)
193
- - Don't skip writing tests
194
- - Don't use `git add .` or `git add -A` when you commit (security risk)
195
-
196
- ## Handling Problems
197
-
198
- **If the plan is unclear**:
199
- Signal `AWAITING_INPUT` with your specific question.
200
-
201
- **If you discover the spec is wrong**:
202
- Signal `BLOCKED` and explain the issue. The Architect may need to update the spec.
203
-
204
- **If a dependency is missing**:
205
- Signal `BLOCKED` with details about what's missing.
206
-
207
- **If build or tests fail and you can't fix it**:
208
- Signal `BLOCKED` with the error message.
209
-
210
- **If you encounter pre-existing flaky tests** (tests that fail intermittently but are unrelated to your changes):
211
- 1. **DO NOT** edit `status.yaml` to bypass checks
212
- 2. **DO NOT** skip porch checks or use workarounds to avoid the failure
213
- 3. **DO** mark the flaky test as skipped with a clear annotation (e.g., `it.skip('...') // FLAKY: intermittent timeout, skipped pending investigation`)
214
- 4. **DO** document each skipped flaky test in your review under a `## Flaky Tests` section so the team can follow up
215
- 5. Commit the skip and continue with your work
31
+ - Implementation and tests complete and passing:
32
+ ```
33
+ <signal>PHASE_COMPLETE</signal>
34
+ ```
35
+ - Blocked — the plan is wrong, the spec is wrong, a dependency is missing, or build/tests fail in a way you cannot resolve:
36
+ ```
37
+ <signal>BLOCKED:reason goes here</signal>
38
+ ```
39
+ - Need spec/plan clarification:
40
+ ```
41
+ <signal type=AWAITING_INPUT>
42
+ Your specific questions here
43
+ </signal>
44
+ ```
45
+
46
+ A blocker is a signal, not a silent workaround: never edit `status.yaml` or bypass a porch check to force a green.
@@ -2,9 +2,9 @@
2
2
 
3
3
  You are executing the **PLAN** phase of the SPIR protocol.
4
4
 
5
- ## Your Goal
5
+ ## Goal
6
6
 
7
- Transform the approved specification into an executable implementation plan with clear phases.
7
+ Turn the approved spec into an executable plan at `codev/plans/{{artifact_name}}.md`: a phase breakdown a builder can implement one phase at a time.
8
8
 
9
9
  ## Context
10
10
 
@@ -14,105 +14,41 @@ Transform the approved specification into an executable implementation plan with
14
14
  - **Spec File**: `codev/specs/{{artifact_name}}.md`
15
15
  - **Plan File**: `codev/plans/{{artifact_name}}.md`
16
16
 
17
- ## Prerequisites
17
+ ## What must be true when you finish
18
18
 
19
- Before planning, verify:
20
- 1. The specification exists and has been approved
21
- 2. You've read and understood the entire spec
22
- 3. Success criteria are clear and measurable
19
+ - **The plan derives from the spec.** You have read the whole spec — its functional and non-functional requirements, constraints, and success criteria — and the plan validates against them.
20
+ - **The work is decomposed into phases, each of which is:**
21
+ - **self-contained** — a complete unit of functionality;
22
+ - **independently testable** — verifiable on its own;
23
+ - **valuable** — delivers observable progress;
24
+ - **committable** — a single atomic commit.
23
25
 
24
- ## Process
25
-
26
- ### 1. Analyze the Specification
27
-
28
- Read the spec thoroughly. Identify:
29
- - All functional requirements
30
- - Non-functional requirements
31
- - Dependencies and constraints
32
- - Success criteria to validate against
33
-
34
- ### 2. Identify Implementation Phases
35
-
36
- Break the work into logical phases. Each phase should be:
37
- - **Self-contained** - A complete unit of functionality
38
- - **Independently testable** - Can be verified on its own
39
- - **Valuable** - Delivers observable progress
40
- - **Committable** - Can be a single atomic commit
41
-
42
- Good phase examples:
43
- - "Database Schema" - Creates all tables/migrations
44
- - "Core API Endpoints" - Implements main REST routes
45
- - "Authentication Flow" - Handles login/logout/session
46
-
47
- Bad phase examples:
48
- - "Setup" - Too vague
49
- - "Part 1" - Not descriptive
50
- - "Everything" - Not broken down
51
-
52
- ### 3. Define Each Phase
53
-
54
- For each phase, document:
55
- - **Objective** - Single clear goal
56
- - **Files to modify/create** - Specific paths
57
- - **Dependencies** - Which phases must complete first
58
- - **Success criteria** - How to know it's done
59
- - **Test approach** - What tests will verify it
60
-
61
- ### 4. Order Phases by Dependencies
62
-
63
- Arrange phases so dependencies are satisfied:
64
- ```
65
- Phase 1: Database Schema (no dependencies)
66
- Phase 2: Data Models (depends on Phase 1)
67
- Phase 3: API Endpoints (depends on Phase 2)
68
- Phase 4: Frontend Integration (depends on Phase 3)
69
- ```
70
-
71
- ### 5. Finalize
72
-
73
- After completing the plan draft, signal completion. Porch will run 3-way consultation (Gemini, Codex, Claude) automatically via the verify step. If reviewers request changes, you'll be respawned with their feedback.
26
+ A phase name states what it delivers ("Database schema", "Authentication flow"), not a position ("Setup", "Part 1").
27
+ - **Each phase carries its own contract:** objective, the specific files it creates or modifies, which earlier phases it depends on, its success criteria, and how it will be tested.
28
+ - **Phases are ordered so dependencies are satisfied before the phase that needs them.**
74
29
 
75
30
  ## Output
76
31
 
77
- Create the plan file at `codev/plans/{{artifact_name}}.md`, following the template below:
32
+ Write the plan to `codev/plans/{{artifact_name}}.md` using the template below as its interface:
78
33
 
79
34
  {{> protocols/spir/templates/plan.md}}
80
35
 
81
36
  ## Signals
82
37
 
83
- Emit appropriate signals based on your progress:
84
-
85
- - After completing the plan draft:
38
+ - Draft done:
86
39
  ```
87
40
  <signal>PLAN_DRAFTED</signal>
88
41
  ```
89
42
 
90
- ## Commit Cadence
43
+ ## Commit cadence
91
44
 
92
- Make commits at these milestones:
45
+ Commit at each milestone, staging the plan file explicitly:
46
+ ```bash
47
+ git add codev/plans/{{artifact_name}}.md
48
+ ```
93
49
  1. `[Spec {{project_id}}] Initial implementation plan`
94
50
  2. `[Spec {{project_id}}] Plan with multi-agent review`
95
51
  3. `[Spec {{project_id}}] Plan with user feedback`
96
52
  4. `[Spec {{project_id}}] Final approved plan`
97
53
 
98
- **CRITICAL**: Never use `git add .` or `git add -A`. Always stage specific files:
99
- ```bash
100
- git add codev/plans/{{artifact_name}}.md
101
- ```
102
-
103
- ## Important Notes
104
-
105
- 1. **No time estimates** - Don't include hours/days/weeks
106
- 3. **Be specific about files** - Exact paths, not "the config file"
107
- 4. **Keep phases small** - 1-3 files per phase is ideal
108
- 5. **Document dependencies clearly** - Prevents blocked work
109
-
110
- ## What NOT to Do
111
-
112
- - Don't run `consult` commands yourself (porch handles consultations)
113
- - Don't write code (that's for Implement phase)
114
- - Don't estimate time (meaningless in AI development)
115
- - Don't create phases that can't be independently tested
116
- - Don't skip dependency analysis
117
- - Don't make phases too large (if >5 files, split it)
118
- - Don't use `git add .` or `git add -A` (security risk)
54
+ Porch runs the 3-way consultation itself after you signal — do not run `consult`. This is the Plan phase: decompose and sequence the work, do not write code, and do not estimate time.
@@ -2,9 +2,9 @@
2
2
 
3
3
  You are executing the **REVIEW** phase of the SPIR protocol.
4
4
 
5
- ## Your Goal
5
+ ## Goal
6
6
 
7
- Perform a comprehensive review, document lessons learned, and prepare for PR submission.
7
+ Review the whole implementation, write the retrospective at `codev/reviews/{{artifact_name}}.md`, and open the PR — so porch's consultation and the architect both review a real PR.
8
8
 
9
9
  ## Context
10
10
 
@@ -15,264 +15,65 @@ Perform a comprehensive review, document lessons learned, and prepare for PR sub
15
15
  - **Plan File**: `codev/plans/{{artifact_name}}.md`
16
16
  - **Review File**: `codev/reviews/{{artifact_name}}.md`
17
17
 
18
- ## Prerequisites
18
+ ## What must be true when you finish
19
19
 
20
- Before review, verify:
21
- 1. All implementation phases are committed
22
- 2. All tests are passing
23
- 3. Build is passing
24
- 4. Spec compliance verified for all phases
20
+ - **The work is done and green.** All phases committed (`git log --oneline | grep "[Spec {{project_id}}]"`), build and tests passing, no uncommitted changes.
21
+ - **The implementation has been reviewed against the spec** — code quality, architecture fit, and security considered; deviations from the spec noted with their reasons; every success criterion accounted for.
22
+ - **The review document exists** at `codev/reviews/{{artifact_name}}.md`, following the template below (its headings, its order — do not pattern-match an older review that predates it).
23
+ - **Consultation feedback is captured.** The review carries a `## Consultation Feedback` section that, per phase / round / model, records each concern and its disposition — **Addressed** (changed), **Rebutted** (why it does not apply), or **N/A** (out of scope / handled elsewhere). "No concerns raised — all consultations approved" is the right line when that is true; note COMMENT verdicts and any `CONSULT_ERROR`. Read the consult outputs from `codev/projects/{{project_id}}-*/`.
24
+ - **Governance facts are routed by tier** (see below).
25
+ - **The PR exists before you signal**, with a close-keyword so merging auto-closes the issue (see below).
25
26
 
26
- Verify commits: `git log --oneline | grep "[Spec {{project_id}}]"`
27
-
28
- ## Process
29
-
30
- ### 1. Comprehensive Review
31
-
32
- Review the entire implementation:
33
-
34
- **Code Quality**:
35
- - Is the code readable and maintainable?
36
- - Are there any code smells?
37
- - Is error handling consistent?
38
- - Are there any security concerns?
39
-
40
- **Architecture**:
41
- - Does the implementation fit well with existing code?
42
- - Are there any architectural concerns?
43
- - Is the design scalable if needed?
44
-
45
- **Documentation**:
46
- - Is code adequately commented where needed?
47
- - Are public APIs documented?
48
- - Is README updated if needed?
49
-
50
- ### 2. Spec Comparison
51
-
52
- Compare final implementation to original specification:
53
-
54
- - What was delivered vs what was specified?
55
- - Any deviations? Document why.
56
- - All success criteria met?
57
-
58
- ### 3. Create Review Document
59
-
60
- Create `codev/reviews/{{artifact_name}}.md`:
61
-
62
- ```markdown
63
- # Review: {{title}}
64
-
65
- ## Summary
66
- Brief description of what was implemented.
67
-
68
- ## Spec Compliance
69
- - [x] Requirement 1: Implemented as specified
70
- - [x] Requirement 2: Implemented with deviation (see below)
71
- - [x] Requirement 3: Implemented as specified
72
-
73
- ## Deviations from Plan
74
- - **Phase X**: [What changed and why]
75
-
76
- ## Lessons Learned
77
-
78
- ### What Went Well
79
- - [Positive observation 1]
80
- - [Positive observation 2]
81
-
82
- ### Challenges Encountered
83
- - [Challenge 1]: [How it was resolved]
84
- - [Challenge 2]: [How it was resolved]
85
-
86
- ### What Would Be Done Differently
87
- - [Insight 1]
88
- - [Insight 2]
89
-
90
- ### Methodology Improvements
91
- - [Suggested improvement to SPIR protocol]
92
- - [Suggested improvement to tooling]
93
-
94
- ## Technical Debt
95
- - [Any shortcuts taken that should be addressed later]
96
-
97
- ## Consultation Feedback
98
-
99
- [See instructions below]
100
-
101
- ## Flaky Tests
102
- - [Any pre-existing tests that were skipped as flaky during this project]
103
- - [Include test name, file path, and observed failure mode]
104
- - [If none: "No flaky tests encountered"]
105
-
106
- ## Follow-up Items
107
- - [Any items identified for future work]
108
- ```
109
-
110
- ### 3b. Include Consultation Feedback
111
-
112
- **IMPORTANT**: The review document MUST include a `## Consultation Feedback` section that summarizes all consultation concerns raised during every phase of the project and how the builder responded.
113
-
114
- Read the consultation output files from the project directory (`codev/projects/{project-id}-*/`). For each phase that had consultation, create a subsection organized by phase, round, and model:
115
-
116
- ```markdown
117
- ## Consultation Feedback
118
-
119
- ### Specify Phase (Round 1)
120
-
121
- #### Gemini
122
- - **Concern**: [Summary of the concern]
123
- - **Addressed**: [What was changed to resolve it]
124
-
125
- #### Codex
126
- - **Concern**: [Summary]
127
- - **Rebutted**: [Why the current approach is correct]
128
-
129
- #### Claude
130
- - No concerns raised (APPROVE)
131
-
132
- ### Plan Phase (Round 1)
133
- ...
134
- ```
135
-
136
- **Response types** — each concern gets exactly one:
137
- - **Addressed**: Builder made a change to resolve the concern
138
- - **Rebutted**: Builder explains why the concern doesn't apply
139
- - **N/A**: Concern is out of scope, already handled elsewhere, or moot
140
-
141
- **Edge cases**:
142
- - If all reviewers approved with no concerns: "No concerns raised — all consultations approved"
143
- - For COMMENT verdicts: include their feedback (non-blocking but useful context)
144
- - For CONSULT_ERROR (model failure): note "Consultation failed for [model]"
145
- - If a phase had multiple rounds, give each round its own subsection
146
-
147
- ### 4. Update Architecture and Lessons Learned Documentation
148
-
149
- **MANDATORY**: The review document MUST include `## Architecture Updates` and `## Lessons Learned Updates` sections. Porch will block advancement if these are missing.
150
-
151
- Each governance doc has **two tiers** (Spec 987) — **route** each new fact/lesson to the right tier; do **not** just append to the cold archive:
152
- - **HOT** — `codev/resources/arch-critical.md` / `lessons-critical.md`: tiny, **hard-capped**, **always injected** into every prompt and into CLAUDE.md/AGENTS.md. The behavior-changer.
153
- - **COLD** — `codev/resources/arch.md` / `lessons-learned.md`: full, on-demand reference.
154
-
155
- **Architecture Updates**:
156
- 1. Read `arch-critical.md` (hot) and skim `arch.md` (cold).
157
- 2. If this project produced a system-shape fact, route it:
158
- - **Behavior-changing + cross-cutting** (an invariant/decision a future builder must know up front) → add to **`arch-critical.md`**. Respect the cap: if the hot file is full, **demote** a weaker entry into `arch.md` to make room. If you add/rename a top-level `arch.md` section, keep the hot file's cold-doc map accurate.
159
- - **Reference detail** (subsystem mechanism, file location, one-off) → add to **`arch.md`** (cold).
160
- 3. Describe what you routed where in the `## Architecture Updates` section. If nothing qualifies: write "No architecture updates needed" with a brief reason.
161
-
162
- **Lessons Learned Updates**:
163
- 1. Read `lessons-critical.md` (hot) and skim `lessons-learned.md` (cold).
164
- 2. If this project produced a durable lesson, route it:
165
- - **Behavior-changing + cross-cutting** (a rule that should change how the next project is built) → add to **`lessons-critical.md`**, respecting the cap (demote a weaker entry into `lessons-learned.md` if full).
166
- - **Spec-narrow recipe / reference tip** → add to **`lessons-learned.md`** (cold). Spec-narrow recipes belong in the cold archive, never the always-on hot file.
167
- 3. Describe what you routed where in the `## Lessons Learned Updates` section. If nothing qualifies: write "No lessons learned updates needed" with a brief reason.
168
-
169
- **Never** grow a hot file past its cap by appending — route to cold or displace. The cap is what keeps the hot tier cheap enough to always inject.
27
+ ## Output
170
28
 
171
- ### 4b. Update Other Documentation
29
+ Write the review to `codev/reviews/{{artifact_name}}.md` using the template below as its interface. Steps below expand its `## Consultation Feedback`, `## Architecture Updates`, and `## Lessons Learned Updates` sections; porch greps the produced file for the last two by exact heading.
172
30
 
173
- If needed, also update:
174
- - README.md (new features, changed behavior)
175
- - API documentation
31
+ {{> protocols/spir/templates/review.md}}
176
32
 
177
- ### 5. Final Verification
33
+ ## Route governance facts by tier (Spec 987)
178
34
 
179
- Before PR:
180
- - [ ] All tests pass (use project-specific test command)
181
- - [ ] Build passes (use project-specific build command)
182
- - [ ] Lint passes (if configured)
183
- - [ ] No uncommitted changes: `git status`
184
- - [ ] Review document complete
35
+ Each governance doc has two tiers. **Route** each new fact; do not simply append to the cold archive.
185
36
 
186
- ### 6. Create Pull Request
37
+ - **HOT** — `codev/resources/arch-critical.md` and `lessons-critical.md`: tiny, hard-capped, always injected into every prompt and into CLAUDE.md/AGENTS.md. Add here only a **behavior-changing, cross-cutting** fact a future builder must know up front. The hot files are capped: if one is full, **demote** a weaker entry into its cold counterpart to make room, and keep the hot file's cold-doc map accurate.
38
+ - **COLD** — `codev/resources/arch.md` and `lessons-learned.md`: full, on-demand reference for subsystem detail, file locations, one-offs, and spec-narrow recipes.
187
39
 
188
- **IMPORTANT: Create the PR BEFORE signaling completion.** The PR must exist so that
189
- porch consultation reviews the actual PR, and the architect can review a real PR
190
- when the pr gate fires.
40
+ The review's `## Architecture Updates` and `## Lessons Learned Updates` sections state what you routed where; if nothing qualifies, keep the heading with a one-line reason. Never grow a hot file past its cap by appending — route to cold or displace. The `update-arch-docs` skill encodes this discipline.
191
41
 
192
- **PR body requirements**: The PR body MUST include `Closes #<N>` (for feature issues)
193
- or `Fixes #<N>` (for bug issues) for the driving GitHub issue. If the PR closes
194
- multiple issues (e.g. duplicates consolidated), include one keyword per issue.
195
- Without this, GitHub will not auto-close the issue on merge.
42
+ ## Create the PR (before signaling)
196
43
 
197
- **Exception**: if this PR only partially addresses the issue (e.g. one phase of a
198
- multi-PR effort), DO NOT use `Closes`/`Fixes` — reference the issue with `Refs #<N>`
199
- or `Part of #<N>` instead. The issue stays open until the follow-up PR closes it.
44
+ The PR body must carry `Closes #<N>` (feature) or `Fixes #<N>` (bug) for the driving issue — one keyword per issue if several — so GitHub auto-closes on merge. **Exception:** a PR that only partially addresses its issue uses `Refs #<N>` or `Part of #<N>` instead, leaving the issue open for the follow-up.
200
45
 
201
46
  ```bash
202
47
  gh pr create --title "[Spec {{project_id}}] {{title}}" --body "$(cat <<'EOF'
203
48
  ## Summary
204
- [Brief description of the implementation]
49
+ [what was implemented]
205
50
 
206
- Closes #<N> <!-- Replace <N> with the driving issue number, or use "Refs #<N>" for partial fixes -->
51
+ Closes #<N> <!-- driving issue; use "Refs #<N>" for a partial fix -->
207
52
 
208
53
  ## Changes
209
- - [Change 1]
210
- - [Change 2]
54
+ - ...
211
55
 
212
56
  ## Testing
213
- - All unit tests passing
214
- - Integration tests added for [X]
215
- - Manual testing completed for [Y]
57
+ - ...
216
58
 
217
59
  ## Spec
218
- Link: codev/specs/{{artifact_name}}.md
60
+ codev/specs/{{artifact_name}}.md
219
61
 
220
62
  ## Review
221
- Link: codev/reviews/{{artifact_name}}.md
63
+ codev/reviews/{{artifact_name}}.md
222
64
  EOF
223
65
  )"
224
66
  ```
225
67
 
226
- ### 7. Signal Completion
227
-
228
- After the PR is created, signal completion. Porch will run 3-way consultation
229
- (Gemini, Codex, Claude) automatically via the verify step. If reviewers request
230
- changes, you'll be respawned with their feedback.
231
-
232
- ## Output
233
-
234
- - Review document at `codev/reviews/{{artifact_name}}.md`
235
- - Updated documentation (if needed)
236
- - Pull request created and ready for review
237
-
238
68
  ## Signals
239
69
 
240
- - After review document is complete:
70
+ - Review document complete:
241
71
  ```
242
72
  <signal>REVIEW_COMPLETE</signal>
243
73
  ```
244
-
245
- - After PR is created — signal completion so porch runs consultation:
74
+ - PR created — signal so porch runs the 3-way consultation:
246
75
  ```
247
76
  <signal>PR_READY</signal>
248
77
  ```
249
78
 
250
- ## Important Notes
251
-
252
- 1. **Be honest in lessons learned** - Future you will thank present you
253
- 3. **Document deviations** - They're not failures, they're learnings
254
- 4. **Update methodology** - If you found a better way, document it
255
- 5. **Don't skip the checklist** - It catches last-minute issues
256
- 6. **Clean PR description** - Makes review easier
257
-
258
- ## What NOT to Do
259
-
260
- - Don't run `consult` commands yourself (porch handles consultations)
261
- - Don't skip lessons learned ("nothing to report")
262
- - Don't merge your own PR (Architect handles integration)
263
- - Don't leave uncommitted changes
264
- - Don't forget to update documentation
265
- - Don't rush this phase - it's valuable for learning
266
- - Don't use `git add .` or `git add -A` (security risk)
267
-
268
- ## Review Prompts for Reflection
269
-
270
- Ask yourself:
271
- - What surprised me during implementation?
272
- - Where did I spend the most time? Was it avoidable?
273
- - What would have helped me go faster?
274
- - Did the spec adequately describe what was needed?
275
- - Did the plan phases make sense in hindsight?
276
- - What tests caught issues? What tests were unnecessary?
277
-
278
- Capture these reflections in the lessons learned section.
79
+ Do not run `consult` (porch handles it) and merge your own PR only after the human approves the `pr` gate — never before.