@cluesmith/codev 2.0.0-rc.5 → 2.0.0-rc.51

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 (330) hide show
  1. package/bin/af.js +2 -2
  2. package/bin/consult.js +1 -1
  3. package/bin/porch.js +6 -35
  4. package/dashboard/dist/assets/index-BIHeqvy0.css +32 -0
  5. package/dashboard/dist/assets/index-VvUWRPNP.js +120 -0
  6. package/dashboard/dist/assets/index-VvUWRPNP.js.map +1 -0
  7. package/dashboard/dist/index.html +14 -0
  8. package/dist/agent-farm/cli.d.ts.map +1 -1
  9. package/dist/agent-farm/cli.js +93 -64
  10. package/dist/agent-farm/cli.js.map +1 -1
  11. package/dist/agent-farm/commands/architect.d.ts.map +1 -1
  12. package/dist/agent-farm/commands/architect.js +13 -6
  13. package/dist/agent-farm/commands/architect.js.map +1 -1
  14. package/dist/agent-farm/commands/attach.d.ts +13 -0
  15. package/dist/agent-farm/commands/attach.d.ts.map +1 -0
  16. package/dist/agent-farm/commands/attach.js +179 -0
  17. package/dist/agent-farm/commands/attach.js.map +1 -0
  18. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
  19. package/dist/agent-farm/commands/cleanup.js +30 -3
  20. package/dist/agent-farm/commands/cleanup.js.map +1 -1
  21. package/dist/agent-farm/commands/consult.js +1 -1
  22. package/dist/agent-farm/commands/consult.js.map +1 -1
  23. package/dist/agent-farm/commands/index.d.ts +2 -2
  24. package/dist/agent-farm/commands/index.d.ts.map +1 -1
  25. package/dist/agent-farm/commands/index.js +2 -2
  26. package/dist/agent-farm/commands/index.js.map +1 -1
  27. package/dist/agent-farm/commands/{util.d.ts → shell.d.ts} +5 -5
  28. package/dist/agent-farm/commands/shell.d.ts.map +1 -0
  29. package/dist/agent-farm/commands/{util.js → shell.js} +23 -36
  30. package/dist/agent-farm/commands/shell.js.map +1 -0
  31. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  32. package/dist/agent-farm/commands/spawn.js +455 -217
  33. package/dist/agent-farm/commands/spawn.js.map +1 -1
  34. package/dist/agent-farm/commands/start.d.ts +3 -0
  35. package/dist/agent-farm/commands/start.d.ts.map +1 -1
  36. package/dist/agent-farm/commands/start.js +92 -79
  37. package/dist/agent-farm/commands/start.js.map +1 -1
  38. package/dist/agent-farm/commands/status.d.ts +2 -0
  39. package/dist/agent-farm/commands/status.d.ts.map +1 -1
  40. package/dist/agent-farm/commands/status.js +56 -1
  41. package/dist/agent-farm/commands/status.js.map +1 -1
  42. package/dist/agent-farm/commands/stop.d.ts +6 -0
  43. package/dist/agent-farm/commands/stop.d.ts.map +1 -1
  44. package/dist/agent-farm/commands/stop.js +115 -11
  45. package/dist/agent-farm/commands/stop.js.map +1 -1
  46. package/dist/agent-farm/commands/tower.d.ts +9 -0
  47. package/dist/agent-farm/commands/tower.d.ts.map +1 -1
  48. package/dist/agent-farm/commands/tower.js +59 -19
  49. package/dist/agent-farm/commands/tower.js.map +1 -1
  50. package/dist/agent-farm/db/index.d.ts.map +1 -1
  51. package/dist/agent-farm/db/index.js +59 -0
  52. package/dist/agent-farm/db/index.js.map +1 -1
  53. package/dist/agent-farm/db/schema.d.ts +2 -2
  54. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  55. package/dist/agent-farm/db/schema.js +8 -3
  56. package/dist/agent-farm/db/schema.js.map +1 -1
  57. package/dist/agent-farm/db/types.d.ts +3 -0
  58. package/dist/agent-farm/db/types.d.ts.map +1 -1
  59. package/dist/agent-farm/db/types.js +3 -0
  60. package/dist/agent-farm/db/types.js.map +1 -1
  61. package/dist/agent-farm/hq-connector.d.ts +2 -2
  62. package/dist/agent-farm/hq-connector.js +2 -2
  63. package/dist/agent-farm/lib/tower-client.d.ts +157 -0
  64. package/dist/agent-farm/lib/tower-client.d.ts.map +1 -0
  65. package/dist/agent-farm/lib/tower-client.js +223 -0
  66. package/dist/agent-farm/lib/tower-client.js.map +1 -0
  67. package/dist/agent-farm/servers/tower-server.js +1155 -99
  68. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  69. package/dist/agent-farm/state.d.ts +4 -10
  70. package/dist/agent-farm/state.d.ts.map +1 -1
  71. package/dist/agent-farm/state.js +30 -31
  72. package/dist/agent-farm/state.js.map +1 -1
  73. package/dist/agent-farm/types.d.ts +48 -0
  74. package/dist/agent-farm/types.d.ts.map +1 -1
  75. package/dist/agent-farm/utils/config.d.ts.map +1 -1
  76. package/dist/agent-farm/utils/config.js +12 -11
  77. package/dist/agent-farm/utils/config.js.map +1 -1
  78. package/dist/agent-farm/utils/deps.d.ts.map +1 -1
  79. package/dist/agent-farm/utils/deps.js +0 -16
  80. package/dist/agent-farm/utils/deps.js.map +1 -1
  81. package/dist/agent-farm/utils/notifications.d.ts +30 -0
  82. package/dist/agent-farm/utils/notifications.d.ts.map +1 -0
  83. package/dist/agent-farm/utils/notifications.js +121 -0
  84. package/dist/agent-farm/utils/notifications.js.map +1 -0
  85. package/dist/agent-farm/utils/server-utils.d.ts +2 -1
  86. package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
  87. package/dist/agent-farm/utils/server-utils.js +11 -1
  88. package/dist/agent-farm/utils/server-utils.js.map +1 -1
  89. package/dist/agent-farm/utils/shell.d.ts +9 -22
  90. package/dist/agent-farm/utils/shell.d.ts.map +1 -1
  91. package/dist/agent-farm/utils/shell.js +34 -34
  92. package/dist/agent-farm/utils/shell.js.map +1 -1
  93. package/dist/agent-farm/utils/terminal-ports.d.ts +1 -1
  94. package/dist/agent-farm/utils/terminal-ports.js +1 -1
  95. package/dist/cli.d.ts.map +1 -1
  96. package/dist/cli.js +5 -54
  97. package/dist/cli.js.map +1 -1
  98. package/dist/commands/adopt.d.ts.map +1 -1
  99. package/dist/commands/adopt.js +39 -4
  100. package/dist/commands/adopt.js.map +1 -1
  101. package/dist/commands/consult/index.d.ts.map +1 -1
  102. package/dist/commands/consult/index.js +63 -3
  103. package/dist/commands/consult/index.js.map +1 -1
  104. package/dist/commands/doctor.d.ts.map +1 -1
  105. package/dist/commands/doctor.js +0 -15
  106. package/dist/commands/doctor.js.map +1 -1
  107. package/dist/commands/init.d.ts.map +1 -1
  108. package/dist/commands/init.js +31 -2
  109. package/dist/commands/init.js.map +1 -1
  110. package/dist/commands/porch/build-counter.d.ts +5 -0
  111. package/dist/commands/porch/build-counter.d.ts.map +1 -0
  112. package/dist/commands/porch/build-counter.js +5 -0
  113. package/dist/commands/porch/build-counter.js.map +1 -0
  114. package/dist/commands/porch/checks.d.ts +16 -29
  115. package/dist/commands/porch/checks.d.ts.map +1 -1
  116. package/dist/commands/porch/checks.js +90 -144
  117. package/dist/commands/porch/checks.js.map +1 -1
  118. package/dist/commands/porch/claude.d.ts +27 -0
  119. package/dist/commands/porch/claude.d.ts.map +1 -0
  120. package/dist/commands/porch/claude.js +107 -0
  121. package/dist/commands/porch/claude.js.map +1 -0
  122. package/dist/commands/porch/index.d.ts +21 -43
  123. package/dist/commands/porch/index.d.ts.map +1 -1
  124. package/dist/commands/porch/index.js +456 -1015
  125. package/dist/commands/porch/index.js.map +1 -1
  126. package/dist/commands/porch/plan.d.ts +70 -0
  127. package/dist/commands/porch/plan.d.ts.map +1 -0
  128. package/dist/commands/porch/plan.js +190 -0
  129. package/dist/commands/porch/plan.js.map +1 -0
  130. package/dist/commands/porch/prompts.d.ts +19 -0
  131. package/dist/commands/porch/prompts.d.ts.map +1 -0
  132. package/dist/commands/porch/prompts.js +250 -0
  133. package/dist/commands/porch/prompts.js.map +1 -0
  134. package/dist/commands/porch/protocol.d.ts +59 -0
  135. package/dist/commands/porch/protocol.d.ts.map +1 -0
  136. package/dist/commands/porch/protocol.js +260 -0
  137. package/dist/commands/porch/protocol.js.map +1 -0
  138. package/dist/commands/porch/run.d.ts +40 -0
  139. package/dist/commands/porch/run.d.ts.map +1 -0
  140. package/dist/commands/porch/run.js +893 -0
  141. package/dist/commands/porch/run.js.map +1 -0
  142. package/dist/commands/porch/state.d.ts +23 -112
  143. package/dist/commands/porch/state.d.ts.map +1 -1
  144. package/dist/commands/porch/state.js +81 -699
  145. package/dist/commands/porch/state.js.map +1 -1
  146. package/dist/commands/porch/types.d.ts +72 -173
  147. package/dist/commands/porch/types.d.ts.map +1 -1
  148. package/dist/commands/porch/types.js +2 -1
  149. package/dist/commands/porch/types.js.map +1 -1
  150. package/dist/commands/update.d.ts.map +1 -1
  151. package/dist/commands/update.js +22 -0
  152. package/dist/commands/update.js.map +1 -1
  153. package/dist/lib/scaffold.d.ts +24 -0
  154. package/dist/lib/scaffold.d.ts.map +1 -1
  155. package/dist/lib/scaffold.js +78 -0
  156. package/dist/lib/scaffold.js.map +1 -1
  157. package/dist/terminal/index.d.ts +8 -0
  158. package/dist/terminal/index.d.ts.map +1 -0
  159. package/dist/terminal/index.js +5 -0
  160. package/dist/terminal/index.js.map +1 -0
  161. package/dist/terminal/pty-manager.d.ts +60 -0
  162. package/dist/terminal/pty-manager.d.ts.map +1 -0
  163. package/dist/terminal/pty-manager.js +334 -0
  164. package/dist/terminal/pty-manager.js.map +1 -0
  165. package/dist/terminal/pty-session.d.ts +79 -0
  166. package/dist/terminal/pty-session.d.ts.map +1 -0
  167. package/dist/terminal/pty-session.js +215 -0
  168. package/dist/terminal/pty-session.js.map +1 -0
  169. package/dist/terminal/ring-buffer.d.ts +27 -0
  170. package/dist/terminal/ring-buffer.d.ts.map +1 -0
  171. package/dist/terminal/ring-buffer.js +74 -0
  172. package/dist/terminal/ring-buffer.js.map +1 -0
  173. package/dist/terminal/ws-protocol.d.ts +27 -0
  174. package/dist/terminal/ws-protocol.d.ts.map +1 -0
  175. package/dist/terminal/ws-protocol.js +44 -0
  176. package/dist/terminal/ws-protocol.js.map +1 -0
  177. package/package.json +18 -3
  178. package/skeleton/DEPENDENCIES.md +3 -29
  179. package/skeleton/builders.md +1 -1
  180. package/skeleton/protocol-schema.json +282 -0
  181. package/skeleton/protocols/bugfix/builder-prompt.md +49 -0
  182. package/skeleton/protocols/bugfix/protocol.json +14 -2
  183. package/skeleton/protocols/experiment/builder-prompt.md +47 -0
  184. package/skeleton/protocols/experiment/protocol.json +101 -0
  185. package/skeleton/protocols/maintain/builder-prompt.md +41 -0
  186. package/skeleton/protocols/maintain/prompts/audit.md +111 -0
  187. package/skeleton/protocols/maintain/prompts/clean.md +91 -0
  188. package/skeleton/protocols/maintain/prompts/sync.md +113 -0
  189. package/skeleton/protocols/maintain/prompts/verify.md +110 -0
  190. package/skeleton/protocols/maintain/protocol.json +141 -0
  191. package/skeleton/protocols/maintain/protocol.md +13 -7
  192. package/skeleton/protocols/protocol-schema.json +53 -0
  193. package/skeleton/protocols/spider/builder-prompt.md +53 -0
  194. package/skeleton/protocols/spider/prompts/implement.md +109 -50
  195. package/skeleton/protocols/spider/prompts/specify.md +29 -4
  196. package/skeleton/protocols/spider/protocol.json +96 -154
  197. package/skeleton/protocols/spider/protocol.md +26 -16
  198. package/skeleton/protocols/spider/templates/plan.md +14 -0
  199. package/skeleton/protocols/tick/builder-prompt.md +51 -0
  200. package/skeleton/protocols/tick/protocol.json +7 -2
  201. package/skeleton/resources/commands/agent-farm.md +25 -43
  202. package/skeleton/resources/commands/overview.md +6 -16
  203. package/skeleton/resources/workflow-reference.md +2 -2
  204. package/skeleton/roles/architect.md +152 -315
  205. package/skeleton/roles/builder.md +109 -218
  206. package/skeleton/templates/AGENTS.md +1 -1
  207. package/skeleton/templates/CLAUDE.md +1 -1
  208. package/skeleton/templates/cheatsheet.md +4 -2
  209. package/templates/dashboard/index.html +17 -43
  210. package/templates/dashboard/js/dialogs.js +7 -7
  211. package/templates/dashboard/js/files.js +2 -2
  212. package/templates/dashboard/js/main.js +3 -3
  213. package/templates/dashboard/js/projects.js +3 -3
  214. package/templates/dashboard/js/tabs.js +1 -1
  215. package/templates/dashboard/js/utils.js +22 -87
  216. package/templates/tower.html +542 -27
  217. package/dist/agent-farm/commands/kickoff.d.ts +0 -19
  218. package/dist/agent-farm/commands/kickoff.d.ts.map +0 -1
  219. package/dist/agent-farm/commands/kickoff.js +0 -331
  220. package/dist/agent-farm/commands/kickoff.js.map +0 -1
  221. package/dist/agent-farm/commands/rename.d.ts +0 -13
  222. package/dist/agent-farm/commands/rename.d.ts.map +0 -1
  223. package/dist/agent-farm/commands/rename.js +0 -33
  224. package/dist/agent-farm/commands/rename.js.map +0 -1
  225. package/dist/agent-farm/commands/tutorial.d.ts +0 -10
  226. package/dist/agent-farm/commands/tutorial.d.ts.map +0 -1
  227. package/dist/agent-farm/commands/tutorial.js +0 -49
  228. package/dist/agent-farm/commands/tutorial.js.map +0 -1
  229. package/dist/agent-farm/commands/util.d.ts.map +0 -1
  230. package/dist/agent-farm/commands/util.js.map +0 -1
  231. package/dist/agent-farm/servers/dashboard-server.d.ts +0 -7
  232. package/dist/agent-farm/servers/dashboard-server.d.ts.map +0 -1
  233. package/dist/agent-farm/servers/dashboard-server.js +0 -1872
  234. package/dist/agent-farm/servers/dashboard-server.js.map +0 -1
  235. package/dist/agent-farm/tutorial/index.d.ts +0 -8
  236. package/dist/agent-farm/tutorial/index.d.ts.map +0 -1
  237. package/dist/agent-farm/tutorial/index.js +0 -8
  238. package/dist/agent-farm/tutorial/index.js.map +0 -1
  239. package/dist/agent-farm/tutorial/prompts.d.ts +0 -57
  240. package/dist/agent-farm/tutorial/prompts.d.ts.map +0 -1
  241. package/dist/agent-farm/tutorial/prompts.js +0 -147
  242. package/dist/agent-farm/tutorial/prompts.js.map +0 -1
  243. package/dist/agent-farm/tutorial/runner.d.ts +0 -52
  244. package/dist/agent-farm/tutorial/runner.d.ts.map +0 -1
  245. package/dist/agent-farm/tutorial/runner.js +0 -204
  246. package/dist/agent-farm/tutorial/runner.js.map +0 -1
  247. package/dist/agent-farm/tutorial/state.d.ts +0 -26
  248. package/dist/agent-farm/tutorial/state.d.ts.map +0 -1
  249. package/dist/agent-farm/tutorial/state.js +0 -89
  250. package/dist/agent-farm/tutorial/state.js.map +0 -1
  251. package/dist/agent-farm/tutorial/steps/first-spec.d.ts +0 -7
  252. package/dist/agent-farm/tutorial/steps/first-spec.d.ts.map +0 -1
  253. package/dist/agent-farm/tutorial/steps/first-spec.js +0 -136
  254. package/dist/agent-farm/tutorial/steps/first-spec.js.map +0 -1
  255. package/dist/agent-farm/tutorial/steps/implementation.d.ts +0 -7
  256. package/dist/agent-farm/tutorial/steps/implementation.d.ts.map +0 -1
  257. package/dist/agent-farm/tutorial/steps/implementation.js +0 -76
  258. package/dist/agent-farm/tutorial/steps/implementation.js.map +0 -1
  259. package/dist/agent-farm/tutorial/steps/index.d.ts +0 -10
  260. package/dist/agent-farm/tutorial/steps/index.d.ts.map +0 -1
  261. package/dist/agent-farm/tutorial/steps/index.js +0 -10
  262. package/dist/agent-farm/tutorial/steps/index.js.map +0 -1
  263. package/dist/agent-farm/tutorial/steps/planning.d.ts +0 -7
  264. package/dist/agent-farm/tutorial/steps/planning.d.ts.map +0 -1
  265. package/dist/agent-farm/tutorial/steps/planning.js +0 -143
  266. package/dist/agent-farm/tutorial/steps/planning.js.map +0 -1
  267. package/dist/agent-farm/tutorial/steps/review.d.ts +0 -7
  268. package/dist/agent-farm/tutorial/steps/review.d.ts.map +0 -1
  269. package/dist/agent-farm/tutorial/steps/review.js +0 -78
  270. package/dist/agent-farm/tutorial/steps/review.js.map +0 -1
  271. package/dist/agent-farm/tutorial/steps/setup.d.ts +0 -7
  272. package/dist/agent-farm/tutorial/steps/setup.d.ts.map +0 -1
  273. package/dist/agent-farm/tutorial/steps/setup.js +0 -126
  274. package/dist/agent-farm/tutorial/steps/setup.js.map +0 -1
  275. package/dist/agent-farm/tutorial/steps/welcome.d.ts +0 -7
  276. package/dist/agent-farm/tutorial/steps/welcome.d.ts.map +0 -1
  277. package/dist/agent-farm/tutorial/steps/welcome.js +0 -50
  278. package/dist/agent-farm/tutorial/steps/welcome.js.map +0 -1
  279. package/dist/commands/pcheck/cache.d.ts +0 -48
  280. package/dist/commands/pcheck/cache.d.ts.map +0 -1
  281. package/dist/commands/pcheck/cache.js +0 -170
  282. package/dist/commands/pcheck/cache.js.map +0 -1
  283. package/dist/commands/pcheck/evaluator.d.ts +0 -15
  284. package/dist/commands/pcheck/evaluator.d.ts.map +0 -1
  285. package/dist/commands/pcheck/evaluator.js +0 -246
  286. package/dist/commands/pcheck/evaluator.js.map +0 -1
  287. package/dist/commands/pcheck/index.d.ts +0 -12
  288. package/dist/commands/pcheck/index.d.ts.map +0 -1
  289. package/dist/commands/pcheck/index.js +0 -249
  290. package/dist/commands/pcheck/index.js.map +0 -1
  291. package/dist/commands/pcheck/parser.d.ts +0 -39
  292. package/dist/commands/pcheck/parser.d.ts.map +0 -1
  293. package/dist/commands/pcheck/parser.js +0 -155
  294. package/dist/commands/pcheck/parser.js.map +0 -1
  295. package/dist/commands/pcheck/types.d.ts +0 -82
  296. package/dist/commands/pcheck/types.d.ts.map +0 -1
  297. package/dist/commands/pcheck/types.js +0 -5
  298. package/dist/commands/pcheck/types.js.map +0 -1
  299. package/dist/commands/porch/consultation.d.ts +0 -56
  300. package/dist/commands/porch/consultation.d.ts.map +0 -1
  301. package/dist/commands/porch/consultation.js +0 -330
  302. package/dist/commands/porch/consultation.js.map +0 -1
  303. package/dist/commands/porch/notifications.d.ts +0 -99
  304. package/dist/commands/porch/notifications.d.ts.map +0 -1
  305. package/dist/commands/porch/notifications.js +0 -223
  306. package/dist/commands/porch/notifications.js.map +0 -1
  307. package/dist/commands/porch/plan-parser.d.ts +0 -38
  308. package/dist/commands/porch/plan-parser.d.ts.map +0 -1
  309. package/dist/commands/porch/plan-parser.js +0 -166
  310. package/dist/commands/porch/plan-parser.js.map +0 -1
  311. package/dist/commands/porch/protocol-loader.d.ts +0 -46
  312. package/dist/commands/porch/protocol-loader.d.ts.map +0 -1
  313. package/dist/commands/porch/protocol-loader.js +0 -253
  314. package/dist/commands/porch/protocol-loader.js.map +0 -1
  315. package/dist/commands/porch/signal-parser.d.ts +0 -88
  316. package/dist/commands/porch/signal-parser.d.ts.map +0 -1
  317. package/dist/commands/porch/signal-parser.js +0 -148
  318. package/dist/commands/porch/signal-parser.js.map +0 -1
  319. package/dist/commands/tower.d.ts +0 -16
  320. package/dist/commands/tower.d.ts.map +0 -1
  321. package/dist/commands/tower.js +0 -21
  322. package/dist/commands/tower.js.map +0 -1
  323. package/skeleton/config.json +0 -7
  324. package/skeleton/porch/protocols/bugfix.json +0 -85
  325. package/skeleton/porch/protocols/spider.json +0 -135
  326. package/skeleton/porch/protocols/tick.json +0 -76
  327. package/skeleton/protocols/spider/prompts/defend.md +0 -215
  328. package/skeleton/protocols/spider/prompts/evaluate.md +0 -241
  329. package/templates/dashboard/css/activity.css +0 -151
  330. package/templates/dashboard/js/activity.js +0 -112
@@ -0,0 +1,282 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://codev.dev/protocol-schema.json",
4
+ "title": "Codev Protocol Definition",
5
+ "description": "Schema for porch protocol definitions (SPIDER, TICK, BUGFIX, etc.)",
6
+ "type": "object",
7
+ "required": ["name", "phases"],
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string",
11
+ "description": "JSON Schema reference"
12
+ },
13
+ "name": {
14
+ "type": "string",
15
+ "description": "Protocol name (e.g., 'spider', 'tick', 'bugfix')",
16
+ "pattern": "^[a-z][a-z0-9-]*$"
17
+ },
18
+ "alias": {
19
+ "type": "string",
20
+ "description": "Alternative name for the protocol (e.g., 'spir' for spider)"
21
+ },
22
+ "version": {
23
+ "type": "string",
24
+ "description": "Semantic version of the protocol",
25
+ "pattern": "^\\d+\\.\\d+\\.\\d+(-[a-z0-9.]+)?$"
26
+ },
27
+ "description": {
28
+ "type": "string",
29
+ "description": "Human-readable description of the protocol"
30
+ },
31
+ "phases": {
32
+ "type": "array",
33
+ "description": "Ordered list of protocol phases",
34
+ "minItems": 1,
35
+ "items": { "$ref": "#/$defs/phase" }
36
+ },
37
+ "signals": {
38
+ "type": "object",
39
+ "description": "Signals that can be emitted during protocol execution",
40
+ "additionalProperties": { "$ref": "#/$defs/signal" }
41
+ },
42
+ "phase_completion": {
43
+ "type": "object",
44
+ "description": "Checks run when a plan phase completes",
45
+ "additionalProperties": {
46
+ "type": "string",
47
+ "description": "Shell command to run"
48
+ }
49
+ },
50
+ "defaults": {
51
+ "type": "object",
52
+ "description": "Default values for phase properties",
53
+ "properties": {
54
+ "max_iterations": {
55
+ "type": "integer",
56
+ "minimum": 1,
57
+ "maximum": 20,
58
+ "default": 7
59
+ },
60
+ "verify": { "$ref": "#/$defs/verifyConfig" }
61
+ }
62
+ }
63
+ },
64
+ "$defs": {
65
+ "phase": {
66
+ "type": "object",
67
+ "required": ["id", "name"],
68
+ "properties": {
69
+ "id": {
70
+ "type": "string",
71
+ "description": "Unique phase identifier",
72
+ "pattern": "^[a-z][a-z0-9_-]*$"
73
+ },
74
+ "name": {
75
+ "type": "string",
76
+ "description": "Human-readable phase name"
77
+ },
78
+ "description": {
79
+ "type": "string",
80
+ "description": "What this phase does"
81
+ },
82
+ "type": {
83
+ "type": "string",
84
+ "enum": ["once", "build_verify", "per_plan_phase"],
85
+ "description": "Phase execution type",
86
+ "default": "build_verify"
87
+ },
88
+ "build": { "$ref": "#/$defs/buildConfig" },
89
+ "verify": { "$ref": "#/$defs/verifyConfig" },
90
+ "max_iterations": {
91
+ "type": "integer",
92
+ "description": "Maximum build-verify iterations before failing",
93
+ "minimum": 1,
94
+ "maximum": 20,
95
+ "default": 7
96
+ },
97
+ "on_complete": { "$ref": "#/$defs/onCompleteConfig" },
98
+ "checks": {
99
+ "type": "object",
100
+ "description": "Named checks to run during this phase",
101
+ "additionalProperties": { "$ref": "#/$defs/check" }
102
+ },
103
+ "gate": {
104
+ "oneOf": [
105
+ {
106
+ "type": "string",
107
+ "description": "Gate name (simple format)",
108
+ "pattern": "^[a-z][a-z0-9-]*$"
109
+ },
110
+ {
111
+ "$ref": "#/$defs/gateConfig",
112
+ "description": "Gate with options (extended format)"
113
+ }
114
+ ]
115
+ },
116
+ "transition": { "$ref": "#/$defs/transitionConfig" },
117
+ "next": {
118
+ "oneOf": [
119
+ { "type": "string", "description": "Next phase id" },
120
+ { "type": "null", "description": "Terminal phase" }
121
+ ]
122
+ }
123
+ }
124
+ },
125
+ "buildConfig": {
126
+ "type": "object",
127
+ "description": "Configuration for the build step",
128
+ "required": ["prompt", "artifact"],
129
+ "properties": {
130
+ "prompt": {
131
+ "type": "string",
132
+ "description": "Prompt file name (e.g., 'specify.md')"
133
+ },
134
+ "artifact": {
135
+ "type": "string",
136
+ "description": "Artifact path pattern with ${PROJECT_ID} variable"
137
+ }
138
+ }
139
+ },
140
+ "verifyConfig": {
141
+ "type": "object",
142
+ "description": "Configuration for 3-way verification",
143
+ "required": ["type", "models"],
144
+ "properties": {
145
+ "type": {
146
+ "type": "string",
147
+ "description": "Review type (maps to consult --type)",
148
+ "enum": ["spec-review", "plan-review", "impl-review", "pr-ready", "integration-review"]
149
+ },
150
+ "models": {
151
+ "type": "array",
152
+ "description": "Models to consult",
153
+ "items": {
154
+ "type": "string",
155
+ "enum": ["gemini", "codex", "claude"]
156
+ },
157
+ "minItems": 1
158
+ },
159
+ "parallel": {
160
+ "type": "boolean",
161
+ "description": "Run consultations in parallel",
162
+ "default": true
163
+ }
164
+ }
165
+ },
166
+ "onCompleteConfig": {
167
+ "type": "object",
168
+ "description": "Actions to perform after successful verification",
169
+ "properties": {
170
+ "commit": {
171
+ "type": "boolean",
172
+ "description": "Commit artifact to git",
173
+ "default": false
174
+ },
175
+ "push": {
176
+ "type": "boolean",
177
+ "description": "Push commit to remote",
178
+ "default": false
179
+ }
180
+ }
181
+ },
182
+ "check": {
183
+ "oneOf": [
184
+ {
185
+ "type": "string",
186
+ "description": "Simple shell command"
187
+ },
188
+ {
189
+ "type": "object",
190
+ "description": "Check with options",
191
+ "required": ["command"],
192
+ "properties": {
193
+ "command": {
194
+ "type": "string",
195
+ "description": "Shell command to run"
196
+ },
197
+ "description": {
198
+ "type": "string",
199
+ "description": "Human-readable description"
200
+ },
201
+ "on_fail": {
202
+ "type": "string",
203
+ "enum": ["fail", "retry", "warn"],
204
+ "description": "Action on failure",
205
+ "default": "fail"
206
+ },
207
+ "max_retries": {
208
+ "type": "integer",
209
+ "description": "Maximum retry attempts",
210
+ "minimum": 0,
211
+ "maximum": 10,
212
+ "default": 0
213
+ },
214
+ "optional": {
215
+ "type": "boolean",
216
+ "description": "Don't fail protocol if check fails",
217
+ "default": false
218
+ }
219
+ }
220
+ }
221
+ ]
222
+ },
223
+ "transitionConfig": {
224
+ "type": "object",
225
+ "description": "Transition rules for per_plan_phase types",
226
+ "properties": {
227
+ "on_complete": {
228
+ "type": "string",
229
+ "description": "Phase to transition to after each plan phase"
230
+ },
231
+ "on_all_phases_complete": {
232
+ "type": "string",
233
+ "description": "Phase to transition to when all plan phases complete"
234
+ }
235
+ }
236
+ },
237
+ "signal": {
238
+ "type": "object",
239
+ "description": "Signal definition",
240
+ "properties": {
241
+ "description": {
242
+ "type": "string"
243
+ },
244
+ "transitions_to": {
245
+ "type": "string",
246
+ "description": "State to transition to when signal received"
247
+ },
248
+ "requires": {
249
+ "type": "string",
250
+ "description": "Required parameter name"
251
+ }
252
+ }
253
+ },
254
+ "gateConfig": {
255
+ "type": "object",
256
+ "description": "Gate with extended configuration",
257
+ "required": ["name"],
258
+ "properties": {
259
+ "name": {
260
+ "type": "string",
261
+ "description": "Gate identifier",
262
+ "pattern": "^[a-z][a-z0-9-]*$"
263
+ },
264
+ "description": {
265
+ "type": "string",
266
+ "description": "Human-readable description"
267
+ },
268
+ "requires": {
269
+ "type": "array",
270
+ "description": "Check names that must pass before gate can be approved",
271
+ "items": { "type": "string" }
272
+ },
273
+ "next": {
274
+ "oneOf": [
275
+ { "type": "string", "description": "Next phase after gate approval" },
276
+ { "type": "null", "description": "Terminal gate" }
277
+ ]
278
+ }
279
+ }
280
+ }
281
+ }
282
+ }
@@ -0,0 +1,49 @@
1
+ # {{protocol_name}} Builder ({{mode}} mode)
2
+
3
+ You are implementing {{input_description}}.
4
+
5
+ {{#if mode_soft}}
6
+ ## Mode: SOFT
7
+ You are running in SOFT mode. This means:
8
+ - You follow the BUGFIX protocol yourself (no porch orchestration)
9
+ - The architect monitors your work and verifies you're adhering to the protocol
10
+ - Run consultations manually when the protocol calls for them
11
+ - You have flexibility in execution, but must stay compliant with the protocol
12
+ {{/if}}
13
+
14
+ {{#if mode_strict}}
15
+ ## Mode: STRICT
16
+ You are running in STRICT mode. This means:
17
+ - Porch orchestrates your work
18
+ - Run: `porch run {{project_id}}`
19
+ - Follow porch signals and gate approvals
20
+ {{/if}}
21
+
22
+ ## Protocol
23
+ Follow the BUGFIX protocol: `codev/protocols/bugfix/protocol.md`
24
+
25
+ {{#if issue}}
26
+ ## Issue #{{issue.number}}
27
+ **Title**: {{issue.title}}
28
+
29
+ **Description**:
30
+ {{issue.body}}
31
+
32
+ ## Your Mission
33
+ 1. Reproduce the bug
34
+ 2. Identify root cause
35
+ 3. Implement fix (< 300 LOC)
36
+ 4. Add regression test
37
+ 5. Run CMAP review (3-way parallel: Gemini, Codex, Claude)
38
+ 6. Create PR with "Fixes #{{issue.number}}" in body
39
+
40
+ If the fix is too complex (> 300 LOC or architectural changes), notify the Architect via:
41
+ ```bash
42
+ af send architect "Issue #{{issue.number}} is more complex than expected. [Reason]. Recommend escalating to SPIDER/TICK."
43
+ ```
44
+ {{/if}}
45
+
46
+ ## Getting Started
47
+ 1. Read the BUGFIX protocol
48
+ 2. Review the issue details
49
+ 3. Reproduce the bug before fixing
@@ -1,8 +1,19 @@
1
1
  {
2
2
  "$schema": "../../protocol-schema.json",
3
3
  "name": "bugfix",
4
- "version": "1.0.0",
4
+ "version": "1.1.0",
5
5
  "description": "Lightweight protocol for minor bugfixes using GitHub Issues",
6
+ "input": {
7
+ "type": "github-issue",
8
+ "required": false,
9
+ "default_for": ["--issue", "-i"]
10
+ },
11
+ "hooks": {
12
+ "pre-spawn": {
13
+ "collision-check": true,
14
+ "comment-on-issue": "On it! Working on a fix now."
15
+ }
16
+ },
6
17
  "phases": [
7
18
  {
8
19
  "id": "investigate",
@@ -105,7 +116,7 @@
105
116
  "transitions_to": "next_phase"
106
117
  },
107
118
  "TOO_COMPLEX": {
108
- "description": "Bug is too complex for BUGFIX, escalate to SPIDER",
119
+ "description": "Bug is too complex for BUGFIX, escalate to SPIR",
109
120
  "transitions_to": "escalate"
110
121
  },
111
122
  "BLOCKED": {
@@ -114,6 +125,7 @@
114
125
  }
115
126
  },
116
127
  "defaults": {
128
+ "mode": "soft",
117
129
  "consultation": {
118
130
  "enabled": true,
119
131
  "models": ["gemini", "codex"],
@@ -0,0 +1,47 @@
1
+ # {{protocol_name}} Builder ({{mode}} mode)
2
+
3
+ You are executing a disciplined experiment.
4
+
5
+ {{#if mode_soft}}
6
+ ## Mode: SOFT
7
+ You are running in SOFT mode. This means:
8
+ - You follow the EXPERIMENT protocol yourself (no porch orchestration)
9
+ - The architect monitors your work and verifies you're adhering to the protocol
10
+ - Document your findings thoroughly
11
+ {{/if}}
12
+
13
+ {{#if mode_strict}}
14
+ ## Mode: STRICT
15
+ You are running in STRICT mode. This means:
16
+ - Porch orchestrates your work
17
+ - Run: `porch run {{project_id}}`
18
+ - Follow porch signals and gate approvals
19
+ {{/if}}
20
+
21
+ ## Protocol
22
+ Follow the EXPERIMENT protocol: `codev/protocols/experiment/protocol.md`
23
+
24
+ ## EXPERIMENT Overview
25
+ The EXPERIMENT protocol ensures disciplined experimentation:
26
+
27
+ 1. **Hypothesis Phase**: Define what you're testing and success criteria
28
+ 2. **Design Phase**: Plan the experiment approach
29
+ 3. **Execute Phase**: Run the experiment and gather data
30
+ 4. **Analyze Phase**: Evaluate results and draw conclusions
31
+
32
+ {{#if task}}
33
+ ## Experiment Focus
34
+ {{task_text}}
35
+ {{/if}}
36
+
37
+ ## Key Principles
38
+ - Start with a clear, falsifiable hypothesis
39
+ - Define success/failure criteria upfront
40
+ - Keep scope minimal for quick iteration
41
+ - Document findings regardless of outcome
42
+ - Separate experiment artifacts from production code
43
+
44
+ ## Getting Started
45
+ 1. Read the EXPERIMENT protocol document
46
+ 2. Define your hypothesis clearly
47
+ 3. Follow the phases in order
@@ -0,0 +1,101 @@
1
+ {
2
+ "$schema": "../../protocol-schema.json",
3
+ "name": "experiment",
4
+ "version": "1.0.0",
5
+ "description": "Disciplined experimentation with hypothesis testing",
6
+ "input": {
7
+ "type": "none",
8
+ "required": false,
9
+ "default_for": []
10
+ },
11
+ "hooks": {
12
+ "pre-spawn": {}
13
+ },
14
+ "phases": [
15
+ {
16
+ "id": "hypothesis",
17
+ "name": "Hypothesis",
18
+ "description": "Define the hypothesis and success criteria",
19
+ "type": "once",
20
+ "steps": [
21
+ "define_hypothesis",
22
+ "define_success_criteria",
23
+ "define_scope",
24
+ "create_experiment_doc"
25
+ ],
26
+ "transition": {
27
+ "on_complete": "design"
28
+ }
29
+ },
30
+ {
31
+ "id": "design",
32
+ "name": "Design",
33
+ "description": "Design the experiment approach",
34
+ "type": "once",
35
+ "steps": [
36
+ "choose_approach",
37
+ "identify_dependencies",
38
+ "plan_implementation",
39
+ "define_measurements"
40
+ ],
41
+ "transition": {
42
+ "on_complete": "execute"
43
+ }
44
+ },
45
+ {
46
+ "id": "execute",
47
+ "name": "Execute",
48
+ "description": "Run the experiment",
49
+ "type": "once",
50
+ "steps": [
51
+ "implement_prototype",
52
+ "gather_data",
53
+ "document_findings"
54
+ ],
55
+ "transition": {
56
+ "on_complete": "analyze"
57
+ }
58
+ },
59
+ {
60
+ "id": "analyze",
61
+ "name": "Analyze",
62
+ "description": "Analyze results and draw conclusions",
63
+ "type": "once",
64
+ "steps": [
65
+ "analyze_data",
66
+ "evaluate_hypothesis",
67
+ "document_conclusions",
68
+ "recommend_next_steps"
69
+ ],
70
+ "gate": {
71
+ "name": "experiment-complete",
72
+ "description": "Experiment complete",
73
+ "requires": ["conclusions_documented"],
74
+ "next": null
75
+ }
76
+ }
77
+ ],
78
+ "signals": {
79
+ "PHASE_COMPLETE": {
80
+ "description": "Signal current phase is complete",
81
+ "transitions_to": "next_phase"
82
+ },
83
+ "BLOCKED": {
84
+ "description": "Signal experiment is blocked",
85
+ "requires": "reason"
86
+ },
87
+ "HYPOTHESIS_REJECTED": {
88
+ "description": "Signal hypothesis was disproven",
89
+ "transitions_to": "analyze"
90
+ }
91
+ },
92
+ "defaults": {
93
+ "mode": "soft",
94
+ "consultation": {
95
+ "enabled": false,
96
+ "models": [],
97
+ "parallel": false
98
+ },
99
+ "checks": {}
100
+ }
101
+ }
@@ -0,0 +1,41 @@
1
+ # {{protocol_name}} Builder ({{mode}} mode)
2
+
3
+ You are executing the MAINTAIN protocol to clean up and synchronize the codebase.
4
+
5
+ {{#if mode_soft}}
6
+ ## Mode: SOFT
7
+ You are running in SOFT mode. This means:
8
+ - You follow the MAINTAIN protocol yourself (no porch orchestration)
9
+ - The architect monitors your work and verifies you're adhering to the protocol
10
+ - Work through each phase methodically
11
+ {{/if}}
12
+
13
+ {{#if mode_strict}}
14
+ ## Mode: STRICT
15
+ You are running in STRICT mode. This means:
16
+ - Porch orchestrates your work
17
+ - Run: `porch run {{project_id}}`
18
+ - Follow porch signals and gate approvals
19
+ {{/if}}
20
+
21
+ ## Protocol
22
+ Follow the MAINTAIN protocol: `codev/protocols/maintain/protocol.md`
23
+
24
+ ## MAINTAIN Overview
25
+ The MAINTAIN protocol handles codebase hygiene:
26
+
27
+ 1. **Audit Phase**: Scan for dead code, unused dependencies, stale docs
28
+ 2. **Clean Phase**: Remove identified cruft, verify build
29
+ 3. **Sync Phase**: Update documentation (arch.md, lessons-learned.md, CLAUDE.md)
30
+ 4. **Verify Phase**: Run full test suite, confirm health
31
+
32
+ ## Key Rules
33
+ - Use soft deletion (move to `codev/maintain/.trash/`)
34
+ - Always verify build passes after removals
35
+ - Update documentation to match current architecture
36
+ - Don't remove anything actively used
37
+
38
+ ## Getting Started
39
+ 1. Read the MAINTAIN protocol document
40
+ 2. Start with the Audit phase
41
+ 3. Document all changes made
@@ -0,0 +1,111 @@
1
+ # AUDIT Phase Prompt
2
+
3
+ You are executing the **AUDIT** phase of the MAINTAIN protocol.
4
+
5
+ ## Your Goal
6
+
7
+ Analyze the codebase to identify dead code, unused dependencies, and stale documentation.
8
+
9
+ ## Context
10
+
11
+ - **Current State**: {{current_state}}
12
+
13
+ ## Process
14
+
15
+ ### 1. Determine Base Commit
16
+
17
+ Find the last maintenance run:
18
+ ```bash
19
+ ls codev/maintain/
20
+ ```
21
+
22
+ If previous runs exist, note the base commit to focus on changes since then.
23
+
24
+ ### 2. Scan for Dead Code
25
+
26
+ Run static analysis tools:
27
+
28
+ ```bash
29
+ # TypeScript/JavaScript
30
+ npx ts-prune 2>/dev/null || echo "ts-prune not available"
31
+ npx depcheck 2>/dev/null || echo "depcheck not available"
32
+
33
+ # Check for unused exports
34
+ grep -r "export " --include="*.ts" --include="*.tsx" | head -50
35
+ ```
36
+
37
+ ### 3. Scan for Unused Dependencies
38
+
39
+ Check package.json for unused dependencies:
40
+ ```bash
41
+ cat package.json | grep -A100 '"dependencies"' | head -50
42
+ ```
43
+
44
+ Cross-reference with actual imports in the codebase.
45
+
46
+ ### 4. Scan for Stale Documentation
47
+
48
+ Check for references to deleted files/functions:
49
+ ```bash
50
+ # Recent changes
51
+ git log --oneline -20
52
+
53
+ # Check if arch.md references exist
54
+ grep -E "src/|packages/" codev/resources/arch.md | head -20
55
+ ```
56
+
57
+ ### 5. Create Audit Report
58
+
59
+ Create a maintenance run file: `codev/maintain/NNNN.md`
60
+
61
+ Document:
62
+ - Dead code identified (with file paths)
63
+ - Unused dependencies
64
+ - Stale documentation references
65
+ - Recommended actions
66
+
67
+ Use the template structure:
68
+ ```markdown
69
+ # Maintenance Run NNNN
70
+
71
+ **Date**: YYYY-MM-DD
72
+ **Base Commit**: <commit-hash>
73
+
74
+ ## Dead Code Identified
75
+
76
+ | File | Item | Reason |
77
+ |------|------|--------|
78
+ | path/to/file.ts | unusedFunction() | Not imported anywhere |
79
+
80
+ ## Unused Dependencies
81
+
82
+ | Package | Reason |
83
+ |---------|--------|
84
+ | some-pkg | Not imported |
85
+
86
+ ## Stale Documentation
87
+
88
+ | Document | Issue |
89
+ |----------|-------|
90
+ | arch.md | References deleted module |
91
+
92
+ ## Recommended Actions
93
+
94
+ 1. Remove X
95
+ 2. Update Y
96
+ 3. ...
97
+ ```
98
+
99
+ ## Signals
100
+
101
+ When audit report is complete:
102
+
103
+ ```
104
+ <signal>PHASE_COMPLETE</signal>
105
+ ```
106
+
107
+ If blocked:
108
+
109
+ ```
110
+ <signal>BLOCKED:reason</signal>
111
+ ```