@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,42 +1,28 @@
1
1
  # Implementation Review Prompt
2
2
 
3
3
  ## Context
4
- You are reviewing implementation work during the Implement phase. A builder has completed a plan phase and needs feedback before proceeding. Your job is to verify the implementation matches the spec and plan.
5
4
 
6
- ## CRITICAL: Verify Before Flagging
5
+ You are reviewing implementation work during the Implement phase. A builder has completed a plan phase and needs feedback before proceeding. Verify the implementation matches the spec and plan.
7
6
 
8
- Before requesting changes for missing configuration, incorrect patterns, or framework issues:
9
- 1. **Check `package.json`** for actual dependency versions — framework conventions change between major versions
10
- 2. **Read the actual config files** (or confirm their deliberate absence) before flagging missing configs
11
- 3. **Do not assume** your training data reflects the version in use — verify against project files
12
- 4. If "Previous Iteration Context" is provided, read it carefully before re-raising concerns that were already disputed
7
+ ## Verify before flagging
13
8
 
14
- ## Focus Areas
15
-
16
- 1. **Spec Adherence**
17
- - Does the implementation fulfill the spec requirements for this phase?
18
- - Are acceptance criteria met?
19
-
20
- 2. **Code Quality**
21
- - Is the code readable and maintainable?
22
- - Are there obvious bugs or issues?
23
- - Are error cases handled appropriately?
9
+ Before requesting changes for missing configuration, wrong patterns, or framework issues, confirm the claim against the project rather than your training data:
24
10
 
25
- 3. **Test Coverage**
26
- - Are the tests adequate for this phase?
27
- - Do tests cover the main paths AND edge cases?
11
+ - Check `package.json` for the actual dependency versions — framework conventions change between major versions.
12
+ - Read the actual config files (or confirm their deliberate absence) before flagging a missing config.
13
+ - If "Previous Iteration Context" is provided, read it before re-raising concerns already disputed.
28
14
 
29
- 4. **Plan Alignment**
30
- - Does the implementation follow the plan?
31
- - Are there plan items skipped or partially completed?
15
+ ## Focus Areas
32
16
 
33
- 5. **UX Verification** (if spec has UX requirements)
34
- - Does the actual user experience match what the spec describes?
35
- - If spec says "async" or "non-blocking", is it actually async?
17
+ - **Spec Adherence** — the implementation fulfills the spec requirements for this phase; acceptance criteria are met.
18
+ - **Code Quality** — readable and maintainable; no obvious bugs; error cases handled.
19
+ - **Test Coverage** — tests are adequate for this phase and cover main paths and edge cases.
20
+ - **Plan Alignment** — the implementation follows the plan; no plan items silently skipped.
21
+ - **UX Verification** (if the spec has UX requirements) — the actual behavior matches what the spec describes (e.g. "async"/"non-blocking" really is).
36
22
 
37
23
  ## Verdict Format
38
24
 
39
- After your review, provide your verdict in exactly this format:
25
+ Provide your verdict in exactly this format — `consult` parses it:
40
26
 
41
27
  ```
42
28
  ---
@@ -50,23 +36,10 @@ KEY_ISSUES:
50
36
  ...
51
37
  ```
52
38
 
53
- **Verdict meanings:**
54
- - `APPROVE`: Phase is complete, builder can proceed
55
- - `REQUEST_CHANGES`: Issues that must be fixed before proceeding
56
- - `COMMENT`: Minor suggestions, can proceed but note feedback
39
+ - `APPROVE`: phase is complete, builder can proceed.
40
+ - `REQUEST_CHANGES`: issues that must be fixed before proceeding.
41
+ - `COMMENT`: minor suggestions; can proceed but note the feedback.
57
42
 
58
43
  ## Scoping (Multi-Phase Plans)
59
44
 
60
- When the implementation plan has multiple phases (e.g., scaffolding, landing, media_rtl):
61
- - **ONLY review work belonging to the current plan phase**
62
- - The query will specify which phase you are reviewing
63
- - Do NOT request changes for functionality scheduled in later phases
64
- - Do NOT flag missing features that are out of scope for this phase
65
- - If unsure whether something belongs to this phase, check the plan file
66
-
67
- ## Notes
68
-
69
- - This is a phase-level review, not the final PR review
70
- - Focus on "does this phase work" not "is the whole feature done"
71
- - If referencing line numbers, use `file:line` format
72
- - The builder needs actionable feedback to continue
45
+ Review **only the current plan phase** — the query names which one. Do not request changes for functionality scheduled in later phases, and do not flag missing features that are out of scope for this phase. If unsure whether something belongs to this phase, check the plan file. This is a phase-level review ("does this phase work"), not the final PR review.
@@ -1,44 +1,24 @@
1
1
  # PR Ready Review Prompt
2
2
 
3
3
  ## Context
4
- You are performing a final self-check during the Review phase. The builder has completed all implementation phases and is about to create a PR. This is the last check before the work goes to the architect for integration review.
5
4
 
6
- ## Focus Areas
7
-
8
- 1. **Completeness**
9
- - Are all spec requirements implemented?
10
- - Are all plan phases complete?
11
- - Is the review document written (`codev/reviews/XXXX-name.md`)?
12
- - Are all commits properly formatted (`[Spec XXXX][Phase]`)?
13
-
14
- 2. **Test Status**
15
- - Do all tests pass?
16
- - Is test coverage adequate for the changes?
17
- - Are there any skipped or flaky tests?
5
+ You are performing the final self-check during the Review phase — the builder has completed all implementation phases and is about to open the PR. This is the last check before the work goes to the architect for integration review.
18
6
 
19
- 3. **Code Cleanliness**
20
- - Is there any debug code left in?
21
- - Are there any TODO comments that should be resolved?
22
- - Are there any `// REVIEW:` comments that weren't addressed?
23
- - Is the code properly formatted?
24
-
25
- 4. **Documentation**
26
- - Are inline comments clear where needed?
27
- - Is the review document comprehensive?
28
- - Are any new APIs documented?
7
+ ## Focus Areas
29
8
 
30
- 5. **PR Readiness**
31
- - Is the branch up to date with its base (the integration branch the PR targets)?
32
- - Are commits atomic and well-described?
33
- - Is the change diff reasonable in size?
9
+ - **Completeness** — all spec requirements implemented, all plan phases complete, the review document written (`codev/reviews/XXXX-name.md`), and commits in the `[Spec XXXX][Phase]` format.
10
+ - **Test Status** — all tests pass, coverage is adequate for the changes, and any skipped/flaky tests are accounted for.
11
+ - **Code Cleanliness** — no debug code, no stray `TODO` / `// REVIEW:` left unaddressed, code properly formatted.
12
+ - **Documentation** — inline comments clear where needed, the review document comprehensive, new APIs documented.
13
+ - **PR Readiness** — the branch is up to date with its base (the integration branch the PR targets), commits are atomic and well-described, and the diff size is reasonable.
34
14
 
35
15
  ## Scope
36
16
 
37
- - **DO NOT** flag the syntax of `git diff` examples that appear in review-file prose (e.g., `git diff ci..HEAD` inside a "Files Changed" caption or "How to Test Locally" section). Quoted diff syntax is documentation, not a command. Apply two-dot/three-dot scrutiny only to diffs you compute yourself.
17
+ Do not flag the syntax of `git diff` examples that appear in review-file prose (e.g. `git diff ci..HEAD` inside a "Files Changed" caption or "How to Test Locally" section) — quoted diff syntax is documentation, not a command. Apply two-dot/three-dot scrutiny only to diffs you compute yourself.
38
18
 
39
19
  ## Verdict Format
40
20
 
41
- After your review, provide your verdict in exactly this format:
21
+ Provide your verdict in exactly this format — `consult` parses it:
42
22
 
43
23
  ```
44
24
  ---
@@ -63,14 +43,8 @@ PR_SUMMARY: |
63
43
  - [How to test]
64
44
  ```
65
45
 
66
- **Verdict meanings:**
67
- - `APPROVE`: Ready to create PR
68
- - `REQUEST_CHANGES`: Issues to fix before PR creation
69
- - `COMMENT`: Minor items, can create PR but note feedback
70
-
71
- ## Notes
46
+ - `APPROVE`: ready to create the PR.
47
+ - `REQUEST_CHANGES`: issues to fix before PR creation.
48
+ - `COMMENT`: minor items; can create the PR but note the feedback.
72
49
 
73
- - This is the builder's final self-review before hand-off
74
- - The PR_SUMMARY in your output can be used as the PR description
75
- - Focus on "is this ready for someone else to review" not "is this perfect"
76
- - Any issues found here are cheaper to fix than during integration review
50
+ The `PR_SUMMARY` block can be used directly as the PR description.
@@ -47,7 +47,7 @@ For each audit finding:
47
47
  3. Build and test: `cd packages/codev && pnpm build && pnpm test`
48
48
  4. Commit: `git add <specific-files> && git commit -m "[Maintain] Remove unused X"`
49
49
 
50
- One removal at a time. Verify after each. Never use `git add -A`.
50
+ One removal at a time, verified after each — staging only the specific files that removal touched.
51
51
 
52
52
  ## Step 4: Sync Documentation
53
53
 
@@ -1,284 +1,50 @@
1
1
  # MAINTAIN Protocol
2
2
 
3
- ## Overview
3
+ Audit → Clean → Sync, in a single pass, then a PR. Two phases, one consultation during the
4
+ maintain phase and one before the PR.
4
5
 
5
- MAINTAIN is a single-pass maintenance protocol for keeping codebases healthy. The builder does all maintenance work in one phase, then creates a PR with a 3-way review.
6
+ Use it for dead code and unused dependencies, quarterly hygiene, pre-release cleanup, and
7
+ keeping the governance docs honest — `arch.md`/`arch-critical.md`,
8
+ `lessons-learned.md`/`lessons-critical.md`, and the `CLAUDE.md`↔`AGENTS.md` twins.
6
9
 
7
- **Core Principle**: Do the work in one pass. Don't over-ceremonialize housekeeping.
10
+ ## The state machine
8
11
 
9
- **Key Documents** MAINTAIN keeps current:
10
- - `codev/resources/arch.md` (COLD reference) + `codev/resources/arch-critical.md` (HOT, always-injected) — Architecture, two tiers (Spec 987)
11
- - `codev/resources/lessons-learned.md` (COLD reference) + `codev/resources/lessons-critical.md` (HOT, always-injected) — Engineering wisdom, two tiers
12
-
13
- The two governance docs are siblings with **different purposes**: `arch.md` owns system shape (services, transports, mental models, verified-wrong assumptions about *this* system); `lessons-learned.md` owns durable engineering wisdom that applies *across* specs. Use the routing matrix below to decide where each fact belongs.
14
-
15
- ### Lives where: routing facts to the right home
16
-
17
- | Type of fact/insight | Lives in |
18
- |---|---|
19
- | Current system shape (services, transports, key mental models) | `codev/resources/arch.md` |
20
- | Mechanism for a unique subsystem | `codev/resources/arch.md` (subsystem section) OR a meta-spec under `codev/architecture/<domain>.md` if the mechanism is large enough to warrant its own doc |
21
- | A durable engineering pattern that applies across multiple specs | `codev/resources/lessons-learned.md` (COLD reference) |
22
- | A **behavior-changing, cross-cutting** rule (should change how the next project is built) | `codev/resources/lessons-critical.md` (HOT, capped) — demote to `lessons-learned.md` if full |
23
- | A **behavior-changing, cross-cutting** architecture invariant (a future builder must know up front) | `codev/resources/arch-critical.md` (HOT, capped) — demote to `arch.md` if full |
24
- | A spec-narrow fix recipe (reference detail) | `codev/resources/lessons-learned.md` (COLD) — kept as reference; **never** the hot file |
25
- | A system-shape surprise verified-wrong in production ("looks like X but isn't") | `codev/resources/arch.md` § "Verified-Wrong Assumptions" |
26
- | Aspirational architectural direction (where we want to go) | The relevant meta-spec or roadmap doc, NOT `arch.md` body |
27
- | A changelog entry ("we shipped X in spec Y on date Z") | `git log` + the spec/review document — NOT `arch.md`, NOT `lessons-learned.md` |
28
- | A retired or removed component | Delete the section entirely; do NOT keep a "retired components" graveyard. (`git log` retains history.) |
29
-
30
- The most commonly-misrouted entry is the system-shape surprise. If a future reader needs to know "the system *looks* like X but actually does Y," that is system shape and lives in `arch.md`. If they need to know "we learned that doing X is generally a bad idea," that is engineering wisdom and lives in `lessons-learned.md`.
31
-
32
- ## When to Use
33
-
34
- - Before a release (clean slate for shipping)
35
- - After completing a major feature
36
- - Quarterly maintenance window
37
- - When the codebase feels "crusty"
38
-
39
- ## Execution Model
40
-
41
- ```
42
- afx spawn --protocol maintain
43
- ↓
44
- 1. MAINTAIN: Audit → Clean → Sync docs (single pass)
45
- ↓ (build + test checks, 3-way review)
46
- 2. REVIEW: Create PR
47
- ↓ (3-way review)
48
- Architect reviews → Merge
49
- ```
50
-
51
- Two phases total. One consultation during the maintain phase, one before PR.
52
-
53
- ## Prerequisites
54
-
55
- Before starting:
56
- 1. Check `codev/maintain/` for the last run number
57
- 2. Note the base commit: `git log --oneline -1` on the last run file
58
- 3. Focus on changes since then: `git log --oneline <base-commit>..HEAD`
59
-
60
- ---
61
-
62
- ## The Maintain Phase (Single Pass)
63
-
64
- The builder works through these tasks in order, committing as they go.
65
-
66
- ### Step 1: Audit
67
-
68
- Identify what needs fixing. Don't fix yet — just catalog.
69
-
70
- **Dead code**:
71
- ```bash
72
- # Find unused exports (TypeScript)
73
- npx ts-prune 2>/dev/null || echo "ts-prune not available"
74
-
75
- # Find unused dependencies
76
- npx depcheck 2>/dev/null || echo "depcheck not available"
77
- ```
78
-
79
- **Stale documentation**:
80
- ```bash
81
- # What changed since last maintenance?
82
- git log --oneline <base-commit>..HEAD
83
-
84
- # Check arch.md references still exist
85
- grep -oE '[a-zA-Z]+/[a-zA-Z/]+\.[a-z]+' codev/resources/arch.md | sort -u | while read f; do
86
- [ -e "$f" ] || echo "Missing: $f"
87
- done
88
- ```
89
-
90
- **Stale project tracking**:
91
- - GitHub Issues that should be closed
92
- - Labels that need updating
93
-
94
- Record findings in the maintenance run file (`codev/maintain/NNNN.md`).
95
-
96
- ### Step 2: Clean
97
-
98
- For each finding from the audit:
99
- 1. Verify it's truly unused (grep the codebase)
100
- 2. Remove it (use `git rm` for tracked files)
101
- 3. Verify build + tests still pass
102
- 4. Commit with `[Maintain] Remove unused X`
103
-
104
- **Rules**:
105
- - One removal at a time — don't batch unrelated changes
106
- - Verify after each removal — build must pass
107
- - Use soft deletion for untracked files: `mv file codev/maintain/.trash/$(date +%Y-%m-%d)/`
108
- - Never use `git add -A` or `git add .`
109
-
110
- ### Step 3: Sync Documentation
111
-
112
- Step 3 is split into two sub-steps: **Audit first, then update.** This split exists because `arch.md` and `lessons-learned.md` accumulate without bound when MAINTAIN does only "what's new" — the audit pass surfaces what should be cut so the update pass is not purely additive.
113
-
114
- The `update-arch-docs` skill (at `.claude/skills/update-arch-docs/SKILL.md`) is invoked by both sub-steps. Read it before starting Step 3 so the discipline is fresh.
115
-
116
- #### Step 3a: Audit documentation
117
-
118
- Invoke the `update-arch-docs` skill in **audit-mode**. The skill reads all four governance files — `codev/resources/arch.md` / `arch-critical.md` and `codev/resources/lessons-learned.md` / `lessons-critical.md` — end-to-end against the discipline below, applies the cuts via the Edit tool, and records each cut's reason in the run file (`codev/maintain/NNNN.md`) under a `## Audit Findings` section. The diff plus the recorded reasons **is** the proposal; the architect's PR review is the human-confirmation step (consistent with the skill's audit-mode).
119
-
120
- **Per-arch.md-section pruning checklist** — for each section in `arch.md`, ask:
121
- - Does it describe **current state**? If aspirational, the section moves to a meta-spec; `arch.md` keeps a 1-paragraph summary + pointer (or nothing, if the meta-spec stands on its own).
122
- - Does it duplicate a meta-spec? If yes, replace with a 1-paragraph summary + pointer.
123
- - Is it a per-file enumeration that's gone stale? If yes, prune to the directory shape + a few key files.
124
- - Is it a changelog/narrative section ("Spec 0042 added X")? If yes, absorb the architecturally-relevant facts and remove the spec-numbered framing.
125
- - Is the component still alive? If retired, delete the section entirely.
126
-
127
- **Per-COLD-`lessons-learned.md`-entry pruning checklist** — for each entry, ask:
128
- - Is it terse (1–3 sentences)? If multi-paragraph, split or compress.
129
- - Is the topic section the right home? If filed under "Architecture (continued)" or a spec-numbered section, move it to the right topical home.
130
- - Is it a duplicate of an adjacent entry? If yes, fold them.
131
- - (Spec-narrow recipes are **kept** as reference — do not cut them just for being spec-narrow. Anti-accretion now lives in the hot cap, not the cold archive.)
132
-
133
- **Per-HOT-file checklist** (`arch-critical.md`, `lessons-critical.md`) — audit the cap and map:
134
- - Within the cap (≈10 entries + a ≈12-topic map, ≤35 lines)? If over, **demote** the weakest entries into the cold doc.
135
- - Does every map topic name a real top-level cold-doc section, and is any new/renamed section reflected? Fix drift; keep the map top-level only.
136
- - Is every entry still behavior-changing? Demote reference detail into the cold archive.
137
-
138
- **Sample audit prompt** (paste into the skill invocation if you want a baseline checklist run):
139
-
140
- ```
141
- Audit all four governance files — codev/resources/arch.md + arch-critical.md and
142
- lessons-learned.md + lessons-critical.md — against the discipline in the
143
- update-arch-docs skill. For each cold section/entry run the cold pruning checklists,
144
- and for each hot file check the cap, displacement, and map accuracy (Step 3a).
145
- Apply the cuts with one-line reasons. Bias toward fewer, higher-confidence
146
- cuts ("when in doubt, KEEP"). Record each cut's reason in the current run
147
- file's ## Audit Findings section as you go — the diff plus those reasons is the proposal.
148
- ```
149
-
150
- **When in doubt, KEEP.** This rule is preserved from the older Step 3. A confident cut is better than three speculative ones. The audit pass is a *proposal*; the architect's PR review confirms it.
151
-
152
- #### Step 3b: Update documentation
153
-
154
- Apply the audit decisions from Step 3a, plus any additive content needed.
155
-
156
- **arch.md / arch-critical.md**: Compare documented structure with actual codebase. Route behavior-changing invariants to `arch-critical.md` (HOT — respect the cap + keep its map accurate); reference detail to `arch.md` (COLD). Update:
157
- - Directory structure
158
- - Component descriptions (explain HOW things work, not just WHAT)
159
- - Key files and their purposes
160
- - Remove references to deleted code (per Step 3a audit findings)
161
- - Add new components/utilities
162
-
163
- **lessons-learned.md / lessons-critical.md**: Scan `codev/reviews/` for new reviews since last run. **Route** each new lesson by tier — behavior-changing + cross-cutting → `lessons-critical.md` (HOT; respect the cap, demote a weaker entry to cold if full); reference recipe / spec-narrow → `lessons-learned.md` (COLD). Apply Step 3a's per-entry cuts and keep each hot file's cold-doc map accurate.
164
-
165
- For specific additive changes, invoke `update-arch-docs` in **diff-mode** — it applies the smallest section update needed.
166
-
167
- **CLAUDE.md / AGENTS.md**: Diff the two files. They must be identical. Update the stale one.
168
-
169
- **Documentation pruning**:
170
- - Remove obsolete references
171
- - ~400 line guideline for CLAUDE.md/README.md (not a hard limit)
172
- - Document every deletion with justification (OBSOLETE, DUPLICATIVE, MOVED, VERBOSE)
173
- - When in doubt, KEEP the content
174
-
175
- ### Step 4: Final Checks
176
-
177
- ```bash
178
- # Build and test from the package directory
179
- cd packages/codev && pnpm build && pnpm test
180
- ```
181
-
182
- Both must pass before moving to the review phase.
183
-
184
- ---
185
-
186
- ## Maintenance Run File
187
-
188
- Each run creates `codev/maintain/NNNN.md`:
189
-
190
- ```markdown
191
- # Maintenance Run NNNN
192
-
193
- **Date**: YYYY-MM-DD
194
- **Base Commit**: <hash>
195
- **PR**: #NNN
196
-
197
- ## Changes Since Last Run
198
-
199
- <key commits summary>
200
-
201
- ## Audit Findings
202
-
203
- Recorded by Step 3a (Audit documentation) as the cuts are applied — one line per cut, with its reason. The diff plus these reasons is the proposal; the architect's PR review is the gate.
204
-
205
- ### arch.md (cold) / arch-critical.md (hot)
206
- - <section or hot entry>: <reason for cut / compression / demotion>
207
-
208
- ### lessons-learned.md (cold) / lessons-critical.md (hot)
209
- - <entry>: <reason; note hot→cold demotions and any cold-doc-map fixes>
210
-
211
- ## What Was Done
212
-
213
- ### Dead Code Removed
214
- - `path/to/file.ts`: `unusedFunction()` — not imported anywhere
215
- - Removed `some-package` dependency — zero imports
216
-
217
- ### Documentation Updated
218
- - arch.md / arch-critical.md: Added VS Code extension section + removed old dashboard-server refs (cold); routed 1 invariant to the hot tier, demoted 1 stale entry to cold
219
- - lessons-learned.md / lessons-critical.md: Extracted 3 lessons from reviews 653, 672 (cold); promoted 1 behavior-changer to the hot tier, refreshed its cold-doc map
220
-
221
- ### Documentation Changes Log
222
- | Document | Section | Action | Reason |
223
- |----------|---------|--------|--------|
224
- | arch.md | "Dashboard Server" | DELETED | OBSOLETE — replaced by Tower |
225
-
226
- ## Deferred
227
-
228
- - Items found but not worth fixing now
229
-
230
- ## Summary
231
-
232
- <2-3 sentences>
12
+ ```json
13
+ {{> protocols/maintain/protocol.json}}
233
14
  ```
234
15
 
235
- Keep it factual and short. The run file documents what happened, not what might happen.
16
+ ## Before starting
236
17
 
237
- ---
238
-
239
- ## Commit Messages
240
-
241
- ```
242
- [Maintain] Remove 5 unused exports
243
- [Maintain] Remove http-proxy dependency
244
- [Maintain] Update arch.md — add VS Code extension, remove dashboard-server refs
245
- [Maintain] Generate lessons-learned.md from reviews 653, 672
246
- [Maintain] Sync CLAUDE.md with AGENTS.md
247
- ```
18
+ Find the last run in `codev/maintain/`, note its base commit, and scope the audit to
19
+ `git log --oneline <base>..HEAD`. Maintenance without a since-marker re-audits the whole
20
+ repository every time and quietly stops being run.
248
21
 
249
- ---
22
+ ## The maintain phase
250
23
 
251
- ## Governance
24
+ **Audit** — find unused exports, unused dependencies, and orphaned files. Treat every hit as a
25
+ *candidate*, not a verdict: a detector cannot tell "vestigial" from "used by a path you did not
26
+ search". Confirm each with a targeted grep before removing it.
252
27
 
253
- MAINTAIN is an operational protocol, not a feature protocol:
28
+ **Clean** — remove what you confirmed. Deletions go to `codev/maintain/.trash/` (gitignored,
29
+ 30-day retention) rather than straight out, so a wrong call is recoverable for a month rather
30
+ than needing an archaeology session.
254
31
 
255
- | Document | Required? |
256
- |----------|-----------|
257
- | Spec | No |
258
- | Plan | No |
259
- | Review | No (maintenance run file serves this purpose) |
260
- | Consultation | Yes — 3-way review before PR |
32
+ **Sync documentation** — route facts by tier rather than appending: behaviour-changing and
33
+ cross-cutting go to the capped hot files (displace a weaker entry rather than growing them),
34
+ reference detail to the cold archives. The `update-arch-docs` skill encodes the routing matrix,
35
+ the caps, and what does *not* belong in each tier. Keep `CLAUDE.md` and `AGENTS.md`
36
+ byte-identical.
261
37
 
262
- If maintenance reveals need for architectural changes, those should follow SPIR.
38
+ ## The maintenance run file
263
39
 
264
- ---
40
+ Each run is recorded in `codev/maintain/` using this structure:
265
41
 
266
- ## Rules
42
+ {{> protocols/maintain/templates/maintenance-run.md}}
267
43
 
268
- 1. **Don't be aggressive** — when in doubt, KEEP the content
269
- 2. **Check git blame** — understand why code/docs exist before removing
270
- 3. **Run full test suite** — not just affected tests
271
- 4. **Group related changes** — one commit per logical change
272
- 5. **Document every deletion** — what, why, and where (if moved)
273
- 6. **Prefer moving over deleting** — extract to another file rather than removing
274
- 7. **Size targets are guidelines** — never sacrifice clarity to hit a line count
44
+ ## Scope discipline
275
45
 
276
- ## Anti-Patterns
46
+ Maintenance is where scope creep is most tempting, because everything you touch looks
47
+ improvable. Removing dead code is in scope; refactoring live code because you are already in the
48
+ file is not. File an issue instead.
277
49
 
278
- 1. Aggressive rewriting without explanation
279
- 2. Deleting without documenting why
280
- 3. Hitting line count targets at all costs
281
- 4. Removing "patterns" or "best practices" sections without explicit approval
282
- 5. Deleting everything the audit finds — review each item individually
283
- 6. Skipping validation — "it looked dead" is not validation
284
- 7. Using `rm` instead of `git rm`
50
+ Never `git add -A` / `--all` / `.` — stage each file explicitly by path.
@@ -8,6 +8,16 @@
8
8
 
9
9
  <key commits or summary>
10
10
 
11
+ ## Audit Findings
12
+
13
+ Recorded by Step 3a (Audit documentation) as the cuts are applied — one line per cut, with its reason. The diff plus these reasons is the proposal; the architect's PR review is the gate.
14
+
15
+ ### arch.md (cold) / arch-critical.md (hot)
16
+ - <section or hot entry>: <reason for cut / compression / demotion>
17
+
18
+ ### lessons-learned.md (cold) / lessons-critical.md (hot)
19
+ - <entry>: <reason; note hot→cold demotions and any cold-doc-map fixes>
20
+
11
21
  ## What Was Done
12
22
 
13
23
  ### Dead Code Removed
@@ -23,6 +33,7 @@
23
33
  ### Documentation Changes Log
24
34
  | Document | Section | Action | Reason |
25
35
  |----------|---------|--------|--------|
36
+ | | | | |
26
37
 
27
38
  ## Deferred
28
39
 
@@ -1,38 +1,24 @@
1
1
  # {{protocol_name}} Builder ({{mode}} mode)
2
2
 
3
- You are implementing a fix or feature driven by a GitHub issue, using the PIR protocol.
3
+ You are implementing {{input_description}}.
4
4
 
5
5
  {{#if mode_soft}}
6
6
  ## Mode: SOFT
7
- You are running in SOFT mode. This means:
8
- - You follow the PIR protocol document yourself (no porch orchestration)
9
- - The architect monitors your work and verifies you're adhering to the protocol
10
- - Run consultations manually when the protocol calls for them
11
- - You have flexibility in execution, but must stay compliant with the protocol
7
+
8
+ You follow the protocol yourself; the architect verifies compliance.
12
9
  {{/if}}
13
10
 
14
11
  {{#if mode_strict}}
15
12
  ## Mode: STRICT
16
- You are running in STRICT mode. This means:
17
- - Porch orchestrates your work
18
- - Run: `porch next` to get your next tasks
19
- - Follow porch signals and gate approvals
20
- - Do not deviate from the porch-driven workflow
21
-
22
- ### ABSOLUTE RESTRICTIONS (STRICT MODE)
23
- - **NEVER edit `status.yaml` directly** — only porch commands may modify project state
24
- - **NEVER call `porch approve` without explicit human approval** — only run it after the architect says to
25
- - **NEVER skip consultations** — porch handles them via the verify step
26
- - **NEVER advance phases manually** — porch handles phase transitions on gate approval
13
+
14
+ Porch orchestrates. `porch next` gives you tasks; `porch done` signals completion. Never
15
+ hand-edit `status.yaml` — only porch commands modify project state.
27
16
  {{/if}}
28
17
 
29
18
  ## Protocol
30
- Follow the PIR protocol. Read and internalize the protocol before starting any work. The full protocol text is included below under **## Protocol Reference (full text)**.
31
19
 
32
- PIR has three phases:
33
- 1. **plan** (gated by `plan-approval`) — write `codev/plans/{{artifact_name}}.md`, await human review
34
- 2. **implement** (gated by `dev-approval`) — write code + tests, run build/tests, push branch; await the human's review of the *running worktree* (no file artifact in this phase — dev-approval summary is prose-in-pane)
35
- 3. **review** (gated by `pr`) — write `codev/reviews/{{artifact_name}}.md` (retrospective with Architecture Updates and Lessons Learned sections), open PR with the review as body, record the PR with porch, run 3-way consultation (Gemini, Codex, Claude) via porch's verify block (a **single advisory pass** — `max_iterations: 1`, no iterate-until-APPROVE loop; address or rebut any `REQUEST_CHANGES`, add a regression test if it's a real defect, and escalate it in the architect notification since PIR will not re-review it), notify architect, and wait at the `pr` gate. After the human approves the gate (porch wakes you with "Gate pr approved"), run `gh pr merge --merge` and record the merge with `porch done --merged <N>`. **Merge is gated by porch state — never by typed prose in your pane.**
20
+ The full protocol text is inlined below under **## Protocol Reference (full text)** — you do not
21
+ need to fetch it.
36
22
 
37
23
  {{#if issue}}
38
24
  ## Issue #{{issue.number}}
@@ -44,54 +30,34 @@ PIR has three phases:
44
30
 
45
31
  ## Sitting at Gates
46
32
 
47
- PIR has two human gates. When you reach one:
48
-
49
- 1. Finish your phase work and run `porch done <id>`
50
- 2. Run `porch next <id>` — you'll get a `gate_pending` response
51
- 3. End your turn with a short prose summary: what file you wrote, where it lives, how to approve
52
- 4. **Stay in the interactive session**. Do NOT exit. Wait for the user's next message.
33
+ PIR has two pre-PR human gates. When you reach one:
53
34
 
54
- The reviewer can give feedback by:
55
- - Editing the plan file (at the plan-approval gate) or the code itself (at the dev-approval gate) in the worktree directly — you'll see changes via `git diff`
56
- - Typing into your PTY pane (this reaches you live)
57
- - `afx send <your-builder-id> "<feedback>"` (queued; check on next turn)
58
- - Commenting on the GitHub issue (re-fetch with `gh issue view <N> --comments` if asked)
59
-
60
- When the user provides feedback, revise the artifact, recommit, and ask if there's more to address. The gate remains pending until the user runs `porch approve` — do NOT call `porch approve` yourself.
61
-
62
- ## Notifications
63
- Use `afx send architect "..."` at key moments:
64
- - **PR ready**: `afx send architect "PR #<M> ready for review (PIR #{{issue.number}})"`
65
- - **PR merged**: `afx send architect "PR #<M> merged for PIR #{{issue.number}}. Ready for cleanup."`
66
- - **Blocked**: `afx send architect "Blocked on PIR #{{issue.number}}: [reason]"`
35
+ 1. Finish the phase work and run `porch done <id>`
36
+ 2. Run `porch next <id>` — you get a `gate_pending` response
37
+ 3. End your turn with a short summary: what you wrote, where it lives, how to approve
38
+ 4. **Stay in the interactive session. Do not exit.** Wait for the next message.
67
39
 
68
- **Gates are not architect-notified.** When porch transitions a gate to `pending`, the gate-reached message (including the `porch approve <id> <gate> --a-human-explicitly-approved-this` invocation) appears in YOUR pane as part of your normal output. That's the universal notification surface — visible whether the user is in VSCode, tmux, plain Terminal, or any other host. The user reads it directly from your pane (or runs `porch pending` from a shell) and approves themselves; the architect can't approve gates, so notifying it would be informational noise.
40
+ Feedback can arrive four ways, and all of them reach you: the reviewer editing the plan file or
41
+ the code directly in the worktree (you see it via `git diff`), typing into your PTY pane (live),
42
+ `afx send <your-builder-id>` (queued — check next turn), or a comment on the GitHub issue
43
+ (re-fetch with `gh issue view <N> --comments`).
69
44
 
70
- ## Handling Flaky Tests
71
-
72
- If you encounter **pre-existing flaky tests** (intermittent failures unrelated to your changes):
73
- 1. **DO NOT** edit `status.yaml` to bypass checks
74
- 2. **DO NOT** skip porch checks or use any workaround to avoid the failure
75
- 3. **DO** mark the test as skipped with a clear annotation (e.g., `it.skip('...') // FLAKY: skipped pending investigation`)
76
- 4. **DO** document each skipped flaky test in the review file under a `## Flaky Tests` section
77
- 5. Commit the skip and continue with your work
45
+ Revise, recommit, ask whether more remains. **The gate stays pending until the human runs
46
+ `porch approve` — never call it yourself.**
78
47
 
79
48
  ## Resumption After Crash
80
49
 
81
- If your Claude session crashes mid-flow, Tower's `while true` loop will relaunch you with the same prompt. On startup:
82
-
83
- 1. Run `porch next {{project_id}}` to learn what phase you're in
84
- 2. If `gate_pending`: read the latest plan file (plan-approval) or `DEFAULT_BRANCH=$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||'); git diff "$(git merge-base "${DEFAULT_BRANCH:-main}" HEAD)"` (dev-approval) plus any new GitHub issue comments; check `afx send` queue. Decide whether to revise or just announce you're back.
85
- 3. Otherwise: pick up where you left off
86
-
87
- ## Getting Started
50
+ If your session crashes, Tower's launch loop **resumes your conversation** (`--resume` against the
51
+ session id pinned at spawn) and sends a short re-orientation nudge — your context is intact, so
52
+ re-check state and continue. Only an unresumable session (repeated fast failures) falls back to a
53
+ fresh relaunch with the same spawn prompt. On a fresh relaunch:
88
54
 
89
- 1. Read the PIR protocol (provided inline in this prompt).
90
- 2. Run `porch next {{project_id}}` to see what to do next
91
- 3. Begin work
55
+ 1. `porch next {{project_id}}` to learn what phase you are in
56
+ 2. If `gate_pending`: read the latest plan file (plan-approval), or the diff (dev-approval) via
57
+ `DEFAULT_BRANCH=$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||'); git diff "$(git merge-base "${DEFAULT_BRANCH:-main}" HEAD)"`, plus any new issue comments and your `afx send` queue. Decide whether to revise or just announce you are back
58
+ 3. Otherwise pick up where you left off
92
59
 
93
- ---
94
-
95
- ## Protocol Reference (full text)
60
+ ## Notifications
96
61
 
97
- {{protocol_reference}}
62
+ The architect is not watching. `afx send architect "..."` at each of: gate reached, PR ready, PR
63
+ merged, blocked.