@provos/ironcurtain 0.11.0 → 0.13.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 (472) hide show
  1. package/README.md +23 -19
  2. package/dist/cli-help.d.ts +12 -0
  3. package/dist/cli-help.js +21 -0
  4. package/dist/cli-help.js.map +1 -1
  5. package/dist/cli.js +14 -6
  6. package/dist/cli.js.map +1 -1
  7. package/dist/config/agent-model-guard.d.ts +14 -0
  8. package/dist/config/agent-model-guard.js +24 -0
  9. package/dist/config/agent-model-guard.js.map +1 -0
  10. package/dist/config/config-command.d.ts +33 -1
  11. package/dist/config/config-command.js +723 -11
  12. package/dist/config/config-command.js.map +1 -1
  13. package/dist/config/first-start.js +2 -8
  14. package/dist/config/first-start.js.map +1 -1
  15. package/dist/config/model-provider.d.ts +9 -0
  16. package/dist/config/model-provider.js +13 -0
  17. package/dist/config/model-provider.js.map +1 -1
  18. package/dist/config/openrouter-catalog.d.ts +46 -0
  19. package/dist/config/openrouter-catalog.js +111 -0
  20. package/dist/config/openrouter-catalog.js.map +1 -0
  21. package/dist/config/openrouter-models-fallback.d.ts +15 -0
  22. package/dist/config/openrouter-models-fallback.js +49 -0
  23. package/dist/config/openrouter-models-fallback.js.map +1 -0
  24. package/dist/config/paths.d.ts +48 -6
  25. package/dist/config/paths.js +63 -8
  26. package/dist/config/paths.js.map +1 -1
  27. package/dist/config/types.d.ts +8 -0
  28. package/dist/config/user-config.d.ts +179 -6
  29. package/dist/config/user-config.js +282 -5
  30. package/dist/config/user-config.js.map +1 -1
  31. package/dist/daemon/daemon-command.js +14 -5
  32. package/dist/daemon/daemon-command.js.map +1 -1
  33. package/dist/daemon/ironcurtain-daemon.d.ts +18 -0
  34. package/dist/daemon/ironcurtain-daemon.js +28 -1
  35. package/dist/daemon/ironcurtain-daemon.js.map +1 -1
  36. package/dist/daemon-client/daemon-client.d.ts +123 -0
  37. package/dist/daemon-client/daemon-client.js +324 -0
  38. package/dist/daemon-client/daemon-client.js.map +1 -0
  39. package/dist/docker/adapters/claude-code.js +109 -1
  40. package/dist/docker/adapters/claude-code.js.map +1 -1
  41. package/dist/docker/adapters/codex.d.ts +18 -0
  42. package/dist/docker/adapters/codex.js +376 -0
  43. package/dist/docker/adapters/codex.js.map +1 -0
  44. package/dist/docker/adapters/goose.js +38 -2
  45. package/dist/docker/adapters/goose.js.map +1 -1
  46. package/dist/docker/agent-adapter.d.ts +34 -6
  47. package/dist/docker/agent-adapter.js +2 -0
  48. package/dist/docker/agent-adapter.js.map +1 -1
  49. package/dist/docker/agent-registry.js +5 -0
  50. package/dist/docker/agent-registry.js.map +1 -1
  51. package/dist/docker/apple-container-manager.d.ts +49 -0
  52. package/dist/docker/apple-container-manager.js +486 -0
  53. package/dist/docker/apple-container-manager.js.map +1 -0
  54. package/dist/docker/ca.js +9 -2
  55. package/dist/docker/ca.js.map +1 -1
  56. package/dist/docker/code-mode-proxy.d.ts +11 -0
  57. package/dist/docker/code-mode-proxy.js +3 -1
  58. package/dist/docker/code-mode-proxy.js.map +1 -1
  59. package/dist/docker/container-lifecycle.d.ts +2 -2
  60. package/dist/docker/container-lifecycle.js +9 -0
  61. package/dist/docker/container-lifecycle.js.map +1 -1
  62. package/dist/docker/container-runtime.d.ts +29 -0
  63. package/dist/docker/container-runtime.js +76 -0
  64. package/dist/docker/container-runtime.js.map +1 -0
  65. package/dist/docker/docker-agent-session.d.ts +31 -0
  66. package/dist/docker/docker-agent-session.js +97 -7
  67. package/dist/docker/docker-agent-session.js.map +1 -1
  68. package/dist/docker/docker-infrastructure.d.ts +232 -15
  69. package/dist/docker/docker-infrastructure.js +762 -118
  70. package/dist/docker/docker-infrastructure.js.map +1 -1
  71. package/dist/docker/docker-manager.d.ts +25 -5
  72. package/dist/docker/docker-manager.js +388 -21
  73. package/dist/docker/docker-manager.js.map +1 -1
  74. package/dist/docker/docker-probe.d.ts +45 -0
  75. package/dist/docker/docker-probe.js +86 -0
  76. package/dist/docker/docker-probe.js.map +1 -0
  77. package/dist/docker/docker-progress-sink.d.ts +1 -1
  78. package/dist/docker/docker-resource-lifecycle.d.ts +71 -0
  79. package/dist/docker/docker-resource-lifecycle.js +454 -0
  80. package/dist/docker/docker-resource-lifecycle.js.map +1 -0
  81. package/dist/docker/gc-command.d.ts +2 -0
  82. package/dist/docker/gc-command.js +37 -0
  83. package/dist/docker/gc-command.js.map +1 -0
  84. package/dist/docker/mitm-proxy.d.ts +58 -5
  85. package/dist/docker/mitm-proxy.js +338 -26
  86. package/dist/docker/mitm-proxy.js.map +1 -1
  87. package/dist/docker/network-topology.d.ts +88 -0
  88. package/dist/docker/network-topology.js +167 -0
  89. package/dist/docker/network-topology.js.map +1 -0
  90. package/dist/docker/oauth-credentials.d.ts +13 -0
  91. package/dist/docker/oauth-credentials.js +125 -0
  92. package/dist/docker/oauth-credentials.js.map +1 -1
  93. package/dist/docker/openrouter.d.ts +107 -0
  94. package/dist/docker/openrouter.js +236 -0
  95. package/dist/docker/openrouter.js.map +1 -0
  96. package/dist/docker/orientation.js +1 -1
  97. package/dist/docker/orientation.js.map +1 -1
  98. package/dist/docker/package-types.d.ts +1 -1
  99. package/dist/docker/platform.d.ts +3 -1
  100. package/dist/docker/platform.js +3 -1
  101. package/dist/docker/platform.js.map +1 -1
  102. package/dist/docker/provider-config.d.ts +35 -1
  103. package/dist/docker/provider-config.js +93 -3
  104. package/dist/docker/provider-config.js.map +1 -1
  105. package/dist/docker/provision-lock.d.ts +46 -0
  106. package/dist/docker/provision-lock.js +152 -0
  107. package/dist/docker/provision-lock.js.map +1 -0
  108. package/dist/docker/pty-session.d.ts +22 -0
  109. package/dist/docker/pty-session.js +238 -84
  110. package/dist/docker/pty-session.js.map +1 -1
  111. package/dist/docker/pty-types.d.ts +15 -0
  112. package/dist/docker/pty-types.js +8 -0
  113. package/dist/docker/pty-types.js.map +1 -1
  114. package/dist/docker/registry-proxy.d.ts +46 -0
  115. package/dist/docker/registry-proxy.js +255 -1
  116. package/dist/docker/registry-proxy.js.map +1 -1
  117. package/dist/docker/resource-limits.d.ts +14 -5
  118. package/dist/docker/resource-limits.js +11 -8
  119. package/dist/docker/resource-limits.js.map +1 -1
  120. package/dist/docker/sse-extractor.js +55 -5
  121. package/dist/docker/sse-extractor.js.map +1 -1
  122. package/dist/docker/stream-delay.d.ts +86 -0
  123. package/dist/docker/stream-delay.js +218 -0
  124. package/dist/docker/stream-delay.js.map +1 -0
  125. package/dist/docker/token-stream-types.d.ts +15 -0
  126. package/dist/docker/trajectory-capture.d.ts +79 -0
  127. package/dist/docker/trajectory-capture.js +521 -0
  128. package/dist/docker/trajectory-capture.js.map +1 -0
  129. package/dist/docker/trajectory-reassembler.d.ts +286 -0
  130. package/dist/docker/trajectory-reassembler.js +1010 -0
  131. package/dist/docker/trajectory-reassembler.js.map +1 -0
  132. package/dist/docker/trajectory-tap.d.ts +100 -0
  133. package/dist/docker/trajectory-tap.js +410 -0
  134. package/dist/docker/trajectory-tap.js.map +1 -0
  135. package/dist/docker/trajectory-types.d.ts +187 -0
  136. package/dist/docker/trajectory-types.js +43 -0
  137. package/dist/docker/trajectory-types.js.map +1 -0
  138. package/dist/docker/types.d.ts +116 -12
  139. package/dist/doctor/checks.d.ts +39 -6
  140. package/dist/doctor/checks.js +129 -25
  141. package/dist/doctor/checks.js.map +1 -1
  142. package/dist/doctor/doctor-command.js +39 -9
  143. package/dist/doctor/doctor-command.js.map +1 -1
  144. package/dist/doctor/mcp-liveness.d.ts +1 -1
  145. package/dist/doctor/mcp-liveness.js +12 -4
  146. package/dist/doctor/mcp-liveness.js.map +1 -1
  147. package/dist/escalation/escalation-watcher.js +6 -0
  148. package/dist/escalation/escalation-watcher.js.map +1 -1
  149. package/dist/{mux → escalation}/trusted-input.d.ts +7 -4
  150. package/dist/{mux → escalation}/trusted-input.js +8 -5
  151. package/dist/escalation/trusted-input.js.map +1 -0
  152. package/dist/hash.js.map +1 -1
  153. package/dist/index.js +65 -16
  154. package/dist/index.js.map +1 -1
  155. package/dist/mux/mux-app.d.ts +9 -0
  156. package/dist/mux/mux-app.js +18 -16
  157. package/dist/mux/mux-app.js.map +1 -1
  158. package/dist/mux/mux-command.js +26 -8
  159. package/dist/mux/mux-command.js.map +1 -1
  160. package/dist/mux/mux-input-handler.d.ts +26 -2
  161. package/dist/mux/mux-input-handler.js +93 -11
  162. package/dist/mux/mux-input-handler.js.map +1 -1
  163. package/dist/mux/mux-renderer.d.ts +2 -1
  164. package/dist/mux/mux-renderer.js +67 -0
  165. package/dist/mux/mux-renderer.js.map +1 -1
  166. package/dist/mux/provider-profile-snapshot.d.ts +44 -0
  167. package/dist/mux/provider-profile-snapshot.js +56 -0
  168. package/dist/mux/provider-profile-snapshot.js.map +1 -0
  169. package/dist/mux/types.d.ts +3 -2
  170. package/dist/mux/types.js +6 -2
  171. package/dist/mux/types.js.map +1 -1
  172. package/dist/observe/observe-command.js +112 -125
  173. package/dist/observe/observe-command.js.map +1 -1
  174. package/dist/persona/broad-policy-validator.d.ts +95 -0
  175. package/dist/persona/broad-policy-validator.js +171 -0
  176. package/dist/persona/broad-policy-validator.js.map +1 -0
  177. package/dist/persona/compile-persona-policy.d.ts +54 -2
  178. package/dist/persona/compile-persona-policy.js +29 -4
  179. package/dist/persona/compile-persona-policy.js.map +1 -1
  180. package/dist/persona/event-bus-progress-reporter.d.ts +57 -0
  181. package/dist/persona/event-bus-progress-reporter.js +66 -0
  182. package/dist/persona/event-bus-progress-reporter.js.map +1 -0
  183. package/dist/persona/persona-command.js +46 -76
  184. package/dist/persona/persona-command.js.map +1 -1
  185. package/dist/persona/persona-compile-orchestrator.d.ts +101 -0
  186. package/dist/persona/persona-compile-orchestrator.js +504 -0
  187. package/dist/persona/persona-compile-orchestrator.js.map +1 -0
  188. package/dist/persona/persona-service.d.ts +137 -0
  189. package/dist/persona/persona-service.js +263 -0
  190. package/dist/persona/persona-service.js.map +1 -0
  191. package/dist/persona/policy-mutation-audit.d.ts +109 -0
  192. package/dist/persona/policy-mutation-audit.js +179 -0
  193. package/dist/persona/policy-mutation-audit.js.map +1 -0
  194. package/dist/persona/rule-delta.d.ts +30 -0
  195. package/dist/persona/rule-delta.js +82 -0
  196. package/dist/persona/rule-delta.js.map +1 -0
  197. package/dist/persona/types.d.ts +12 -0
  198. package/dist/pipeline/annotate.js +10 -2
  199. package/dist/pipeline/annotate.js.map +1 -1
  200. package/dist/pipeline/compile.js +14 -2
  201. package/dist/pipeline/compile.js.map +1 -1
  202. package/dist/pipeline/constitution-compiler.js.map +1 -1
  203. package/dist/pipeline/generate-with-repair.js.map +1 -1
  204. package/dist/pipeline/pipeline-runner.d.ts +63 -4
  205. package/dist/pipeline/pipeline-runner.js +159 -50
  206. package/dist/pipeline/pipeline-runner.js.map +1 -1
  207. package/dist/pipeline/pipeline-shared.d.ts +32 -3
  208. package/dist/pipeline/pipeline-shared.js +76 -8
  209. package/dist/pipeline/pipeline-shared.js.map +1 -1
  210. package/dist/pipeline/refresh-lists.js +3 -5
  211. package/dist/pipeline/refresh-lists.js.map +1 -1
  212. package/dist/pipeline/scenario-schema-validator.js.map +1 -1
  213. package/dist/{mux → pty}/pty-bridge.d.ts +41 -3
  214. package/dist/{mux → pty}/pty-bridge.js +71 -18
  215. package/dist/pty/pty-bridge.js.map +1 -0
  216. package/dist/pty/resolve-ironcurtain-bin.d.ts +17 -0
  217. package/dist/pty/resolve-ironcurtain-bin.js +22 -0
  218. package/dist/pty/resolve-ironcurtain-bin.js.map +1 -0
  219. package/dist/sandbox/index.d.ts +19 -4
  220. package/dist/sandbox/index.js +31 -18
  221. package/dist/sandbox/index.js.map +1 -1
  222. package/dist/servers/fetch-server.js +2 -0
  223. package/dist/servers/fetch-server.js.map +1 -1
  224. package/dist/session/index.d.ts +1 -1
  225. package/dist/session/index.js +20 -2
  226. package/dist/session/index.js.map +1 -1
  227. package/dist/session/preflight.d.ts +20 -35
  228. package/dist/session/preflight.js +92 -109
  229. package/dist/session/preflight.js.map +1 -1
  230. package/dist/session/resource-budget-tracker.js +8 -0
  231. package/dist/session/resource-budget-tracker.js.map +1 -1
  232. package/dist/session/session-manager.d.ts +7 -0
  233. package/dist/session/session-manager.js.map +1 -1
  234. package/dist/session/types.d.ts +23 -0
  235. package/dist/signal/bot-command.js +6 -1
  236. package/dist/signal/bot-command.js.map +1 -1
  237. package/dist/signal/setup-signal.js +1 -1
  238. package/dist/signal/setup-signal.js.map +1 -1
  239. package/dist/signal/signal-bot-daemon.d.ts +1 -0
  240. package/dist/signal/signal-bot-daemon.js +9 -2
  241. package/dist/signal/signal-bot-daemon.js.map +1 -1
  242. package/dist/signal/signal-container.d.ts +3 -3
  243. package/dist/signal/signal-container.js +2 -2
  244. package/dist/signal/signal-container.js.map +1 -1
  245. package/dist/trusted-process/call-circuit-breaker.d.ts +6 -0
  246. package/dist/trusted-process/call-circuit-breaker.js +22 -3
  247. package/dist/trusted-process/call-circuit-breaker.js.map +1 -1
  248. package/dist/trusted-process/container-command.d.ts +35 -0
  249. package/dist/trusted-process/container-command.js +49 -0
  250. package/dist/trusted-process/container-command.js.map +1 -0
  251. package/dist/trusted-process/mcp-error-utils.js +4 -1
  252. package/dist/trusted-process/mcp-error-utils.js.map +1 -1
  253. package/dist/trusted-process/mcp-proxy-server.js +37 -3
  254. package/dist/trusted-process/mcp-proxy-server.js.map +1 -1
  255. package/dist/trusted-process/policy-engine.js +13 -2
  256. package/dist/trusted-process/policy-engine.js.map +1 -1
  257. package/dist/trusted-process/tcp-server-transport.d.ts +19 -1
  258. package/dist/trusted-process/tcp-server-transport.js +56 -10
  259. package/dist/trusted-process/tcp-server-transport.js.map +1 -1
  260. package/dist/trusted-process/tool-call-coordinator.d.ts +22 -8
  261. package/dist/trusted-process/tool-call-coordinator.js +149 -65
  262. package/dist/trusted-process/tool-call-coordinator.js.map +1 -1
  263. package/dist/trusted-process/tool-call-pipeline.d.ts +8 -0
  264. package/dist/trusted-process/tool-call-pipeline.js +68 -34
  265. package/dist/trusted-process/tool-call-pipeline.js.map +1 -1
  266. package/dist/util/atomic-write.d.ts +31 -0
  267. package/dist/util/atomic-write.js +43 -0
  268. package/dist/util/atomic-write.js.map +1 -0
  269. package/dist/utils/preflight-checks.js +1 -3
  270. package/dist/utils/preflight-checks.js.map +1 -1
  271. package/dist/utils/stdio-guard.d.ts +1 -0
  272. package/dist/utils/stdio-guard.js +27 -0
  273. package/dist/utils/stdio-guard.js.map +1 -0
  274. package/dist/web-ui/__tests__/config-dispatch.test.d.ts +13 -0
  275. package/dist/web-ui/__tests__/config-dispatch.test.js +383 -0
  276. package/dist/web-ui/__tests__/config-dispatch.test.js.map +1 -0
  277. package/dist/web-ui/__tests__/json-rpc-dispatch.test.js +6 -0
  278. package/dist/web-ui/__tests__/json-rpc-dispatch.test.js.map +1 -1
  279. package/dist/web-ui/conn-registry.d.ts +14 -0
  280. package/dist/web-ui/conn-registry.js +25 -0
  281. package/dist/web-ui/conn-registry.js.map +1 -0
  282. package/dist/web-ui/dispatch/config-dispatch.d.ts +15 -0
  283. package/dist/web-ui/dispatch/config-dispatch.js +277 -0
  284. package/dist/web-ui/dispatch/config-dispatch.js.map +1 -0
  285. package/dist/web-ui/dispatch/escalation-dispatch.js +11 -2
  286. package/dist/web-ui/dispatch/escalation-dispatch.js.map +1 -1
  287. package/dist/web-ui/dispatch/persona-dispatch.d.ts +46 -2
  288. package/dist/web-ui/dispatch/persona-dispatch.js +209 -56
  289. package/dist/web-ui/dispatch/persona-dispatch.js.map +1 -1
  290. package/dist/web-ui/dispatch/pty-dispatch.d.ts +15 -0
  291. package/dist/web-ui/dispatch/pty-dispatch.js +66 -0
  292. package/dist/web-ui/dispatch/pty-dispatch.js.map +1 -0
  293. package/dist/web-ui/dispatch/session-dispatch.js +89 -6
  294. package/dist/web-ui/dispatch/session-dispatch.js.map +1 -1
  295. package/dist/web-ui/dispatch/types.d.ts +35 -0
  296. package/dist/web-ui/dispatch/types.js +42 -1
  297. package/dist/web-ui/dispatch/types.js.map +1 -1
  298. package/dist/web-ui/dispatch/workflow-dispatch.js +116 -5
  299. package/dist/web-ui/dispatch/workflow-dispatch.js.map +1 -1
  300. package/dist/web-ui/json-rpc-dispatch.js +4 -1
  301. package/dist/web-ui/json-rpc-dispatch.js.map +1 -1
  302. package/dist/web-ui/pty-session-manager.d.ts +234 -0
  303. package/dist/web-ui/pty-session-manager.js +599 -0
  304. package/dist/web-ui/pty-session-manager.js.map +1 -0
  305. package/dist/web-ui/web-event-bus.d.ts +34 -1
  306. package/dist/web-ui/web-event-bus.js.map +1 -1
  307. package/dist/web-ui/web-session-transport.js.map +1 -1
  308. package/dist/web-ui/web-ui-server.d.ts +22 -0
  309. package/dist/web-ui/web-ui-server.js +41 -0
  310. package/dist/web-ui/web-ui-server.js.map +1 -1
  311. package/dist/web-ui/web-ui-types.d.ts +212 -5
  312. package/dist/web-ui/web-ui-types.js.map +1 -1
  313. package/dist/web-ui-static/assets/index-CCVI4nEK.css +1 -0
  314. package/dist/web-ui-static/assets/index-Dm012gvY.js +114 -0
  315. package/dist/web-ui-static/index.html +2 -2
  316. package/dist/workflow/cli-shared.d.ts +62 -0
  317. package/dist/workflow/cli-shared.js +117 -0
  318. package/dist/workflow/cli-shared.js.map +1 -0
  319. package/dist/workflow/cli-support.js +0 -2
  320. package/dist/workflow/cli-support.js.map +1 -1
  321. package/dist/workflow/container-snapshots.d.ts +29 -0
  322. package/dist/workflow/container-snapshots.js +137 -0
  323. package/dist/workflow/container-snapshots.js.map +1 -0
  324. package/dist/workflow/daemon-gate-commands.d.ts +21 -0
  325. package/dist/workflow/daemon-gate-commands.js +595 -0
  326. package/dist/workflow/daemon-gate-commands.js.map +1 -0
  327. package/dist/workflow/discovery.d.ts +29 -0
  328. package/dist/workflow/discovery.js +67 -7
  329. package/dist/workflow/discovery.js.map +1 -1
  330. package/dist/workflow/lane-template.d.ts +89 -0
  331. package/dist/workflow/lane-template.js +141 -0
  332. package/dist/workflow/lane-template.js.map +1 -0
  333. package/dist/workflow/lint.d.ts +7 -1
  334. package/dist/workflow/lint.js +186 -3
  335. package/dist/workflow/lint.js.map +1 -1
  336. package/dist/workflow/machine-builder.d.ts +90 -2
  337. package/dist/workflow/machine-builder.js +222 -29
  338. package/dist/workflow/machine-builder.js.map +1 -1
  339. package/dist/workflow/message-log.d.ts +15 -1
  340. package/dist/workflow/message-log.js.map +1 -1
  341. package/dist/workflow/orchestrator.d.ts +505 -1
  342. package/dist/workflow/orchestrator.js +1725 -69
  343. package/dist/workflow/orchestrator.js.map +1 -1
  344. package/dist/workflow/prompt-builder.js +2 -1
  345. package/dist/workflow/prompt-builder.js.map +1 -1
  346. package/dist/workflow/run-state-command.js +1 -1
  347. package/dist/workflow/run-state-command.js.map +1 -1
  348. package/dist/workflow/shutdown-signals.d.ts +7 -0
  349. package/dist/workflow/shutdown-signals.js +40 -0
  350. package/dist/workflow/shutdown-signals.js.map +1 -0
  351. package/dist/workflow/status-parser.js +19 -4
  352. package/dist/workflow/status-parser.js.map +1 -1
  353. package/dist/workflow/types.d.ts +123 -23
  354. package/dist/workflow/types.js +2 -0
  355. package/dist/workflow/types.js.map +1 -1
  356. package/dist/workflow/validate.d.ts +23 -1
  357. package/dist/workflow/validate.js +311 -22
  358. package/dist/workflow/validate.js.map +1 -1
  359. package/dist/workflow/workflow-command.d.ts +0 -17
  360. package/dist/workflow/workflow-command.js +118 -94
  361. package/dist/workflow/workflow-command.js.map +1 -1
  362. package/dist/workflow/workflow-discovery.d.ts +2 -0
  363. package/dist/workflow/workflow-discovery.js +22 -1
  364. package/dist/workflow/workflow-discovery.js.map +1 -1
  365. package/dist/workflow/workflow-manager.d.ts +34 -0
  366. package/dist/workflow/workflow-manager.js +52 -1
  367. package/dist/workflow/workflow-manager.js.map +1 -1
  368. package/dist/workflow/workflows/design-and-code/README.md +50 -0
  369. package/dist/workflow/workflows/deterministic-eval-smoke/scripts/format_report.js +29 -0
  370. package/dist/workflow/workflows/deterministic-eval-smoke/scripts/package.json +5 -0
  371. package/dist/workflow/workflows/deterministic-eval-smoke/scripts/requirements.txt +1 -0
  372. package/dist/workflow/workflows/deterministic-eval-smoke/scripts/run_eval.py +41 -0
  373. package/dist/workflow/workflows/deterministic-eval-smoke/workflow.yaml +57 -0
  374. package/dist/workflow/workflows/deterministic-verdict-smoke/scripts/classify.py +18 -0
  375. package/dist/workflow/workflows/deterministic-verdict-smoke/workflow.yaml +51 -0
  376. package/dist/workflow/workflows/evolve/README.md +66 -0
  377. package/dist/workflow/workflows/evolve/scripts/LICENSE +201 -0
  378. package/dist/workflow/workflows/evolve/scripts/README.md +314 -0
  379. package/dist/workflow/workflows/evolve/scripts/evolve-brief +16 -0
  380. package/dist/workflow/workflows/evolve/scripts/evolve-cognition +16 -0
  381. package/dist/workflow/workflows/evolve/scripts/evolve-db +16 -0
  382. package/dist/workflow/workflows/evolve/scripts/evolve-eval +16 -0
  383. package/dist/workflow/workflows/evolve/scripts/evolve-files +16 -0
  384. package/dist/workflow/workflows/evolve/scripts/evolve-summary +16 -0
  385. package/dist/workflow/workflows/evolve/scripts/evolve_core/__init__.py +14 -0
  386. package/dist/workflow/workflows/evolve/scripts/evolve_core/algorithms/__init__.py +17 -0
  387. package/dist/workflow/workflows/evolve/scripts/evolve_core/algorithms/base.py +21 -0
  388. package/dist/workflow/workflows/evolve/scripts/evolve_core/algorithms/factory.py +90 -0
  389. package/dist/workflow/workflows/evolve/scripts/evolve_core/algorithms/greedy.py +17 -0
  390. package/dist/workflow/workflows/evolve/scripts/evolve_core/algorithms/island.py +316 -0
  391. package/dist/workflow/workflows/evolve/scripts/evolve_core/algorithms/random.py +18 -0
  392. package/dist/workflow/workflows/evolve/scripts/evolve_core/algorithms/ucb1.py +55 -0
  393. package/dist/workflow/workflows/evolve/scripts/evolve_core/best_snapshot.py +62 -0
  394. package/dist/workflow/workflows/evolve/scripts/evolve_core/cli.py +752 -0
  395. package/dist/workflow/workflows/evolve/scripts/evolve_core/cognition.py +127 -0
  396. package/dist/workflow/workflows/evolve/scripts/evolve_core/database.py +218 -0
  397. package/dist/workflow/workflows/evolve/scripts/evolve_core/diff.py +57 -0
  398. package/dist/workflow/workflows/evolve/scripts/evolve_core/embedding.py +84 -0
  399. package/dist/workflow/workflows/evolve/scripts/evolve_core/file_lock.py +45 -0
  400. package/dist/workflow/workflows/evolve/scripts/evolve_core/run_state.py +343 -0
  401. package/dist/workflow/workflows/evolve/scripts/evolve_core/sampling_config.py +173 -0
  402. package/dist/workflow/workflows/evolve/scripts/evolve_core/structures.py +93 -0
  403. package/dist/workflow/workflows/evolve/scripts/evolve_core/vector_index.py +191 -0
  404. package/dist/workflow/workflows/evolve/scripts/evolve_result.py +1503 -0
  405. package/dist/workflow/workflows/evolve/scripts/requirements.txt +2 -0
  406. package/dist/workflow/workflows/evolve/workflow.yaml +646 -0
  407. package/dist/workflow/workflows/test-email-summary/workflow.yaml +1 -0
  408. package/dist/workflow/workflows/vuln-discovery/README.md +54 -0
  409. package/dist/workflow/workflows/vuln-discovery/skills/harness-design-fuzzing/SKILL.md +6 -1
  410. package/dist/workflow/workflows/vuln-discovery/skills/memory-safety-c-cpp/SKILL.md +1 -0
  411. package/dist/workflow/workflows/vuln-discovery/skills/vulnerability-triage/SKILL.md +4 -0
  412. package/dist/workflow/workflows/vuln-discovery/workflow.yaml +13 -8
  413. package/docker/Dockerfile.base +22 -0
  414. package/docker/Dockerfile.base.arm64 +18 -0
  415. package/docker/Dockerfile.claude-code +3 -1
  416. package/docker/Dockerfile.codex +17 -0
  417. package/docker/Dockerfile.goose +3 -1
  418. package/docker/entrypoint-claude-code.sh +28 -45
  419. package/docker/entrypoint-codex.sh +42 -0
  420. package/docker/entrypoint-goose.sh +5 -24
  421. package/docker/entrypoint-uid-remap.sh +93 -0
  422. package/package.json +39 -30
  423. package/src/workflow/workflows/design-and-code/README.md +50 -0
  424. package/src/workflow/workflows/deterministic-eval-smoke/scripts/format_report.js +29 -0
  425. package/src/workflow/workflows/deterministic-eval-smoke/scripts/package.json +5 -0
  426. package/src/workflow/workflows/deterministic-eval-smoke/scripts/requirements.txt +1 -0
  427. package/src/workflow/workflows/deterministic-eval-smoke/scripts/run_eval.py +41 -0
  428. package/src/workflow/workflows/deterministic-eval-smoke/workflow.yaml +57 -0
  429. package/src/workflow/workflows/deterministic-verdict-smoke/scripts/classify.py +18 -0
  430. package/src/workflow/workflows/deterministic-verdict-smoke/workflow.yaml +51 -0
  431. package/src/workflow/workflows/evolve/README.md +66 -0
  432. package/src/workflow/workflows/evolve/scripts/LICENSE +201 -0
  433. package/src/workflow/workflows/evolve/scripts/README.md +314 -0
  434. package/src/workflow/workflows/evolve/scripts/evolve-brief +16 -0
  435. package/src/workflow/workflows/evolve/scripts/evolve-cognition +16 -0
  436. package/src/workflow/workflows/evolve/scripts/evolve-db +16 -0
  437. package/src/workflow/workflows/evolve/scripts/evolve-eval +16 -0
  438. package/src/workflow/workflows/evolve/scripts/evolve-files +16 -0
  439. package/src/workflow/workflows/evolve/scripts/evolve-summary +16 -0
  440. package/src/workflow/workflows/evolve/scripts/evolve_core/__init__.py +14 -0
  441. package/src/workflow/workflows/evolve/scripts/evolve_core/algorithms/__init__.py +17 -0
  442. package/src/workflow/workflows/evolve/scripts/evolve_core/algorithms/base.py +21 -0
  443. package/src/workflow/workflows/evolve/scripts/evolve_core/algorithms/factory.py +90 -0
  444. package/src/workflow/workflows/evolve/scripts/evolve_core/algorithms/greedy.py +17 -0
  445. package/src/workflow/workflows/evolve/scripts/evolve_core/algorithms/island.py +316 -0
  446. package/src/workflow/workflows/evolve/scripts/evolve_core/algorithms/random.py +18 -0
  447. package/src/workflow/workflows/evolve/scripts/evolve_core/algorithms/ucb1.py +55 -0
  448. package/src/workflow/workflows/evolve/scripts/evolve_core/best_snapshot.py +62 -0
  449. package/src/workflow/workflows/evolve/scripts/evolve_core/cli.py +752 -0
  450. package/src/workflow/workflows/evolve/scripts/evolve_core/cognition.py +127 -0
  451. package/src/workflow/workflows/evolve/scripts/evolve_core/database.py +218 -0
  452. package/src/workflow/workflows/evolve/scripts/evolve_core/diff.py +57 -0
  453. package/src/workflow/workflows/evolve/scripts/evolve_core/embedding.py +84 -0
  454. package/src/workflow/workflows/evolve/scripts/evolve_core/file_lock.py +45 -0
  455. package/src/workflow/workflows/evolve/scripts/evolve_core/run_state.py +343 -0
  456. package/src/workflow/workflows/evolve/scripts/evolve_core/sampling_config.py +173 -0
  457. package/src/workflow/workflows/evolve/scripts/evolve_core/structures.py +93 -0
  458. package/src/workflow/workflows/evolve/scripts/evolve_core/vector_index.py +191 -0
  459. package/src/workflow/workflows/evolve/scripts/evolve_result.py +1503 -0
  460. package/src/workflow/workflows/evolve/scripts/requirements.txt +2 -0
  461. package/src/workflow/workflows/evolve/workflow.yaml +646 -0
  462. package/src/workflow/workflows/test-email-summary/workflow.yaml +1 -0
  463. package/src/workflow/workflows/vuln-discovery/README.md +54 -0
  464. package/src/workflow/workflows/vuln-discovery/skills/harness-design-fuzzing/SKILL.md +6 -1
  465. package/src/workflow/workflows/vuln-discovery/skills/memory-safety-c-cpp/SKILL.md +1 -0
  466. package/src/workflow/workflows/vuln-discovery/skills/vulnerability-triage/SKILL.md +4 -0
  467. package/src/workflow/workflows/vuln-discovery/workflow.yaml +13 -8
  468. package/dist/mux/pty-bridge.js.map +0 -1
  469. package/dist/mux/trusted-input.js.map +0 -1
  470. package/dist/web-ui-static/assets/index-BFO5z1js.js +0 -76
  471. package/dist/web-ui-static/assets/index-CCUwrkIL.css +0 -1
  472. package/packages/web-ui/README.md +0 -113
@@ -0,0 +1,2 @@
1
+ numpy
2
+ pyyaml
@@ -0,0 +1,646 @@
1
+ name: evolve
2
+ description: 'Evolve - multi-round evaluator-driven candidate search: a linear per-round pipeline (sample, researcher, evaluate, analyzer, record) with a round-boundary orchestrator enforcing budget and stop conditions.'
3
+ initial: provision
4
+
5
+ settings:
6
+ mode: docker
7
+ dockerAgent: claude-code
8
+ sharedContainer: true
9
+ workers: 1
10
+ model: anthropic:claude-sonnet-4-6
11
+ # Safety backstop for a wedged round pipeline, NOT the round budget.
12
+ # isRoundLimitReached trips when the MAX visit count across all states reaches
13
+ # this number. On the happy path every state is entered once per evolution
14
+ # round, so this bounds a clean run at ~maxRounds rounds; mid-round recovery
15
+ # (evaluator_blocked -> human_escalation in the child segment, then APPROVE
16
+ # back to orchestrator) may revisit evaluate/orchestrator, so a run with many
17
+ # recoveries trips the backstop in fewer
18
+ # rounds. It is set well above run_spec.budget.max_rounds either way, so a
19
+ # legitimate run is never capped before the orchestrator emits `complete`; the
20
+ # real round budget is enforced by the orchestrator against
21
+ # run_spec.budget.max_rounds.
22
+ maxRounds: 200
23
+
24
+ states:
25
+ provision:
26
+ type: agent
27
+ description: >
28
+ Install the staged experiment's runtime dependencies into the persistent
29
+ workflow venv, once. Idempotent: skips when the venv is already provisioned.
30
+ persona: global
31
+ prompt: |
32
+ You are provisioning the Python environment for an Evolve experiment BEFORE
33
+ any candidate is evaluated. The experiment's files (if this run was given one)
34
+ live at the WORKSPACE ROOT, /workspace - the experiment dir IS the run's
35
+ workspace. Treat the experiment's own source files (the evaluator, input.md,
36
+ initial_program, requirements) as READ-ONLY by convention: do NOT modify them.
37
+ Your run state goes under /workspace/.evolve_runs/ and /workspace/.workflow/.
38
+ The persistent virtual environment lives at /opt/workflow-venv (a SEPARATE
39
+ mount, not under /workspace) and ALREADY contains the workflow's base
40
+ dependencies (numpy, pyyaml).
41
+
42
+ Your job: make sure every dependency the experiment's evaluator and its
43
+ candidates need is installed into /opt/workflow-venv, exactly once.
44
+
45
+ DURABILITY MODEL (read first - it governs every step below). Two kinds of
46
+ install live in this container, and they survive a resume DIFFERENTLY:
47
+ - pip/uv installs into /opt/workflow-venv are RESUME-DURABLE: the venv is
48
+ a host-mounted directory, so on workflow resume the same venv is
49
+ re-mounted with its packages intact.
50
+ - apt / system-library installs are NOT resume-durable: resume mints a
51
+ FRESH container, so anything installed into the container filesystem
52
+ (apt packages, the .so files they drop) is GONE on resume.
53
+ Therefore the .provisioned marker gates ONLY the durable venv install. apt
54
+ steps are re-applied on EVERY entry to this state (they are no-ops within a
55
+ run when the lib is already present, and they reinstall into the fresh
56
+ container on resume). NEVER let the marker short-circuit an apt step.
57
+
58
+ 1. DURABLE-VENV SKIP CHECK. First check for the marker file
59
+ /workspace/.evolve_runs/main/.provisioned. If it exists, the venv was
60
+ already provisioned on a prior run or a prior visit - do NOT re-run the
61
+ pip install. Verify the venv still imports the recorded packages (run
62
+ `/opt/workflow-venv/bin/python -c "import numpy"` plus any package names
63
+ listed in the marker). If they import, the durable venv is intact: SKIP
64
+ the pip install but STILL run the system-library step (step 3b) before
65
+ emitting verdict: ready (apt libs may have vanished on a resume).
66
+
67
+ 2. INFER DEPENDENCIES. Look at the workspace root /workspace. If it holds no
68
+ experiment files (it is a fresh/empty sandbox - no evaluator, no input.md,
69
+ no manifest), there is nothing experiment-specific to install: the base
70
+ venv is sufficient - write the marker (step 4) and emit verdict: ready.
71
+ Otherwise read, in this order, whichever exist at the workspace root
72
+ /workspace (ignore the run-state subtrees .evolve_runs/ and .workflow/):
73
+ - requirements.txt / pyproject.toml / setup.cfg / setup.py
74
+ - README / README.md
75
+ - the evaluator and any cognition / init script source
76
+ Build the minimal set of third-party packages the EVALUATOR needs to run
77
+ and that CANDIDATES are expected to import. For circle packing this is
78
+ numpy (already present) plus scipy. scipy ships as a self-contained PyPI
79
+ wheel with bundled BLAS, so the circle-packing demo needs NO apt step.
80
+
81
+ 3a. INSTALL THE DURABLE VENV DEPS (through the proxy). Skip this sub-step
82
+ entirely if step 1 already verified the marker. Otherwise, for each
83
+ needed package, install it into /opt/workflow-venv using uv:
84
+ UV_NATIVE_TLS=1 VIRTUAL_ENV=/opt/workflow-venv uv pip install <pkg> [<pkg> ...]
85
+ Network egress is mediated by the IronCurtain MITM proxy
86
+ (HTTPS_PROXY/HTTP_PROXY are already set); registries are reachable.
87
+ Prefer a requirements.txt install when the workspace ships one:
88
+ UV_NATIVE_TLS=1 VIRTUAL_ENV=/opt/workflow-venv uv pip install -r /workspace/requirements.txt
89
+
90
+ 3b. RE-APPLY SYSTEM LIBRARIES (every entry, NOT gated by the marker). If -
91
+ and only if - a wheel genuinely needs an unbundled system library, run
92
+ `sudo apt-get install -y <lib>` on EVERY entry to this state, before the
93
+ import verification. Record apt package names in
94
+ /workspace/.evolve_runs/main/.apt-provisioned for your own reference, but
95
+ do NOT use that marker to skip the apt step. For circle packing there is
96
+ no apt step, so this sub-step is a no-op.
97
+
98
+ 4. VERIFY + MARK. Confirm each needed package imports:
99
+ /opt/workflow-venv/bin/python -c "import scipy, numpy"
100
+ Then write /workspace/.evolve_runs/main/.provisioned containing one line
101
+ per VENV (pip) package name. The marker records only durable venv deps;
102
+ apt packages are tracked separately and are never marker-gated. Create
103
+ /workspace/.evolve_runs/main/ first if needed.
104
+
105
+ Finish with the required agent_status block:
106
+ - verdict: ready - the venv now has everything the experiment needs (or
107
+ the workspace holds no experiment files and the base venv suffices).
108
+ - verdict: blocked - a dependency cannot be installed (registry refuses
109
+ it, a system lib is unavailable, the experiment's deps are uninferable).
110
+ Put the specific failure in your status so a human can act on it.
111
+ inputs: []
112
+ outputs: []
113
+ transitions:
114
+ - to: preflight
115
+ when: { verdict: ready }
116
+ - to: provision_review
117
+ when: { verdict: blocked }
118
+
119
+ provision_review:
120
+ type: human_gate
121
+ description: >
122
+ Human review when the experiment's dependencies could not be provisioned.
123
+ Approve to retry provisioning, force a revision to re-infer the deps, or abort.
124
+ acceptedEvents: [APPROVE, FORCE_REVISION, ABORT]
125
+ transitions:
126
+ - to: provision
127
+ event: APPROVE
128
+ actions:
129
+ - { type: resetVisitCounts, stateIds: [provision] }
130
+ - to: provision
131
+ event: FORCE_REVISION
132
+ actions:
133
+ - { type: resetVisitCounts, stateIds: [provision] }
134
+ - to: aborted
135
+ event: ABORT
136
+
137
+ preflight:
138
+ type: agent
139
+ description: Infer the experiment spec, initialize the run, and author the cognition seed.
140
+ persona: global
141
+ prompt: |
142
+ You are configuring a multi-round Evolve experiment. The workspace root is
143
+ /workspace. If /workspace contains experiment files, infer the objective,
144
+ evaluator command, cognition seed, and optional initial-program contract from
145
+ those files. If /workspace is a fresh sandbox with no experiment files,
146
+ fall back to authoring a toy run spec from the task string exactly as the
147
+ older workflow did.
148
+
149
+ Do ALL of these, in order, then finish with the required agent_status block:
150
+
151
+ 1. Inspect /workspace, ignoring the run-state subtrees .evolve_runs/ and
152
+ .workflow/. Treat files such as input.md, README.md, evaluator.py,
153
+ initial_program, init_cognition.py, requirements.txt, pyproject.toml,
154
+ config.yaml, and prompts/ as experiment evidence. Do NOT modify the
155
+ experiment's source files; write only under .evolve_runs/ and .workflow/.
156
+
157
+ 2. If experiment files are present, infer these values:
158
+ - OBJECTIVE from input.md or README.md. Keep it one line and faithful to
159
+ the experiment.
160
+ - EVAL_CMD from the experiment's evaluator. Prefer
161
+ /opt/workflow-venv/bin/python /workspace/evaluator.py {quoted_code_path} {quoted_results_path}
162
+ when evaluator.py has that CLI contract. The command must write JSON
163
+ containing an eval_score number at {quoted_results_path}.
164
+ - SUCCESS_CRITERION from the task's stated goal first. If the task names
165
+ a target (e.g. "toward the AlphaEvolve target"), resolve the concrete
166
+ number from the experiment brief (input.md/README) and use it, e.g.
167
+ eval_score >= 2.635. This MUST be the FIRST success_criteria entry in
168
+ canonical <core_score> <comparator> <number> form. Use only maximize
169
+ comparators >=, >, or ==. If the task names no target, fall back to the
170
+ experiment brief's stated target; use a generic eval_score >= 1.0 only
171
+ when neither states one. This is a hard early-stop target parsed after
172
+ each durable node record, so prefer an accurate target over a
173
+ conservative placeholder. Do not use prose, <, or <=.
174
+ - EVAL_TIMEOUT_SECS as a generous per-candidate evaluation budget in
175
+ seconds. Default to 300. Raise it (up to ~600) when the experiment or
176
+ task implies heavy evaluation (e.g. numerical optimization) or when the
177
+ experiment declares a larger per-candidate budget. A too-short timeout
178
+ truncates slow-but-valid candidates as failures.
179
+ - COGNITION_SEED from init_cognition.py, README.md, prompts/, and input.md.
180
+ If init_cognition.py contains CognitionItem-style heuristics, translate
181
+ their content/source/metadata into JSON seed objects. Do not execute
182
+ init_cognition.py.
183
+ - PRIMARY_TARGET as candidate.py unless the experiment clearly names a
184
+ different target. If /workspace/initial_program exists, note in the
185
+ cognition seed that round 1 should copy it verbatim; the researcher
186
+ prompt will do the actual copy.
187
+ - SAMPLE_N as the number of parent candidates to sample each round.
188
+ Default to 1 for from-scratch toy tasks. If the task or experiment
189
+ implies recombination/crossover search, or config.yaml declares
190
+ sample_n, use that value, commonly 3. Keep SAMPLE_N positive and at
191
+ most 5 so the researcher's context stays tractable.
192
+ - SAMPLER as the parent-selection strategy. Default to greedy. Choose
193
+ ucb1 when the search should balance exploiting high scores with
194
+ exploring under-visited parents, island when diversity across
195
+ sub-populations is wanted, or random only for a diversity baseline.
196
+ You may choose a non-greedy sampler only when you also write a
197
+ reproducibility seed to /workspace/.evolve_runs/main/sampling_seed.txt
198
+ as a single integer. Without that seed, use greedy. For island, add
199
+ --sampling-feature complexity --sampling-feature diversity
200
+ --sampling-feature-bins 10 unless the experiment specifies otherwise.
201
+
202
+ 3. If no experiment files are present, infer OBJECTIVE and EVAL_CMD from the
203
+ task string. EVAL_CMD must read the candidate at {quoted_code_path}, run
204
+ it, and write JSON with an eval_score number at {quoted_results_path}.
205
+ Candidate files may be extensionless, so Python evaluators must load
206
+ them with runpy.run_path or exec(compile(...)); do not rely on
207
+ importlib.util.spec_from_file_location for {quoted_code_path}.
208
+
209
+ 4. Initialize the run by executing the evolve-brief helper. The run lives
210
+ under /workspace/.evolve_runs/main/. Use these flags, filling OBJECTIVE,
211
+ EVAL_CMD, SUCCESS_CRITERION, EVAL_TIMEOUT_SECS, MAX_ROUNDS, PRIMARY_TARGET,
212
+ SAMPLER, and SAMPLE_N from the inference above. Set --max-rounds from the
213
+ task when it specifies a number of rounds; otherwise default to 3. Default
214
+ EVAL_TIMEOUT_SECS to 300 when nothing implies a different budget.
215
+
216
+ If /workspace/initial_program exists, add 1 to MAX_ROUNDS before passing
217
+ it. The seed is copied verbatim as node 0, and done_rounds counts each
218
+ GENERATION toward the budget - at the workers:1 default every recorded node
219
+ is its own generation, so the seed consumes one generation. Without the +1
220
+ a request for N rounds would yield only N-1 evolution rounds (the seed
221
+ consumes one). The +1 restores the requested number of evolution rounds. Do
222
+ NOT add the +1 when no initial_program is seeded (node 0 is then a real
223
+ first round).
224
+
225
+ /opt/workflow-venv/bin/python /workflow-scripts/evolve-brief normalize \
226
+ --workspace-root /workspace \
227
+ --run-name main \
228
+ --objective "OBJECTIVE" \
229
+ --core-score eval_score \
230
+ --evaluation-command "EVAL_CMD" \
231
+ --evaluation-timeout-secs EVAL_TIMEOUT_SECS \
232
+ --success-criterion "SUCCESS_CRITERION" \
233
+ --max-rounds MAX_ROUNDS \
234
+ --patience 2 \
235
+ --stop-condition "max_rounds" \
236
+ --writable-path .evolve_runs \
237
+ --primary-target PRIMARY_TARGET \
238
+ --sampling-algorithm SAMPLER \
239
+ --sample-n SAMPLE_N \
240
+ --cognition-source-mode seed \
241
+ --confirmed true
242
+
243
+ If SAMPLER is island and feature dimensions are not already specified by
244
+ the experiment, include:
245
+ --sampling-feature complexity \
246
+ --sampling-feature diversity \
247
+ --sampling-feature-bins 10
248
+
249
+ 5. If SAMPLER is not greedy, write /workspace/.evolve_runs/main/sampling_seed.txt
250
+ containing one integer seed on a single line. Use a stable seed inferred
251
+ from the task or experiment when one is declared; otherwise use 0. If you
252
+ cannot write a seed, switch SAMPLER back to greedy before normalizing.
253
+
254
+ 6. Write a cognition seed file at /workspace/.evolve_runs/main/cognition_seed.md
255
+ containing one or more ```json fenced blocks of reusable domain heuristics
256
+ for this objective. Do not put round-by-round results here; only durable
257
+ knowledge. For a workspace experiment, preserve the experiment's own
258
+ heuristics and interface contract.
259
+
260
+ 7. Copy the human-review artifacts into the workflow artifact directory:
261
+
262
+ mkdir -p /workspace/.workflow/run_spec /workspace/.workflow/cognition_seed
263
+ cp /workspace/.evolve_runs/main/run_spec.yaml /workspace/.workflow/run_spec/run_spec.md
264
+ cp /workspace/.evolve_runs/main/cognition_seed.md /workspace/.workflow/cognition_seed/cognition_seed.md
265
+
266
+ 8. Confirm evolve-brief exited 0, run_spec.yaml exists, cognition_seed.md
267
+ exists, sampling_seed.txt exists when SAMPLER is non-greedy, and both
268
+ workflow artifact copies exist.
269
+
270
+ If a human directive is present at the top of this message, treat it as
271
+ authoritative. Adjust the objective, evaluator command, budget, or cognition
272
+ seed exactly as directed before re-emitting ready. FORCE_REVISION preserves
273
+ the validity of existing nodes; if the objective fundamentally changes, abort
274
+ this run and start a fresh one instead of reusing stale nodes.
275
+
276
+ If the task lacks an objective or an evaluator you cannot construct, set verdict: blocked.
277
+ Otherwise set verdict: ready.
278
+ inputs: []
279
+ outputs:
280
+ - run_spec
281
+ - cognition_seed
282
+ transitions:
283
+ - to: preflight_review
284
+ when: { verdict: ready }
285
+ - to: failed
286
+ when: { verdict: blocked }
287
+
288
+ preflight_review:
289
+ type: human_gate
290
+ description: >
291
+ Human approval of the run spec, objective, evaluator command, and cognition
292
+ seed before the first evaluator runs.
293
+ acceptedEvents: [APPROVE, FORCE_REVISION, ABORT]
294
+ present:
295
+ - run_spec
296
+ - cognition_seed
297
+ transitions:
298
+ - to: orchestrator
299
+ event: APPROVE
300
+ - to: preflight
301
+ event: FORCE_REVISION
302
+ actions:
303
+ - { type: resetVisitCounts, stateIds: [preflight, orchestrator] }
304
+ - to: aborted
305
+ event: ABORT
306
+
307
+ orchestrator:
308
+ type: agent
309
+ description: Round-boundary controller - after each recorded round (and at the start) it enforces the budget and stop conditions, routing to continue, complete, or escalate.
310
+ persona: global
311
+ prompt: |
312
+ You are the Evolve orchestrator - the round-boundary controller for a bounded
313
+ multi-round search. You are entered at the start of the run and again after each
314
+ round is durably recorded; you read the durable run state and emit exactly ONE
315
+ routing verdict in your agent_status block. You do not write candidates, run
316
+ evaluators, or record nodes. The per-round pipeline runs on its own - sample ->
317
+ researcher -> evaluate -> analyzer -> analysis_record - and returns here only
318
+ once the round is committed.
319
+
320
+ Read these files first:
321
+ - /workspace/.evolve_runs/main/run_spec.yaml - budget.max_rounds is N.
322
+ - /workspace/.evolve_runs/main/current/stop_signals.json, if present. It
323
+ is written by analysis_record after the durable node record and is the
324
+ single source of truth for round accounting. Read its precomputed fields
325
+ directly; do NOT count nodes.json or recompute anything yourself:
326
+ * done_rounds = the number of GENERATIONS recorded so far. One fan-out
327
+ batch of N lanes counts as ONE generation; at the workers:1 default
328
+ each round is one node and one generation, so done_rounds equals the
329
+ node tally there. The file is absent before round 1 (done_rounds = 0).
330
+ * node_count = the raw recorded-node tally (= done_rounds at workers:1,
331
+ and larger at workers>1 where a generation has multiple lane nodes).
332
+ * stop_reason = the precomputed stop decision. Use this verbatim; do NOT
333
+ recompute target, patience, or max-round logic yourself.
334
+
335
+ Recovery after a human just approved an escalated round depends on the SCRATCH
336
+ SHAPE, which the previous output states explicitly:
337
+ - Bare current/ (the message says "Scratch is the bare current/"): a single
338
+ candidate is written but not yet scored. Confirm with
339
+ /workspace/.evolve_runs/main/current/context.json present AND result.json
340
+ absent, and emit evaluate to RESUME that round in place. Do NOT discard it
341
+ or start a fresh batch.
342
+ - Lane-scoped under current/lane_<k>/ (the message says "Scratch is
343
+ lane-scoped"): a fan-out batch escalated or drained its lanes. Discard that
344
+ lane scratch and re-decide normally; emit design for a fresh batch unless
345
+ stop_signals.json requires complete or the run is unrecoverable.
346
+
347
+ If a human directive in this message requests more rounds, that directive
348
+ overrides any stop_reason for THIS turn only: emit design to start one more
349
+ round instead of complete, even when stop_signals.json reports a stop. The
350
+ directive is present for a single turn; after that round records, route
351
+ normally on the freshly recomputed stop_signals.json — the human can request
352
+ another round at the next final_review gate. Do not rewrite run_spec.yaml;
353
+ extra rounds append new nodes to nodes.json like normal rounds.
354
+
355
+ Decide and emit one verdict:
356
+ - complete - if stop_signals.json exists and its stop_reason is non-null,
357
+ unless a human extension directive is still active.
358
+ - design - to start the next round, when no active stop_reason should
359
+ complete the run.
360
+ - evaluate - only to resume an evaluator-blocked round (the recovery case
361
+ above): a candidate is written but result.json is absent.
362
+ - escalate - only if the run is unrecoverable.
363
+
364
+ Finish with the required agent_status block carrying exactly one of those verdicts.
365
+ inputs: []
366
+ outputs: []
367
+ transitions:
368
+ - to: failed
369
+ guard: isRoundLimitReached
370
+ - to: workers
371
+ when: { verdict: design }
372
+ - to: evaluate
373
+ when: { verdict: evaluate }
374
+ - to: final_summary
375
+ when: { verdict: complete }
376
+ - to: human_escalation
377
+ when: { verdict: escalate }
378
+
379
+ workers:
380
+ type: deterministic
381
+ description: Run one synchronous evolve round as a child FSM segment.
382
+ run: []
383
+ fanOut: { count: workers, join: barrier }
384
+ segment: [sample, researcher, evaluate, analyzer, analysis_record]
385
+ transitions:
386
+ - to: orchestrator
387
+ when: { verdict: recorded }
388
+ - to: human_escalation
389
+ when: { verdict: escalate }
390
+ - to: failed
391
+ when: { verdict: result_file_error }
392
+ - to: failed
393
+
394
+ sample:
395
+ type: deterministic
396
+ description: Sample parent nodes and retrieve cognition; seed cognition on first entry.
397
+ fanOutMember: true
398
+ container: true
399
+ resultFile: .evolve_runs/main/current/sample.json
400
+ run:
401
+ - [
402
+ '/opt/workflow-venv/bin/python',
403
+ '/workflow-scripts/evolve_result.py',
404
+ 'sample',
405
+ '--run-dir',
406
+ '/workspace/.evolve_runs/main',
407
+ '--query-from-spec',
408
+ '--n-from-spec',
409
+ '--context-file',
410
+ '/workspace/.evolve_runs/main/current/context.json',
411
+ '--result-file',
412
+ '/workspace/.evolve_runs/main/current/sample.json',
413
+ ]
414
+ transitions:
415
+ - to: researcher
416
+ when: { verdict: sampled }
417
+ - to: failed
418
+ when: { verdict: sample_error }
419
+ - to: failed
420
+ when: { verdict: result_file_error }
421
+ - to: failed
422
+
423
+ researcher:
424
+ type: agent
425
+ description: Evolve one candidate from sampled parents and retrieved cognition.
426
+ fanOutMember: true
427
+ persona: global
428
+ prompt: |
429
+ Write exactly one candidate program for this round.
430
+
431
+ Read the round context at {laneDir}/context.json. It
432
+ contains:
433
+ - step_name: the directory you must write the candidate into
434
+ - parents: a list of sampled parent nodes, empty on round 1
435
+ - cognition.matches: retrieved durable heuristics relevant to this objective
436
+
437
+ If parents is empty and /workspace/initial_program exists, copy it verbatim
438
+ as this round's candidate without modifying it - it is the experiment's
439
+ baseline, and the evaluator will score it as node 0. If parents is empty
440
+ and no initial_program exists, write a full candidate from scratch. If
441
+ parents has one node, evolve it using the cognition hints. If parents has
442
+ multiple nodes, produce a candidate that recombines their strengths: take
443
+ the best ideas from each parent's code and the cognition hints, then
444
+ synthesize one improved candidate. Do not merely concatenate; integrate.
445
+
446
+ Write the COMPLETE candidate file to:
447
+ /workspace/.evolve_runs/main/steps/<step_name>/code
448
+ substituting <step_name> from context.json. Create the directory if needed. Write
449
+ only that one file, no commentary in the file.
450
+
451
+ Finish with the required agent_status block; your verdict is informational.
452
+ inputs: []
453
+ outputs: []
454
+ maxVisits: 3
455
+ transitions:
456
+ - to: evaluate
457
+
458
+ evaluate:
459
+ type: deterministic
460
+ description: Run the configured evaluator on this round's candidate.
461
+ fanOutMember: true
462
+ container: true
463
+ resultFile: .evolve_runs/main/current/result.json
464
+ run:
465
+ - [
466
+ '/opt/workflow-venv/bin/python',
467
+ '/workflow-scripts/evolve_result.py',
468
+ 'evaluate',
469
+ '--run-dir',
470
+ '/workspace/.evolve_runs/main',
471
+ '--step-from-current',
472
+ '--code-from-current',
473
+ '--result-file',
474
+ '/workspace/.evolve_runs/main/current/result.json',
475
+ ]
476
+ transitions:
477
+ - to: analyzer
478
+ when: { verdict: evaluated }
479
+ - to: human_escalation
480
+ when: { verdict: evaluator_blocked }
481
+ - to: failed
482
+ when: { verdict: result_file_error }
483
+ - to: failed
484
+
485
+ analyzer:
486
+ type: agent
487
+ description: Write a transferable lesson for the round.
488
+ fanOutMember: true
489
+ persona: global
490
+ prompt: |
491
+ Analyze the round that just completed and write a SHORT transferable lesson.
492
+
493
+ Read {laneDir}/context.json, the just-evaluated
494
+ result at {laneDir}/result.json, and this round's
495
+ candidate at the step path named in context.json.
496
+
497
+ Write a concise markdown lesson to:
498
+ {laneDir}/analysis.md
499
+ Keep it to a few sentences. Do not restate the score; capture the transferable insight.
500
+ This lesson is promoted into the cognition store after the durable record,
501
+ so write something future rounds can retrieve and apply.
502
+
503
+ Finish with the required agent_status block; your verdict is informational.
504
+ inputs: []
505
+ outputs: []
506
+ maxVisits: 3
507
+ transitions:
508
+ - to: analysis_record
509
+
510
+ analysis_record:
511
+ type: deterministic
512
+ description: The single durable engine node-write; commit the round with its lesson and parents.
513
+ fanOutMember: true
514
+ container: true
515
+ resultFile: .evolve_runs/main/current/analysis_record.json
516
+ run:
517
+ - [
518
+ '/opt/workflow-venv/bin/python',
519
+ '/workflow-scripts/evolve_result.py',
520
+ 'attach_analysis',
521
+ '--run-dir',
522
+ '/workspace/.evolve_runs/main',
523
+ '--step-from-current',
524
+ '--name-from-current',
525
+ '--parent-from-current',
526
+ '--code-from-current',
527
+ '--results-from-current',
528
+ '--analysis-file',
529
+ '/workspace/.evolve_runs/main/current/analysis.md',
530
+ '--result-file',
531
+ '/workspace/.evolve_runs/main/current/analysis_record.json',
532
+ ]
533
+ transitions:
534
+ - to: orchestrator
535
+ when: { verdict: recorded }
536
+ - to: failed
537
+ when: { verdict: needs_repair }
538
+ - to: failed
539
+ when: { verdict: result_file_error }
540
+ - to: failed
541
+
542
+ human_escalation:
543
+ type: human_gate
544
+ description: >
545
+ Human review when the orchestrator judges the run unrecoverable or the
546
+ evaluator blocked a round. Approve to resume, force a revision back to
547
+ preflight for evaluator/spec repair that preserves existing node validity,
548
+ or abort and start a fresh run if the objective must change.
549
+ acceptedEvents: [APPROVE, FORCE_REVISION, ABORT]
550
+ present:
551
+ - run_spec
552
+ transitions:
553
+ - to: orchestrator
554
+ event: APPROVE
555
+ - to: preflight
556
+ event: FORCE_REVISION
557
+ actions:
558
+ - { type: resetVisitCounts, stateIds: [preflight, orchestrator] }
559
+ - to: aborted
560
+ event: ABORT
561
+
562
+ final_summary:
563
+ type: agent
564
+ description: >
565
+ Read the durable run state and the best node, and write a human-readable
566
+ report summarizing the run for the final human review.
567
+ persona: global
568
+ prompt: |
569
+ The Evolve run has reached a stop condition. Produce a concise, human-readable
570
+ report of what the run found, for a human reviewer who will decide whether to
571
+ accept the result or request more rounds.
572
+
573
+ Read the durable run state:
574
+ - /workspace/.evolve_runs/main/run_spec.yaml - the objective, evaluator, and
575
+ budget.max_rounds (= N).
576
+ - /workspace/.evolve_runs/main/database_data/nodes.json - every recorded node
577
+ (id, parent, score, analysis). Use it for the per-node trajectory, NOT for
578
+ round counts.
579
+ - /workspace/.evolve_runs/main/current/stop_signals.json - the precomputed
580
+ stop_reason and stop metrics, and the authoritative round accounting:
581
+ done_rounds (GENERATIONS recorded - one fan-out batch of N lanes is ONE
582
+ generation; equals the node tally at the workers:1 default) and node_count
583
+ (the raw recorded-node tally). Read done_rounds from here; do NOT count
584
+ nodes.json. Use this file's stop_reason; do NOT recompute the stop
585
+ condition.
586
+ - /workspace/.evolve_runs/main/best/ - the best snapshot per improving round;
587
+ the highest-scoring node is the run's result.
588
+
589
+ Write a Markdown report to BOTH of these paths:
590
+ /workspace/.evolve_runs/main/final_report.md
591
+ /workspace/.workflow/final_report/final_report.md
592
+ Create the /workspace/.workflow/final_report/ directory if it does not exist.
593
+ The report MUST contain, in this order:
594
+ 1. The objective (one line, from run_spec.yaml).
595
+ 2. done_rounds vs budget.max_rounds (done_rounds from stop_signals.json,
596
+ counting generations - one fan-out batch is one generation).
597
+ 3. The stop reason from stop_signals.json: target_met, patience, max_rounds,
598
+ or the recorded null/unknown value if no stop signal is present.
599
+ 4. The best node: its id, its score, and its analysis/lesson.
600
+ 5. The score trajectory across rounds (id -> score), so the reviewer can see
601
+ whether the search was still improving at the stop condition.
602
+ 6. A one-paragraph recommendation: is the result acceptable, or would more
603
+ rounds plausibly help.
604
+
605
+ Do NOT re-run the evaluator, write candidates, or modify any node. You only read
606
+ durable state and write final_report.md.
607
+
608
+ Finish with the required agent_status block; your verdict is informational.
609
+ inputs:
610
+ - run_spec
611
+ outputs:
612
+ - final_report
613
+ transitions:
614
+ - to: final_review
615
+
616
+ final_review:
617
+ type: human_gate
618
+ description: >
619
+ Human review of the completed run. Approve to finish, force a revision to run
620
+ more rounds, or abort.
621
+ acceptedEvents: [APPROVE, FORCE_REVISION, ABORT]
622
+ present:
623
+ - final_report
624
+ transitions:
625
+ - to: done
626
+ event: APPROVE
627
+ - to: orchestrator
628
+ event: FORCE_REVISION
629
+ actions:
630
+ - { type: resetVisitCounts, stateIds: [orchestrator] }
631
+ - to: aborted
632
+ event: ABORT
633
+
634
+ done:
635
+ type: terminal
636
+ description: Round budget reached and human-approved; candidates scored and recorded.
637
+
638
+ failed:
639
+ type: terminal
640
+ description: >
641
+ Mechanical failure - preflight blocked, sampler/engine crash, result-file
642
+ contract error, record failure, or round-limit wedge backstop.
643
+
644
+ aborted:
645
+ type: terminal
646
+ description: Operator aborted the run at a human gate.
@@ -1,5 +1,6 @@
1
1
  name: test-email-summary
2
2
  description: 'TESTING ONLY — fetch a small set of emails (exec-assistant) then summarize them to a file (global). Used to smoke-test the agent skills feature; not a real workflow. The task description supplies the scope (which emails: sent/received, count, time range, etc.).'
3
+ hidden: true
3
4
  initial: fetch
4
5
 
5
6
  settings: