@cluesmith/codev 3.2.3 → 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 (445) 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 +173 -0
  7. package/dist/agent-farm/cli.js.map +1 -1
  8. package/dist/agent-farm/commands/attach.js +2 -2
  9. package/dist/agent-farm/commands/attach.js.map +1 -1
  10. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
  11. package/dist/agent-farm/commands/cleanup.js +16 -0
  12. package/dist/agent-farm/commands/cleanup.js.map +1 -1
  13. package/dist/agent-farm/commands/inbox.d.ts +42 -0
  14. package/dist/agent-farm/commands/inbox.d.ts.map +1 -0
  15. package/dist/agent-farm/commands/inbox.js +129 -0
  16. package/dist/agent-farm/commands/inbox.js.map +1 -0
  17. package/dist/agent-farm/commands/interrupt.d.ts +20 -0
  18. package/dist/agent-farm/commands/interrupt.d.ts.map +1 -0
  19. package/dist/agent-farm/commands/interrupt.js +65 -0
  20. package/dist/agent-farm/commands/interrupt.js.map +1 -0
  21. package/dist/agent-farm/commands/reset/constants.d.ts +52 -0
  22. package/dist/agent-farm/commands/reset/constants.d.ts.map +1 -0
  23. package/dist/agent-farm/commands/reset/constants.js +52 -0
  24. package/dist/agent-farm/commands/reset/constants.js.map +1 -0
  25. package/dist/agent-farm/commands/reset/context.d.ts +230 -0
  26. package/dist/agent-farm/commands/reset/context.d.ts.map +1 -0
  27. package/dist/agent-farm/commands/reset/context.js +428 -0
  28. package/dist/agent-farm/commands/reset/context.js.map +1 -0
  29. package/dist/agent-farm/commands/reset/index.d.ts +192 -0
  30. package/dist/agent-farm/commands/reset/index.d.ts.map +1 -0
  31. package/dist/agent-farm/commands/reset/index.js +488 -0
  32. package/dist/agent-farm/commands/reset/index.js.map +1 -0
  33. package/dist/agent-farm/commands/reset/receipt.d.ts +97 -0
  34. package/dist/agent-farm/commands/reset/receipt.d.ts.map +1 -0
  35. package/dist/agent-farm/commands/reset/receipt.js +149 -0
  36. package/dist/agent-farm/commands/reset/receipt.js.map +1 -0
  37. package/dist/agent-farm/commands/reset/reorient.d.ts +117 -0
  38. package/dist/agent-farm/commands/reset/reorient.d.ts.map +1 -0
  39. package/dist/agent-farm/commands/reset/reorient.js +313 -0
  40. package/dist/agent-farm/commands/reset/reorient.js.map +1 -0
  41. package/dist/agent-farm/commands/reset.d.ts +19 -0
  42. package/dist/agent-farm/commands/reset.d.ts.map +1 -0
  43. package/dist/agent-farm/commands/reset.js +292 -0
  44. package/dist/agent-farm/commands/reset.js.map +1 -0
  45. package/dist/agent-farm/commands/send.d.ts +2 -2
  46. package/dist/agent-farm/commands/send.d.ts.map +1 -1
  47. package/dist/agent-farm/commands/send.js +52 -11
  48. package/dist/agent-farm/commands/send.js.map +1 -1
  49. package/dist/agent-farm/commands/setup.d.ts +4 -1
  50. package/dist/agent-farm/commands/setup.d.ts.map +1 -1
  51. package/dist/agent-farm/commands/setup.js +8 -4
  52. package/dist/agent-farm/commands/setup.js.map +1 -1
  53. package/dist/agent-farm/commands/spawn-worktree.d.ts +116 -6
  54. package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
  55. package/dist/agent-farm/commands/spawn-worktree.js +345 -74
  56. package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
  57. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  58. package/dist/agent-farm/commands/spawn.js +13 -1
  59. package/dist/agent-farm/commands/spawn.js.map +1 -1
  60. package/dist/agent-farm/commands/status.d.ts.map +1 -1
  61. package/dist/agent-farm/commands/status.js +105 -9
  62. package/dist/agent-farm/commands/status.js.map +1 -1
  63. package/dist/agent-farm/commands/tower-sweep-husks.d.ts +6 -0
  64. package/dist/agent-farm/commands/tower-sweep-husks.d.ts.map +1 -0
  65. package/dist/agent-farm/commands/tower-sweep-husks.js +77 -0
  66. package/dist/agent-farm/commands/tower-sweep-husks.js.map +1 -0
  67. package/dist/agent-farm/commands/tower.d.ts.map +1 -1
  68. package/dist/agent-farm/commands/tower.js +34 -0
  69. package/dist/agent-farm/commands/tower.js.map +1 -1
  70. package/dist/agent-farm/commands/whoami.d.ts +65 -0
  71. package/dist/agent-farm/commands/whoami.d.ts.map +1 -0
  72. package/dist/agent-farm/commands/whoami.js +196 -0
  73. package/dist/agent-farm/commands/whoami.js.map +1 -0
  74. package/dist/agent-farm/db/index.d.ts +1 -1
  75. package/dist/agent-farm/db/index.d.ts.map +1 -1
  76. package/dist/agent-farm/db/index.js +80 -1
  77. package/dist/agent-farm/db/index.js.map +1 -1
  78. package/dist/agent-farm/db/mailbox.d.ts +222 -0
  79. package/dist/agent-farm/db/mailbox.d.ts.map +1 -0
  80. package/dist/agent-farm/db/mailbox.js +304 -0
  81. package/dist/agent-farm/db/mailbox.js.map +1 -0
  82. package/dist/agent-farm/db/schema.d.ts +1 -1
  83. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  84. package/dist/agent-farm/db/schema.js +35 -0
  85. package/dist/agent-farm/db/schema.js.map +1 -1
  86. package/dist/agent-farm/db/types.d.ts +45 -0
  87. package/dist/agent-farm/db/types.d.ts.map +1 -1
  88. package/dist/agent-farm/db/types.js.map +1 -1
  89. package/dist/agent-farm/lib/builder-lookup.d.ts +1 -1
  90. package/dist/agent-farm/lib/builder-lookup.js +2 -2
  91. package/dist/agent-farm/lib/builder-lookup.js.map +1 -1
  92. package/dist/agent-farm/lib/reconnect-backoff.d.ts +54 -0
  93. package/dist/agent-farm/lib/reconnect-backoff.d.ts.map +1 -0
  94. package/dist/agent-farm/lib/reconnect-backoff.js +47 -0
  95. package/dist/agent-farm/lib/reconnect-backoff.js.map +1 -0
  96. package/dist/agent-farm/lib/tower-client.d.ts +16 -6
  97. package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
  98. package/dist/agent-farm/lib/tower-client.js +37 -6
  99. package/dist/agent-farm/lib/tower-client.js.map +1 -1
  100. package/dist/agent-farm/lib/tunnel-client.d.ts +69 -1
  101. package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -1
  102. package/dist/agent-farm/lib/tunnel-client.js +218 -27
  103. package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
  104. package/dist/agent-farm/servers/architect-session-holder.d.ts +133 -0
  105. package/dist/agent-farm/servers/architect-session-holder.d.ts.map +1 -0
  106. package/dist/agent-farm/servers/architect-session-holder.js +268 -0
  107. package/dist/agent-farm/servers/architect-session-holder.js.map +1 -0
  108. package/dist/agent-farm/servers/cron-delivery.d.ts +72 -0
  109. package/dist/agent-farm/servers/cron-delivery.d.ts.map +1 -0
  110. package/dist/agent-farm/servers/cron-delivery.js +80 -0
  111. package/dist/agent-farm/servers/cron-delivery.js.map +1 -0
  112. package/dist/agent-farm/servers/delayed-send.d.ts +85 -0
  113. package/dist/agent-farm/servers/delayed-send.d.ts.map +1 -0
  114. package/dist/agent-farm/servers/delayed-send.js +165 -0
  115. package/dist/agent-farm/servers/delayed-send.js.map +1 -0
  116. package/dist/agent-farm/servers/gate-profiles.d.ts +67 -0
  117. package/dist/agent-farm/servers/gate-profiles.d.ts.map +1 -0
  118. package/dist/agent-farm/servers/gate-profiles.js +113 -0
  119. package/dist/agent-farm/servers/gate-profiles.js.map +1 -0
  120. package/dist/agent-farm/servers/mailbox-delivery.d.ts +370 -0
  121. package/dist/agent-farm/servers/mailbox-delivery.d.ts.map +1 -0
  122. package/dist/agent-farm/servers/mailbox-delivery.js +617 -0
  123. package/dist/agent-farm/servers/mailbox-delivery.js.map +1 -0
  124. package/dist/agent-farm/servers/mailbox-wiring.d.ts +125 -0
  125. package/dist/agent-farm/servers/mailbox-wiring.d.ts.map +1 -0
  126. package/dist/agent-farm/servers/mailbox-wiring.js +425 -0
  127. package/dist/agent-farm/servers/mailbox-wiring.js.map +1 -0
  128. package/dist/agent-farm/servers/message-write.d.ts +53 -1
  129. package/dist/agent-farm/servers/message-write.d.ts.map +1 -1
  130. package/dist/agent-farm/servers/message-write.js +63 -0
  131. package/dist/agent-farm/servers/message-write.js.map +1 -1
  132. package/dist/agent-farm/servers/overview.d.ts.map +1 -1
  133. package/dist/agent-farm/servers/overview.js +23 -4
  134. package/dist/agent-farm/servers/overview.js.map +1 -1
  135. package/dist/agent-farm/servers/process-census.d.ts +41 -0
  136. package/dist/agent-farm/servers/process-census.d.ts.map +1 -0
  137. package/dist/agent-farm/servers/process-census.js +62 -0
  138. package/dist/agent-farm/servers/process-census.js.map +1 -0
  139. package/dist/agent-farm/servers/render-gate.d.ts +141 -0
  140. package/dist/agent-farm/servers/render-gate.d.ts.map +1 -0
  141. package/dist/agent-farm/servers/render-gate.js +251 -0
  142. package/dist/agent-farm/servers/render-gate.js.map +1 -0
  143. package/dist/agent-farm/servers/session-log-sweep.d.ts +93 -0
  144. package/dist/agent-farm/servers/session-log-sweep.d.ts.map +1 -0
  145. package/dist/agent-farm/servers/session-log-sweep.js +165 -0
  146. package/dist/agent-farm/servers/session-log-sweep.js.map +1 -0
  147. package/dist/agent-farm/servers/session-submit.d.ts +90 -0
  148. package/dist/agent-farm/servers/session-submit.d.ts.map +1 -0
  149. package/dist/agent-farm/servers/session-submit.js +127 -0
  150. package/dist/agent-farm/servers/session-submit.js.map +1 -0
  151. package/dist/agent-farm/servers/shellper-husk-sweep.d.ts +87 -0
  152. package/dist/agent-farm/servers/shellper-husk-sweep.d.ts.map +1 -0
  153. package/dist/agent-farm/servers/shellper-husk-sweep.js +129 -0
  154. package/dist/agent-farm/servers/shellper-husk-sweep.js.map +1 -0
  155. package/dist/agent-farm/servers/tower-cron.d.ts +10 -7
  156. package/dist/agent-farm/servers/tower-cron.d.ts.map +1 -1
  157. package/dist/agent-farm/servers/tower-cron.js +58 -53
  158. package/dist/agent-farm/servers/tower-cron.js.map +1 -1
  159. package/dist/agent-farm/servers/tower-instances.d.ts +14 -2
  160. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
  161. package/dist/agent-farm/servers/tower-instances.js +128 -19
  162. package/dist/agent-farm/servers/tower-instances.js.map +1 -1
  163. package/dist/agent-farm/servers/tower-messages.d.ts +38 -1
  164. package/dist/agent-farm/servers/tower-messages.d.ts.map +1 -1
  165. package/dist/agent-farm/servers/tower-messages.js +106 -1
  166. package/dist/agent-farm/servers/tower-messages.js.map +1 -1
  167. package/dist/agent-farm/servers/tower-routes.d.ts +16 -4
  168. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
  169. package/dist/agent-farm/servers/tower-routes.js +807 -99
  170. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  171. package/dist/agent-farm/servers/tower-server.js +241 -15
  172. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  173. package/dist/agent-farm/servers/tower-terminals.d.ts +17 -2
  174. package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
  175. package/dist/agent-farm/servers/tower-terminals.js +139 -124
  176. package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
  177. package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -1
  178. package/dist/agent-farm/servers/tower-tunnel.js +63 -4
  179. package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
  180. package/dist/agent-farm/servers/tower-types.d.ts +2 -1
  181. package/dist/agent-farm/servers/tower-types.d.ts.map +1 -1
  182. package/dist/agent-farm/servers/tower-utils.d.ts +99 -1
  183. package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
  184. package/dist/agent-farm/servers/tower-utils.js +242 -6
  185. package/dist/agent-farm/servers/tower-utils.js.map +1 -1
  186. package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
  187. package/dist/agent-farm/servers/tower-websocket.js +6 -21
  188. package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
  189. package/dist/agent-farm/servers/write-queue.d.ts +35 -0
  190. package/dist/agent-farm/servers/write-queue.d.ts.map +1 -0
  191. package/dist/agent-farm/servers/write-queue.js +56 -0
  192. package/dist/agent-farm/servers/write-queue.js.map +1 -0
  193. package/dist/agent-farm/state.d.ts +6 -1
  194. package/dist/agent-farm/state.d.ts.map +1 -1
  195. package/dist/agent-farm/state.js +5 -2
  196. package/dist/agent-farm/state.js.map +1 -1
  197. package/dist/agent-farm/types.d.ts +39 -0
  198. package/dist/agent-farm/types.d.ts.map +1 -1
  199. package/dist/agent-farm/utils/agent-names.d.ts +2 -2
  200. package/dist/agent-farm/utils/agent-names.d.ts.map +1 -1
  201. package/dist/agent-farm/utils/agent-names.js +3 -3
  202. package/dist/agent-farm/utils/agent-names.js.map +1 -1
  203. package/dist/agent-farm/utils/architect-name.d.ts +2 -2
  204. package/dist/agent-farm/utils/architect-name.d.ts.map +1 -1
  205. package/dist/agent-farm/utils/architect-name.js +3 -3
  206. package/dist/agent-farm/utils/architect-name.js.map +1 -1
  207. package/dist/agent-farm/utils/config.d.ts +13 -0
  208. package/dist/agent-farm/utils/config.d.ts.map +1 -1
  209. package/dist/agent-farm/utils/config.js +33 -1
  210. package/dist/agent-farm/utils/config.js.map +1 -1
  211. package/dist/agent-farm/utils/harness.d.ts +103 -7
  212. package/dist/agent-farm/utils/harness.d.ts.map +1 -1
  213. package/dist/agent-farm/utils/harness.js +126 -19
  214. package/dist/agent-farm/utils/harness.js.map +1 -1
  215. package/dist/cli.d.ts.map +1 -1
  216. package/dist/cli.js +6 -32
  217. package/dist/cli.js.map +1 -1
  218. package/dist/commands/adopt.d.ts +3 -2
  219. package/dist/commands/adopt.d.ts.map +1 -1
  220. package/dist/commands/adopt.js +7 -6
  221. package/dist/commands/adopt.js.map +1 -1
  222. package/dist/commands/consult/agy-auth-cache.d.ts +97 -0
  223. package/dist/commands/consult/agy-auth-cache.d.ts.map +1 -0
  224. package/dist/commands/consult/agy-auth-cache.js +320 -0
  225. package/dist/commands/consult/agy-auth-cache.js.map +1 -0
  226. package/dist/commands/consult/cli-options.d.ts +34 -0
  227. package/dist/commands/consult/cli-options.d.ts.map +1 -0
  228. package/dist/commands/consult/cli-options.js +67 -0
  229. package/dist/commands/consult/cli-options.js.map +1 -0
  230. package/dist/commands/consult/index.d.ts +56 -2
  231. package/dist/commands/consult/index.d.ts.map +1 -1
  232. package/dist/commands/consult/index.js +330 -27
  233. package/dist/commands/consult/index.js.map +1 -1
  234. package/dist/commands/consult/metrics.d.ts +42 -0
  235. package/dist/commands/consult/metrics.d.ts.map +1 -1
  236. package/dist/commands/consult/metrics.js +129 -9
  237. package/dist/commands/consult/metrics.js.map +1 -1
  238. package/dist/commands/doctor.d.ts +28 -0
  239. package/dist/commands/doctor.d.ts.map +1 -1
  240. package/dist/commands/doctor.js +258 -22
  241. package/dist/commands/doctor.js.map +1 -1
  242. package/dist/commands/init.d.ts +3 -2
  243. package/dist/commands/init.d.ts.map +1 -1
  244. package/dist/commands/init.js +7 -6
  245. package/dist/commands/init.js.map +1 -1
  246. package/dist/commands/porch/checks.d.ts +23 -0
  247. package/dist/commands/porch/checks.d.ts.map +1 -1
  248. package/dist/commands/porch/checks.js +60 -0
  249. package/dist/commands/porch/checks.js.map +1 -1
  250. package/dist/commands/porch/config.d.ts +20 -0
  251. package/dist/commands/porch/config.d.ts.map +1 -1
  252. package/dist/commands/porch/config.js +20 -0
  253. package/dist/commands/porch/config.js.map +1 -1
  254. package/dist/commands/porch/index.d.ts.map +1 -1
  255. package/dist/commands/porch/index.js +32 -36
  256. package/dist/commands/porch/index.js.map +1 -1
  257. package/dist/commands/porch/next.d.ts.map +1 -1
  258. package/dist/commands/porch/next.js +2 -41
  259. package/dist/commands/porch/next.js.map +1 -1
  260. package/dist/commands/update.d.ts +4 -4
  261. package/dist/commands/update.d.ts.map +1 -1
  262. package/dist/commands/update.js +9 -11
  263. package/dist/commands/update.js.map +1 -1
  264. package/dist/lib/config.d.ts +70 -3
  265. package/dist/lib/config.d.ts.map +1 -1
  266. package/dist/lib/config.js +67 -3
  267. package/dist/lib/config.js.map +1 -1
  268. package/dist/lib/consult-lanes.d.ts +149 -0
  269. package/dist/lib/consult-lanes.d.ts.map +1 -0
  270. package/dist/lib/consult-lanes.js +360 -0
  271. package/dist/lib/consult-lanes.js.map +1 -0
  272. package/dist/lib/default-branch.d.ts +1 -1
  273. package/dist/lib/default-branch.js +1 -1
  274. package/dist/lib/github.js +1 -1
  275. package/dist/lib/github.js.map +1 -1
  276. package/dist/lib/gitignore.d.ts +25 -2
  277. package/dist/lib/gitignore.d.ts.map +1 -1
  278. package/dist/lib/gitignore.js +70 -0
  279. package/dist/lib/gitignore.js.map +1 -1
  280. package/dist/lib/migration-backup-audit.d.ts +64 -0
  281. package/dist/lib/migration-backup-audit.d.ts.map +1 -0
  282. package/dist/lib/migration-backup-audit.js +145 -0
  283. package/dist/lib/migration-backup-audit.js.map +1 -0
  284. package/dist/lib/prompt-behavior-metrics.d.ts +67 -0
  285. package/dist/lib/prompt-behavior-metrics.d.ts.map +1 -0
  286. package/dist/lib/prompt-behavior-metrics.js +290 -0
  287. package/dist/lib/prompt-behavior-metrics.js.map +1 -0
  288. package/dist/lib/protocol-drift-audit.d.ts +118 -0
  289. package/dist/lib/protocol-drift-audit.d.ts.map +1 -0
  290. package/dist/lib/protocol-drift-audit.js +217 -0
  291. package/dist/lib/protocol-drift-audit.js.map +1 -0
  292. package/dist/lib/scaffold.d.ts +10 -3
  293. package/dist/lib/scaffold.d.ts.map +1 -1
  294. package/dist/lib/scaffold.js +29 -26
  295. package/dist/lib/scaffold.js.map +1 -1
  296. package/dist/lib/skeleton.d.ts +22 -1
  297. package/dist/lib/skeleton.d.ts.map +1 -1
  298. package/dist/lib/skeleton.js +120 -0
  299. package/dist/lib/skeleton.js.map +1 -1
  300. package/dist/lib/test-env.d.ts +74 -0
  301. package/dist/lib/test-env.d.ts.map +1 -0
  302. package/dist/lib/test-env.js +92 -0
  303. package/dist/lib/test-env.js.map +1 -0
  304. package/dist/terminal/pty-manager.d.ts +9 -0
  305. package/dist/terminal/pty-manager.d.ts.map +1 -1
  306. package/dist/terminal/pty-manager.js +32 -6
  307. package/dist/terminal/pty-manager.js.map +1 -1
  308. package/dist/terminal/pty-session.d.ts +156 -4
  309. package/dist/terminal/pty-session.d.ts.map +1 -1
  310. package/dist/terminal/pty-session.js +307 -42
  311. package/dist/terminal/pty-session.js.map +1 -1
  312. package/dist/terminal/ring-buffer.d.ts +39 -6
  313. package/dist/terminal/ring-buffer.d.ts.map +1 -1
  314. package/dist/terminal/ring-buffer.js +74 -6
  315. package/dist/terminal/ring-buffer.js.map +1 -1
  316. package/dist/terminal/session-manager.d.ts +129 -0
  317. package/dist/terminal/session-manager.d.ts.map +1 -1
  318. package/dist/terminal/session-manager.js +337 -44
  319. package/dist/terminal/session-manager.js.map +1 -1
  320. package/dist/terminal/session-screen.d.ts +91 -0
  321. package/dist/terminal/session-screen.d.ts.map +1 -0
  322. package/dist/terminal/session-screen.js +135 -0
  323. package/dist/terminal/session-screen.js.map +1 -0
  324. package/dist/terminal/shellper-client.d.ts +19 -4
  325. package/dist/terminal/shellper-client.d.ts.map +1 -1
  326. package/dist/terminal/shellper-client.js +70 -8
  327. package/dist/terminal/shellper-client.js.map +1 -1
  328. package/dist/terminal/shellper-main.js +2 -1
  329. package/dist/terminal/shellper-main.js.map +1 -1
  330. package/dist/terminal/shellper-process.d.ts +1 -1
  331. package/dist/terminal/shellper-process.d.ts.map +1 -1
  332. package/dist/terminal/shellper-process.js +33 -9
  333. package/dist/terminal/shellper-process.js.map +1 -1
  334. package/dist/terminal/shellper-protocol.d.ts +40 -2
  335. package/dist/terminal/shellper-protocol.d.ts.map +1 -1
  336. package/dist/terminal/shellper-protocol.js +72 -5
  337. package/dist/terminal/shellper-protocol.js.map +1 -1
  338. package/dist/terminal/shellper-replay-buffer.d.ts +69 -7
  339. package/dist/terminal/shellper-replay-buffer.d.ts.map +1 -1
  340. package/dist/terminal/shellper-replay-buffer.js +167 -31
  341. package/dist/terminal/shellper-replay-buffer.js.map +1 -1
  342. package/package.json +11 -9
  343. package/skeleton/.claude/skills/afx/SKILL.md +27 -1
  344. package/skeleton/.claude/skills/arch-init/SKILL.md +135 -0
  345. package/skeleton/.claude/skills/arch-save/SKILL.md +183 -0
  346. package/skeleton/.claude/skills/codev/SKILL.md +33 -2
  347. package/skeleton/.claude/skills/runnable-worktrees/SKILL.md +119 -0
  348. package/skeleton/.codex/skills/afx/SKILL.md +170 -0
  349. package/skeleton/.codex/skills/arch-init/SKILL.md +135 -0
  350. package/skeleton/.codex/skills/arch-save/SKILL.md +183 -0
  351. package/skeleton/.codex/skills/codev/SKILL.md +90 -0
  352. package/skeleton/.codex/skills/consult/SKILL.md +96 -0
  353. package/skeleton/.codex/skills/generate-image/SKILL.md +45 -0
  354. package/skeleton/.codex/skills/porch/SKILL.md +60 -0
  355. package/skeleton/.codex/skills/runnable-worktrees/SKILL.md +119 -0
  356. package/skeleton/.codex/skills/update-arch-docs/SKILL.md +132 -0
  357. package/skeleton/protocols/air/builder-prompt.md +28 -47
  358. package/skeleton/protocols/air/consult-types/impl-review.md +17 -34
  359. package/skeleton/protocols/air/consult-types/pr-review.md +14 -37
  360. package/skeleton/protocols/air/prompts/implement.md +20 -73
  361. package/skeleton/protocols/air/prompts/pr.md +22 -54
  362. package/skeleton/protocols/air/protocol.md +40 -71
  363. package/skeleton/protocols/aspir/builder-prompt.md +29 -66
  364. package/skeleton/protocols/aspir/consult-types/impl-review.md +17 -44
  365. package/skeleton/protocols/aspir/consult-types/phase-review.md +17 -44
  366. package/skeleton/protocols/aspir/consult-types/plan-review.md +14 -38
  367. package/skeleton/protocols/aspir/consult-types/pr-review.md +13 -39
  368. package/skeleton/protocols/aspir/consult-types/spec-review.md +13 -33
  369. package/skeleton/protocols/aspir/prompts/implement.md +27 -196
  370. package/skeleton/protocols/aspir/prompts/plan.md +21 -85
  371. package/skeleton/protocols/aspir/prompts/review.md +29 -228
  372. package/skeleton/protocols/aspir/prompts/specify.md +25 -111
  373. package/skeleton/protocols/aspir/protocol.json +10 -0
  374. package/skeleton/protocols/aspir/protocol.md +36 -82
  375. package/skeleton/protocols/bugfix/builder-prompt.md +23 -45
  376. package/skeleton/protocols/bugfix/consult-types/impl-review.md +21 -45
  377. package/skeleton/protocols/bugfix/consult-types/pr-review.md +18 -52
  378. package/skeleton/protocols/bugfix/prompts/fix.md +16 -61
  379. package/skeleton/protocols/bugfix/prompts/investigate.md +18 -62
  380. package/skeleton/protocols/bugfix/prompts/pr.md +22 -57
  381. package/skeleton/protocols/bugfix/protocol.md +44 -50
  382. package/skeleton/protocols/experiment/builder-prompt.md +25 -58
  383. package/skeleton/protocols/experiment/protocol.md +22 -188
  384. package/skeleton/protocols/experiment/templates/notes.md +11 -71
  385. package/skeleton/protocols/maintain/builder-prompt.md +24 -45
  386. package/skeleton/protocols/maintain/consult-types/impl-review.md +17 -44
  387. package/skeleton/protocols/maintain/consult-types/pr-review.md +13 -39
  388. package/skeleton/protocols/maintain/prompts/maintain.md +1 -1
  389. package/skeleton/protocols/maintain/protocol.md +32 -266
  390. package/skeleton/protocols/maintain/templates/maintenance-run.md +11 -0
  391. package/skeleton/protocols/pir/builder-prompt.md +30 -64
  392. package/skeleton/protocols/pir/consult-types/impl-review.md +17 -50
  393. package/skeleton/protocols/pir/consult-types/pr-review.md +11 -40
  394. package/skeleton/protocols/pir/prompts/implement.md +1 -2
  395. package/skeleton/protocols/pir/prompts/plan.md +0 -3
  396. package/skeleton/protocols/pir/prompts/review.md +1 -1
  397. package/skeleton/protocols/pir/protocol.md +54 -177
  398. package/skeleton/protocols/research/builder-prompt.md +27 -58
  399. package/skeleton/protocols/research/protocol.md +28 -153
  400. package/skeleton/protocols/spike/builder-prompt.md +30 -48
  401. package/skeleton/protocols/spike/protocol.md +24 -107
  402. package/skeleton/protocols/spike/templates/findings.md +9 -39
  403. package/skeleton/protocols/spir/builder-prompt.md +33 -62
  404. package/skeleton/protocols/spir/consult-types/impl-review.md +17 -44
  405. package/skeleton/protocols/spir/consult-types/phase-review.md +17 -44
  406. package/skeleton/protocols/spir/consult-types/plan-review.md +14 -38
  407. package/skeleton/protocols/spir/consult-types/pr-review.md +13 -39
  408. package/skeleton/protocols/spir/consult-types/spec-review.md +13 -33
  409. package/skeleton/protocols/spir/prompts/implement.md +26 -195
  410. package/skeleton/protocols/spir/prompts/plan.md +20 -84
  411. package/skeleton/protocols/spir/prompts/review.md +28 -227
  412. package/skeleton/protocols/spir/prompts/specify.md +24 -110
  413. package/skeleton/protocols/spir/protocol.json +10 -0
  414. package/skeleton/protocols/spir/protocol.md +84 -633
  415. package/skeleton/protocols/spir/templates/plan.md +28 -147
  416. package/skeleton/protocols/spir/templates/review.md +21 -80
  417. package/skeleton/protocols/spir/templates/spec.md +24 -118
  418. package/skeleton/resources/commands/agent-farm.md +348 -0
  419. package/skeleton/resources/commands/codev.md +5 -0
  420. package/skeleton/resources/commands/consult.md +262 -8
  421. package/skeleton/resources/commands/overview.md +1 -0
  422. package/skeleton/roles/architect.md +67 -306
  423. package/skeleton/roles/builder.md +77 -191
  424. package/skeleton/templates/AGENTS.md +2 -0
  425. package/skeleton/templates/CLAUDE.md +2 -0
  426. package/templates/tower.html +39 -2
  427. package/dashboard-dist/assets/index-BZ1x7x1X.js.map +0 -1
  428. package/dashboard-dist/assets/index-DB1KBSNE.css +0 -32
  429. package/dist/agent-farm/servers/send-buffer.d.ts +0 -59
  430. package/dist/agent-farm/servers/send-buffer.d.ts.map +0 -1
  431. package/dist/agent-farm/servers/send-buffer.js +0 -103
  432. package/dist/agent-farm/servers/send-buffer.js.map +0 -1
  433. package/skeleton/porch/prompts/defend.md +0 -108
  434. package/skeleton/porch/prompts/diagnose.md +0 -70
  435. package/skeleton/porch/prompts/evaluate.md +0 -132
  436. package/skeleton/porch/prompts/fix.md +0 -59
  437. package/skeleton/porch/prompts/implement.md +0 -88
  438. package/skeleton/porch/prompts/plan.md +0 -74
  439. package/skeleton/porch/prompts/pr.md +0 -84
  440. package/skeleton/porch/prompts/review.md +0 -249
  441. package/skeleton/porch/prompts/specify.md +0 -53
  442. package/skeleton/porch/prompts/test.md +0 -63
  443. package/skeleton/protocols/aspir/templates/plan.md +0 -184
  444. package/skeleton/protocols/aspir/templates/review.md +0 -120
  445. package/skeleton/protocols/aspir/templates/spec.md +0 -154
@@ -1,657 +1,108 @@
1
1
  # SPIR Protocol
2
2
 
3
- > **SPIR** = **S**pecify → **P**lan → **I**mplement → **R**eview
4
- >
5
- > Each phase has one build-verify cycle with 3-way consultation.
3
+ **S**pecify → **P**lan → **I**mplement → **R**eview. Each phase is a build-verify cycle with
4
+ 3-way consultation, and two human gates stand before implementation begins.
6
5
 
6
+ Use SPIR for new features, new protocols, architecture changes, and complex refactors — work
7
+ where getting the shape wrong is expensive to discover late. For an isolated bug fix or a small
8
+ feature fully described in an issue, a lighter protocol costs less and loses nothing.
7
9
 
8
- ## Prerequisites
10
+ ## The state machine
9
11
 
10
- **Clean Worktree Before Spawning Builders**:
11
- - All specs, plans, and local changes **MUST be committed** before `afx spawn`
12
- - Builders work in git worktrees branched from HEAD — uncommitted files are invisible
13
- - This includes `codev update` results, spec drafts, and plan approvals
14
- - The `afx spawn` command enforces this (use `--force` to override)
15
-
16
- **Required for Multi-Agent Consultation**:
17
- - The `consult` CLI must be available (installed with `npm install -g @cluesmith/codev`)
18
- - At least one consultation backend: `claude`, `gemini-cli`, or `codex`
19
- - Check with: `codev doctor` or `consult --help`
20
-
21
- ## Protocol Configuration
22
-
23
- ### Multi-Agent Consultation (ENABLED BY DEFAULT)
24
-
25
- **DEFAULT BEHAVIOR:**
26
- Multi-agent consultation is **ENABLED BY DEFAULT** when using SPIR protocol.
27
-
28
- **DEFAULT AGENTS:**
29
- - **GPT-5 Codex**: Primary reviewer for architecture, feasibility, and code quality
30
- - **Gemini Pro**: Secondary reviewer for completeness, edge cases, and alternative approaches
31
-
32
- **DISABLING CONSULTATION:**
33
- To run SPIR without consultation, say "without consultation" when starting work.
34
-
35
- **CUSTOM AGENTS:**
36
- The user can specify different agents by saying: "use SPIR with consultation from [agent1] and [agent2]"
37
-
38
- **CONSULTATION BEHAVIOR:**
39
- - DEFAULT: MANDATORY consultation with GPT-5 and Gemini Pro at EVERY checkpoint
40
- - When explicitly disabled: Skip all consultation steps
41
- - The protocol is BLOCKED until all required consultations are complete
42
-
43
- **Consultation Checkpoints**:
44
- - **Specification**: After initial draft, after human comments
45
- - **Planning**: After initial plan, after human review
46
- - **Implementation**: After code implementation
47
- - **Defending**: After test creation
48
- - **Evaluation**: Before marking phase complete
49
- - **Review**: After review document
50
-
51
- ## Overview
52
- SPIR is a structured development protocol that emphasizes specification-driven development with iterative implementation and continuous review. It builds upon the DAPPER methodology with a focus on context-first development and multi-agent collaboration.
53
-
54
- **The SPIR Model**:
55
- - **S - Specify**: Write specification with 3-way review → Gate: `spec-approval`
56
- - **P - Plan**: Write implementation plan with 3-way review → Gate: `plan-approval`
57
- - **I - Implement**: Execute each plan phase with build-verify cycle (one cycle per phase)
58
- - **R - Review**: Final review and PR preparation with 3-way review
59
-
60
- Each phase follows a build-verify loop: build the artifact, then verify with 3-way consultation (Gemini, Codex, Claude).
61
-
62
- **Core Principle**: Each feature is tracked through exactly THREE documents - a specification, a plan, and a review with lessons learned - all sharing the same filename and sequential identifier.
63
-
64
- ## When to Use SPIR
65
-
66
- ### Use SPIR for:
67
- - New feature development
68
- - Architecture changes
69
- - Complex refactoring
70
- - System design decisions
71
- - API design and implementation
72
- - Performance optimization initiatives
73
-
74
- ### Skip SPIR for:
75
- - Simple bug fixes (< 10 lines)
76
- - Documentation updates
77
- - Configuration changes
78
- - Dependency updates
79
- - Emergency hotfixes (but do a lightweight retrospective after)
80
-
81
- ## Baked Decisions (Optional)
82
-
83
- When filing an issue for SPIR, you can pin architectural decisions you don't want the builder or CMAP reviewers to re-litigate. Include a `## Baked Decisions` section (any heading level is fine) anywhere in the issue body. Useful categories: language, framework, deployment shape, key dependencies, decisions deferred to a later spec. The builder will copy the section verbatim into the spec's Constraints and treat each item as fixed; CMAP reviewers will not propose alternatives unless the spec itself fails to honor a stated decision. Leave the section out for issues where you want the builder to explore freely — absence is the no-op default. You can amend or rescind a baked decision at any time by updating the issue and respawning, or by sending the builder a direct instruction via `afx send`.
84
-
85
- ## Protocol Phases
86
-
87
- ### S - Specify (Collaborative Design Exploration)
88
-
89
- **Purpose**: Thoroughly explore the problem space and solution options before committing to an approach.
90
-
91
- **Workflow Overview**:
92
- 1. User provides a prompt describing what they want built
93
- 2. Agent generates initial specification document
94
- 3. **COMMIT**: "Initial specification draft"
95
- 4. Multi-agent review (GPT-5 and Gemini Pro)
96
- 5. Agent updates spec with multi-agent feedback
97
- 6. **COMMIT**: "Specification with multi-agent review"
98
- 7. Human reviews and provides comments for changes
99
- 8. Agent makes changes and lists what was modified
100
- 9. **COMMIT**: "Specification with user feedback"
101
- 10. Multi-agent review of updated document
102
- 11. Final updates based on second review
103
- 12. **COMMIT**: "Final approved specification"
104
- 13. Iterate steps 7-12 until user approves and says to proceed to planning
105
-
106
- **Important**: Keep documentation minimal - use only THREE core files with the same name:
107
- - `specs/####-descriptive-name.md` - The specification
108
- - `plans/####-descriptive-name.md` - The implementation plan
109
- - `reviews/####-descriptive-name.md` - Review and lessons learned (created during Review phase)
110
-
111
- **Process**:
112
- 1. **Clarifying Questions** (ALWAYS START HERE)
113
- - Ask the user/stakeholder questions to understand the problem
114
- - Probe for hidden requirements and constraints
115
- - Understand the business context and goals
116
- - Identify what's in scope and out of scope
117
- - Continue asking until the problem is crystal clear
118
-
119
- 2. **Problem Analysis**
120
- - Clearly articulate the problem being solved
121
- - Identify stakeholders and their needs
122
- - Document current state and desired state
123
- - List assumptions and constraints
124
-
125
- 3. **Solution Exploration**
126
- - Generate multiple solution approaches (as many as appropriate)
127
- - For each approach, document:
128
- - Technical design
129
- - Trade-offs (pros/cons)
130
- - Estimated complexity
131
- - Risk assessment
132
-
133
- 4. **Open Questions**
134
- - List all uncertainties that need resolution
135
- - Categorize as:
136
- - Critical (blocks progress)
137
- - Important (affects design)
138
- - Nice-to-know (optimization)
139
-
140
- 5. **Success Criteria**
141
- - Define measurable acceptance criteria
142
- - Include performance requirements
143
- - Specify quality metrics
144
- - Document test scenarios
145
-
146
- 6. **Expert Consultation (DEFAULT - MANDATORY)**
147
- - **First Consultation** (after initial draft):
148
- - MUST consult GPT-5 AND Gemini Pro
149
- - Focus: Problem clarity, solution completeness, missing requirements
150
- - Update specification with ALL feedback from both models
151
- - Document changes in "Consultation Log" section of the spec
152
- - **Second Consultation** (after human comments):
153
- - MUST consult GPT-5 AND Gemini Pro again
154
- - Focus: Validate changes, ensure alignment
155
- - Final specification update with both models' input
156
- - Update "Consultation Log" with new feedback
157
-
158
- **Note**: Only skip if user explicitly requested "without multi-agent consultation"
159
-
160
- **⚠️ BLOCKING**: Cannot proceed without BOTH consultations (unless explicitly disabled)
161
-
162
- **Output**: Single specification document in `codev/specs/####-descriptive-name.md`
163
- - All consultation feedback incorporated directly into this document
164
- - Include a "Consultation Log" section summarizing key feedback and changes
165
- - Version control captures evolution through commits
166
- **Structure**: developed through the specify phase
167
- **Review Required**: Yes - Human approval AFTER consultations
168
-
169
- ### P - Plan (Structured Decomposition)
170
-
171
- **Purpose**: Transform the approved specification into an executable roadmap with clear phases.
172
-
173
- **⚠️ CRITICAL: No Time Estimates in the AI Age**
174
- - **NEVER include time estimates** (hours, days, weeks, story points)
175
- - AI-driven development makes traditional time estimates meaningless
176
- - Delivery speed depends on iteration cycles, not calendar time
177
- - Focus on logical dependencies and phase ordering instead
178
- - Measure progress by completed phases, not elapsed time
179
- - The only valid metrics are: "done" or "not done"
180
-
181
- **Workflow Overview**:
182
- 1. Agent creates initial plan document
183
- 2. **COMMIT**: "Initial plan draft"
184
- 3. Multi-agent review (GPT-5 and Gemini Pro)
185
- 4. Agent updates plan with multi-agent feedback
186
- 5. **COMMIT**: "Plan with multi-agent review"
187
- 6. User reviews and requests modifications
188
- 7. Agent updates plan based on user feedback
189
- 8. **COMMIT**: "Plan with user feedback"
190
- 9. Multi-agent review of updated plan
191
- 10. Final updates based on second review
192
- 11. **COMMIT**: "Final approved plan"
193
- 12. Iterate steps 6-11 until agreement is reached
194
-
195
- **Phase Design Goals**:
196
- Each phase should be:
197
- - A separate piece of work that can be checked in as a unit
198
- - A complete set of functionality
199
- - Self-contained and independently valuable
200
-
201
- **Process**:
202
- 1. **Phase Definition**
203
- - Break work into logical phases
204
- - Each phase must:
205
- - Have a clear, single objective
206
- - Be independently testable
207
- - Deliver observable value
208
- - Be a complete unit that can be committed
209
- - End with evaluation discussion and single commit
210
- - Note dependencies inline, for example:
211
- ```markdown
212
- Phase 2: API Endpoints
213
- - Depends on: Phase 1 (Database Schema)
214
- - Objective: Create /users and /todos endpoints
215
- - Evaluation: Test coverage, API design review, performance check
216
- - Commit: Will create single commit after user approval
217
- ```
218
-
219
- 2. **Success Metrics**
220
- - Define "done" for each phase
221
- - Include test coverage requirements
222
- - Specify performance benchmarks
223
- - Document acceptance tests
224
-
225
- 3. **Expert Review (DEFAULT - MANDATORY)**
226
- - **First Consultation** (after plan creation):
227
- - MUST consult GPT-5 AND Gemini Pro
228
- - Focus: Feasibility, phase breakdown, completeness
229
- - Update plan with ALL feedback from both models
230
- - **Second Consultation** (after human review):
231
- - MUST consult GPT-5 AND Gemini Pro again
232
- - Focus: Validate adjustments, confirm approach
233
- - Final plan refinement with both models' input
234
-
235
- **Note**: Only skip if user explicitly requested "without multi-agent consultation"
236
-
237
- **⚠️ BLOCKING**: Cannot proceed without BOTH consultations (unless explicitly disabled)
238
-
239
- **Output**: Single plan document in `codev/plans/####-descriptive-name.md`
240
- - Same filename as specification, different directory
241
- - All consultation feedback incorporated directly
242
- - Include phase status tracking within this document
243
- - **DO NOT include time estimates** - Focus on deliverables and dependencies, not hours/days
244
- - Version control captures evolution through commits
245
- **Structure**: follows the plan template provided by the plan phase
246
- **Review Required**: Yes - Technical lead approval AFTER consultations
247
-
248
- ### I - Implement (Per Plan Phase)
249
-
250
- Execute for each phase in the plan. Each phase follows a build-verify cycle.
251
-
252
- **CRITICAL PRECONDITION**: Before starting any phase, verify the previous phase was committed to git. No phase can begin without the prior phase's commit.
253
-
254
- **Build-Verify Cycle Per Phase**:
255
- 1. **Build** - Implement code and tests for this phase
256
- 2. **Verify** - 3-way consultation (Gemini, Codex, Claude)
257
- 3. **Iterate** - Address feedback until verification passes
258
- 4. **Commit** - Single atomic commit for the phase (MANDATORY before next phase)
259
- 5. **Proceed** - Move to next phase only after commit
260
-
261
- **Handling Failures**:
262
- - If verification reveals gaps → iterate and fix
263
- - If fundamental plan flaws found → mark phase as `blocked` and revise plan
264
-
265
- **Commit Requirements**:
266
- - Each phase MUST end with a git commit before proceeding
267
- - Commit message format: `[Spec ####][Phase: name] type: Description`
268
- - No work on the next phase until current phase is committed
269
- - If changes are needed after commit, create a new commit with fixes
270
-
271
- #### I - Implement (Build with Discipline)
272
-
273
- **Purpose**: Transform the plan into working code with high quality standards.
274
-
275
- **Precondition**: Previous phase must be committed (verify with `git log`)
276
-
277
- **Requirements**:
278
- 1. **Pre-Implementation**
279
- - Verify previous phase is committed to git
280
- - Review the phase plan and success criteria
281
- - Set up the development environment
282
- - Create feature branch following naming convention
283
- - Document any plan deviations immediately
284
-
285
- 2. **During Implementation**
286
- - Write self-documenting code
287
- - Follow project style guide strictly
288
- - Implement incrementally with frequent commits
289
- - Each commit must:
290
- - Be atomic (single logical change)
291
- - Include descriptive message
292
- - Reference the phase
293
- - Pass basic syntax checks
294
-
295
- 3. **Code Quality Standards**
296
- - No commented-out code
297
- - No debug prints in final code
298
- - Handle all error cases explicitly
299
- - Include necessary logging
300
- - Follow security best practices
301
-
302
- 4. **Documentation Requirements**
303
- - Update API documentation
304
- - Add inline comments for complex logic
305
- - Update README if needed
306
- - Document configuration changes
307
-
308
- **Evidence Required**:
309
- - Link to commits
310
- - Code review approval (if applicable)
311
- - No linting errors
312
- - CI pipeline pass link (build/test/lint)
313
-
314
- **Expert Consultation (DEFAULT - MANDATORY)**:
315
- - MUST consult BOTH GPT-5 AND Gemini Pro after implementation
316
- - Focus: Code quality, patterns, security, best practices
317
- - Update code based on feedback from BOTH models before proceeding
318
- - Only skip if user explicitly disabled multi-agent consultation
319
-
320
- #### D - Defend (Write Comprehensive Tests)
321
-
322
- **Purpose**: Create comprehensive automated tests that safeguard intended behavior and prevent regressions.
323
-
324
- **CRITICAL**: Tests must be written IMMEDIATELY after implementation, NOT retroactively at the end of all phases. This is MANDATORY.
325
-
326
- **Requirements**:
327
- 1. **Defensive Test Creation**
328
- - Write unit tests for all new functions
329
- - Create integration tests for feature flows
330
- - Develop edge case coverage
331
- - Build error condition tests
332
- - Establish performance benchmarks
333
-
334
- 2. **Test Validation** (ALL MANDATORY)
335
- - All new tests must pass
336
- - All existing tests must pass
337
- - No reduction in overall coverage
338
- - Performance benchmarks met
339
- - Security scans pass
340
- - **Avoid Overmocking**:
341
- - Test behavior, not implementation details
342
- - Prefer integration tests over unit tests with heavy mocking
343
- - Only mock external dependencies (APIs, databases, file systems)
344
- - Never mock the system under test itself
345
- - Use real implementations for internal module boundaries
346
-
347
- 3. **Test Suite Documentation**
348
- - Document test scenarios
349
- - Explain complex test setups
350
- - Note any flaky tests
351
- - Record performance baselines
352
-
353
- **Evidence Required**:
354
- - Test execution logs
355
- - Coverage report (show no reduction)
356
- - Performance test results (if applicable per spec)
357
- - Security scan results (if configured)
358
- - CI test run link with artifacts
359
-
360
- **Expert Consultation (DEFAULT - MANDATORY)**:
361
- - MUST consult BOTH GPT-5 AND Gemini Pro for test defense review
362
- - Focus: Test coverage completeness, edge cases, defensive patterns, test strategy
363
- - Write additional defensive tests based on feedback from BOTH models
364
- - Share their feedback during the Evaluation discussion
365
- - Only skip if user explicitly disabled multi-agent consultation
366
-
367
- #### E - Evaluate (Assess Objectively)
368
-
369
- **Purpose**: Verify the implementation fully satisfies the phase requirements and maintains system quality. This is where the critical discussion happens before committing the phase.
370
-
371
- **Requirements**:
372
- 1. **Functional Evaluation**
373
- - All acceptance criteria met
374
- - User scenarios work as expected
375
- - Edge cases handled properly
376
- - Error messages are helpful
377
-
378
- 2. **Non-Functional Evaluation**
379
- - Performance requirements satisfied
380
- - Security standards maintained
381
- - Code maintainability assessed
382
- - Technical debt documented
383
-
384
- 3. **Deviation Analysis**
385
- - Document any changes from plan
386
- - Explain reasoning for changes
387
- - Assess impact on other phases
388
- - Update future phases if needed
389
- - **Overmocking Check** (MANDATORY):
390
- - Verify tests focus on behavior, not implementation
391
- - Ensure at least one integration test per critical path
392
- - Check that internal module boundaries use real implementations
393
- - Confirm mocks are only used for external dependencies
394
- - Tests should survive refactoring that preserves behavior
395
-
396
- 4. **Expert Consultation Before User Evaluation** (MANDATORY - NO EXCEPTIONS)
397
- - Get initial feedback from experts
398
- - Make ALL necessary fixes based on feedback
399
- - **CRITICAL**: Get FINAL approval from ALL consulted experts on the FIXED version
400
- - Only proceed to user evaluation after ALL experts approve
401
- - If any expert says "not quite" or has concerns, fix them FIRST
402
-
403
- 5. **Evaluation Discussion with User** (ONLY AFTER EXPERT APPROVAL)
404
- - Present to user: "Phase X complete. Here's what was built: [summary]"
405
- - Share test results and coverage metrics
406
- - Share that ALL experts have given final approval
407
- - Ask: "Any changes needed before I commit this phase?"
408
- - Incorporate user feedback if requested
409
- - Get explicit approval to proceed
410
-
411
- 6. **Phase Commit** (MANDATORY - NO EXCEPTIONS)
412
- - Create single atomic commit for the entire phase
413
- - Commit message: `[Spec ####][Phase: name] type: Description`
414
- - Update the plan document marking this phase as complete
415
- - Push all changes to version control
416
- - Document any deviations or decisions in the plan
417
- - **CRITICAL**: Next phase CANNOT begin until this commit is complete
418
- - Verify commit with `git log` before proceeding
419
-
420
- 7. **Final Verification**
421
- - Confirm all expert feedback was addressed
422
- - Verify all tests pass
423
- - Check that documentation is updated
424
- - Ensure no outstanding concerns from experts or user
425
-
426
- **Evidence Required**:
427
- - Evaluation checklist completed
428
- - Test results and coverage report
429
- - Expert review notes from GPT-5 and Gemini Pro
430
- - User approval from evaluation discussion
431
- - Updated plan document with:
432
- - Phase marked complete
433
- - Evaluation discussion summary
434
- - Any deviations noted
435
- - Git commit for this phase
436
- - Final CI run link after all fixes
437
-
438
- ## 📋 PHASE COMPLETION CHECKLIST (MANDATORY BEFORE NEXT PHASE)
439
-
440
- **⚠️ STOP: DO NOT PROCEED TO NEXT PHASE UNTIL ALL ITEMS ARE ✅**
441
-
442
- ### Before Starting ANY Phase:
443
- - [ ] Previous phase is committed to git (verify with `git log`)
444
- - [ ] Plan document shows previous phase as `completed`
445
- - [ ] No outstanding issues from previous phase
446
-
447
- ### After Implement Phase:
448
- - [ ] All code for this phase is complete
449
- - [ ] Code follows project style guide
450
- - [ ] No commented-out code or debug prints
451
- - [ ] Error handling is implemented
452
- - [ ] Documentation is updated (if needed)
453
- - [ ] Expert consultation completed (GPT-5 + Gemini Pro)
454
- - [ ] Expert feedback has been addressed
455
-
456
- ### After Defend Phase:
457
- - [ ] Unit tests written for all new functions
458
- - [ ] Integration tests written for critical paths
459
- - [ ] Edge cases have test coverage
460
- - [ ] All new tests are passing
461
- - [ ] All existing tests still pass
462
- - [ ] No reduction in code coverage
463
- - [ ] Overmocking check completed (tests focus on behavior)
464
- - [ ] Expert consultation on tests completed
465
- - [ ] Test feedback has been addressed
466
-
467
- ### After Evaluate Phase:
468
- - [ ] All acceptance criteria from spec are met
469
- - [ ] Performance requirements satisfied
470
- - [ ] Security standards maintained
471
- - [ ] Expert consultation shows FINAL approval
472
- - [ ] User evaluation discussion completed
473
- - [ ] User has given explicit approval to proceed
474
- - [ ] Plan document updated with phase status
475
- - [ ] Phase commit created with proper message format
476
- - [ ] Commit pushed to version control
477
- - [ ] Commit verified with `git log`
478
-
479
- ### ❌ PHASE BLOCKERS (Fix Before Proceeding):
480
- - Any failing tests
481
- - Unaddressed expert feedback
482
- - Missing user approval
483
- - Uncommitted changes
484
- - Incomplete documentation
485
- - Coverage reduction
486
-
487
- **REMINDER**: Each phase is atomic. You cannot start the next phase until the current phase is fully complete, tested, evaluated, and committed.
488
-
489
- ### R - Review/Refine/Revise (Continuous Improvement)
490
-
491
- **Purpose**: Ensure overall coherence, capture learnings, improve the methodology, and perform systematic review.
492
-
493
- **Precondition**: All implementation phases must be committed (verify with `git log --oneline | grep "\[Phase"`)
494
-
495
- **Process**:
496
- 1. **Comprehensive Review**
497
- - Verify all phases have been committed to git
498
- - Compare final implementation to original specification
499
- - Assess overall architecture impact
500
- - Review code quality across all changes
501
- - Validate documentation completeness
502
-
503
- 2. **Refinement Actions**
504
- - Refactor code for clarity if needed
505
- - Optimize performance bottlenecks
506
- - Improve test coverage gaps
507
- - Enhance documentation
508
-
509
- 3. **Update Architecture Documentation**
510
- - Route new system-shape facts and durable wisdom by tier (Spec 987): behavior-changing + cross-cutting → the HOT `codev/resources/arch-critical.md` / `lessons-critical.md` (capped, always-injected; demote a weaker entry to cold if full); reference detail → the COLD `codev/resources/arch.md` / `lessons-learned.md`
511
- - Use the **`update-arch-docs` skill** (at `.claude/skills/update-arch-docs/SKILL.md`) to apply changes — it encodes the hot/cold two-tier discipline (caps + cold-doc maps for the hot files; reference archive for the cold files) and what NOT to include
512
- - Follow guidance in the MAINTAIN protocol's Step 3 ("Sync Documentation") for structure, the "Lives where" routing matrix, and pruning checklists
513
- - Ensure both docs reflect current state
514
-
515
- 4. **Revision Requirements** (MANDATORY)
516
- - Update README.md with any new features or changes
517
- - Update AGENTS.md and CLAUDE.md with protocol improvements from lessons learned
518
- - Update specification and plan documents with final status
519
- - Revise architectural diagrams if needed
520
- - Update API documentation
521
- - Modify deployment guides as necessary
522
- - **CRITICAL**: Update this protocol document based on lessons learned
523
-
524
- 5. **Systematic Issue Review** (MANDATORY)
525
- - Review entire project for systematic issues:
526
- - Repeated problems across phases
527
- - Process bottlenecks or inefficiencies
528
- - Missing documentation patterns
529
- - Technical debt accumulation
530
- - Testing gaps or quality issues
531
- - Document systematic findings in lessons learned
532
- - Create action items for addressing systematic issues
533
-
534
- 6. **Lessons Learned** (MANDATORY)
535
- - What went well?
536
- - What was challenging?
537
- - What would you do differently?
538
- - What methodology improvements are needed?
539
- - What systematic issues were identified?
540
-
541
- 7. **Methodology Evolution**
542
- - Propose process improvements based on lessons
543
- - Update protocol documents with improvements
544
- - Update templates if needed
545
- - Share learnings with team
546
- - Document in `codev/reviews/`
547
- - **Important**: This protocol should evolve based on each project's learnings
548
-
549
- **Output**:
550
- - Single review document in `codev/reviews/####-descriptive-name.md`
551
- - Same filename as spec/plan, captures review and learnings from this feature
552
- - Methodology improvement proposals (update protocol if needed)
553
-
554
- **Review Required**: Yes - Team retrospective recommended
555
-
556
- ## File Naming Conventions
557
-
558
- ### Specifications and Plans
559
- Format: `####-descriptive-name.md`
560
- - Use sequential numbering (1, 2, etc.)
561
- - Same filename in both `specs/` and `plans/` directories
562
- - Example: `1-user-authentication.md`
563
-
564
- ## Status Tracking
565
-
566
- Status is tracked at the **phase level** within plan documents, not at the document level.
567
-
568
- Each phase in a plan should have a status:
569
- - `pending`: Not started
570
- - `in-progress`: Currently being worked on
571
- - `completed`: Phase finished and tested
572
- - `blocked`: Cannot proceed due to external factors
573
-
574
- ## Git Integration
575
-
576
- ### Commit Message Format
577
-
578
- For specification/plan documents:
579
- ```
580
- [Spec ####] <stage>: <description>
581
- ```
12
+ Phases, gates, checks and their order are defined here. This is the authoritative source; the
13
+ prose below is only what the JSON cannot express.
582
14
 
583
- Examples:
584
- ```
585
- [Spec 1] Initial specification draft
586
- [Spec 1] Specification with multi-agent review
587
- [Spec 1] Specification with user feedback
588
- [Spec 1] Final approved specification
15
+ ```json
16
+ {{> protocols/spir/protocol.json}}
589
17
  ```
590
18
 
591
- For implementation:
592
- ```
593
- [Spec ####][Phase: <phase-name>] <type>: <description>
19
+ ## Artifacts
594
20
 
595
- <optional detailed description>
596
- ```
21
+ Three documents per feature, **same base filename** in three directories:
597
22
 
598
- Example:
599
- ```
600
- [Spec 1][Phase: user-auth] feat: Add password hashing service
23
+ | Document | Answers | Written during |
24
+ |---|---|---|
25
+ | `codev/specs/<id>-<name>.md` | what and why | Specify |
26
+ | `codev/plans/<id>-<name>.md` | how, and in what order | Plan |
27
+ | `codev/reviews/<id>-<name>.md` | what was learned | Review |
601
28
 
602
- Implements bcrypt-based password hashing with configurable rounds
603
- ```
29
+ Sequential numbering, no leading zeros: `42-user-authentication.md`.
604
30
 
605
- ### Branch Naming
606
- ```
607
- spir/####-<spec-name>/<phase-name>
608
- ```
31
+ Specs and plans stay separate. A spec that has acquired file paths and step ordering has become
32
+ a plan — and the gate meant to catch a wrong approach is now reviewing an implementation.
609
33
 
610
- Example:
611
- ```
612
- spir/1-user-authentication/database-schema
613
- ```
34
+ The plan carries a machine-readable `phases` JSON block. Porch parses it to track progress, so
35
+ it is a contract, not an illustration.
36
+
37
+ ## Phases
614
38
 
39
+ **Specify** — explore the problem before committing to an approach. Ask clarifying questions
40
+ first; they are cheapest before anything is written. Capture the problem, current and desired
41
+ state, several solution approaches with their trade-offs, open questions ranked by whether they
42
+ block, and measurable success criteria.
615
43
 
616
- ## Best Practices
44
+ **Plan** — decompose into phases that are each independently testable, independently valuable,
45
+ and committable as a unit. Note dependencies inline. **No time estimates.** Delivery speed
46
+ depends on iteration cycles, not calendar time, and an estimate in an AI-driven project is noise
47
+ that later gets quoted back as a commitment.
617
48
 
618
- ### During Specification
619
- - Use clear, unambiguous language
620
- - Include concrete examples
621
- - Define measurable success criteria
622
- - Link to relevant references
49
+ **Implement** — one build-verify cycle per plan phase: build, verify by 3-way consultation,
50
+ address what reviewers find, commit. The commit is what makes the next phase safe to begin; a
51
+ phase that is "done but uncommitted" can vanish. If verification exposes a flaw in the *plan*
52
+ rather than the code, mark the phase blocked and revise the plan — implementing around a
53
+ known-wrong plan is how a project ships the wrong thing carefully.
623
54
 
624
- ### During Planning
625
- - Keep phases small and focused
626
- - Ensure each phase delivers value
627
- - Note phase dependencies inline (no formal dependency mapping needed)
628
- - Include rollback strategies
55
+ Tests belong to the phase that creates the behaviour, not to a cleanup pass at the end.
56
+ Retroactive tests document what was built; tests written alongside constrain what gets built.
57
+ Mock external dependencies only — mocking the system under test proves the mock works.
629
58
 
630
- ### During Implementation
631
- - Follow the plan but document deviations
632
- - Maintain test coverage
633
- - Keep commits atomic and well-described
634
- - Update documentation as you go
59
+ **Review** — compare the implementation against the specification, record lessons, and route new
60
+ facts by tier: behaviour-changing and cross-cutting to `arch-critical.md` /
61
+ `lessons-critical.md` (capped — displace a weaker entry rather than growing them), reference
62
+ detail to `arch.md` / `lessons-learned.md`. The `update-arch-docs` skill encodes that routing.
635
63
 
636
- ### During Review
637
- - Check against original specification
638
- - Document lessons learned
639
- - Propose methodology improvements
640
- - Update estimates for future work
64
+ ## Consultation
641
65
 
642
- ## Templates
66
+ 3-way consultation (Gemini, Codex, Claude) is **on by default** and runs at each phase's verify
67
+ step. Disable it only when the human explicitly asks.
68
+
69
+ It is not a formality: it reliably catches security, design and protocol problems that solo
70
+ review misses, and the cost of skipping it is paid later by someone with less context.
71
+
72
+ ## Gates
73
+
74
+ `spec-approval`, `plan-approval` and `pr` are **human** decisions. Stop and wait. A gate message
75
+ is a notification to a human, not authorization to proceed.
76
+
77
+ ## Baked Decisions
78
+
79
+ An issue may carry a `## Baked Decisions` section pinning architectural choices the architect
80
+ does not want re-litigated — typically **language**, **framework**, deployment shape, key
81
+ **dependencies**, or decisions deferred to a later spec.
82
+
83
+ Every item in it is fixed. Copy the section verbatim into the spec's Constraints and do not
84
+ re-open it in the spec, plan, or review; CMAP reviewers will not propose alternatives unless the
85
+ spec fails to honour one. If two items contradict each other, do not choose — surface the
86
+ contradiction and wait.
87
+
88
+ **Absence is the no-op default**: an issue with no such section is an invitation to explore
89
+ freely, not an omission to be filled in.
90
+
91
+ The architect can **amend or rescind** a baked decision at any time by updating the issue and
92
+ respawning, or by sending the builder a direct instruction via `afx send`.
93
+
94
+ ## Git
95
+
96
+ ```
97
+ [Spec 42] Initial specification draft
98
+ [Spec 42][Phase: user-auth] feat: Add password hashing service
99
+ ```
643
100
 
644
- Each phase has a template that ships in the package skeleton; the phase prompts deliver the structure you need, so you do not fetch these files directly:
645
- - `spec.md` - Specification template
646
- - `plan.md` - Planning template (includes phase status tracking)
647
- - `review.md` - Review and lessons learned template
101
+ Branches: `spir/42-feature-name/phase-name`.
648
102
 
649
- **Remember**: Only create THREE documents per feature - spec, plan, and review with the same filename in different directories.
103
+ Each implement phase ends in one atomic commit before the next begins.
650
104
 
651
- ## Protocol Evolution
105
+ ## Phase status
652
106
 
653
- This protocol can be customized per project:
654
- 1. Fork the protocol directory
655
- 2. Modify templates and processes
656
- 3. Document changes in `protocol-changes.md`
657
- 4. Share improvements back to the community
107
+ Tracked per phase inside the plan document, not per document: `pending`, `in-progress`,
108
+ `completed`, `blocked`.