orizu 0.5.19 → 0.5.21

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 (378) hide show
  1. package/README.md +23 -0
  2. package/dist/archive-artifacts-cli.d.ts +50 -0
  3. package/dist/archive-artifacts-cli.d.ts.map +1 -0
  4. package/dist/artifact-archive.d.ts +48 -0
  5. package/dist/artifact-archive.d.ts.map +1 -0
  6. package/dist/artifact-pull.d.ts +22 -0
  7. package/dist/artifact-pull.d.ts.map +1 -0
  8. package/dist/banner.d.ts +3 -0
  9. package/dist/banner.d.ts.map +1 -0
  10. package/dist/connectors-cli.d.ts +31 -0
  11. package/dist/connectors-cli.d.ts.map +1 -0
  12. package/dist/credentials.d.ts +46 -0
  13. package/dist/credentials.d.ts.map +1 -0
  14. package/dist/csv.d.ts +49 -0
  15. package/dist/csv.d.ts.map +1 -0
  16. package/dist/dataset-download.d.ts +6 -0
  17. package/dist/dataset-download.d.ts.map +1 -0
  18. package/dist/dataset-edit-rows.d.ts +10 -0
  19. package/dist/dataset-edit-rows.d.ts.map +1 -0
  20. package/dist/dataset-upload-snapshot.d.ts +13 -0
  21. package/dist/dataset-upload-snapshot.d.ts.map +1 -0
  22. package/dist/daytona-slice-rehearsal.d.ts +89 -0
  23. package/dist/daytona-slice-rehearsal.d.ts.map +1 -0
  24. package/dist/daytona-slice.d.ts +106 -0
  25. package/dist/daytona-slice.d.ts.map +1 -0
  26. package/dist/deploy-key-merge-core.d.ts +121 -0
  27. package/dist/deploy-key-merge-core.d.ts.map +1 -0
  28. package/dist/diff-comments-cli.d.ts +12 -0
  29. package/dist/diff-comments-cli.d.ts.map +1 -0
  30. package/dist/diff-comments-cli.js +21 -2
  31. package/dist/egress-allowlist-cli.d.ts +23 -0
  32. package/dist/egress-allowlist-cli.d.ts.map +1 -0
  33. package/dist/egress-policy.d.ts +108 -0
  34. package/dist/egress-policy.d.ts.map +1 -0
  35. package/dist/error-response.d.ts +9 -0
  36. package/dist/error-response.d.ts.map +1 -0
  37. package/dist/file-parser.d.ts +5 -0
  38. package/dist/file-parser.d.ts.map +1 -0
  39. package/dist/gepa-engine-dispatch.d.ts +9 -0
  40. package/dist/gepa-engine-dispatch.d.ts.map +1 -0
  41. package/dist/gepa-engine-dispatch.js +307 -0
  42. package/dist/gepa-python-command.d.ts +6 -0
  43. package/dist/gepa-python-command.d.ts.map +1 -0
  44. package/dist/gepa-python-command.js +26 -0
  45. package/dist/gepa-python-paths.d.ts +6 -0
  46. package/dist/gepa-python-paths.d.ts.map +1 -0
  47. package/dist/gepa-python-paths.js +42 -0
  48. package/dist/git-credential.d.ts +69 -0
  49. package/dist/git-credential.d.ts.map +1 -0
  50. package/dist/git-recovery-environment.d.ts +31 -0
  51. package/dist/git-recovery-environment.d.ts.map +1 -0
  52. package/dist/github-setup.d.ts +122 -0
  53. package/dist/github-setup.d.ts.map +1 -0
  54. package/dist/global-flags.d.ts +12 -0
  55. package/dist/global-flags.d.ts.map +1 -0
  56. package/dist/help.d.ts +46 -0
  57. package/dist/help.d.ts.map +1 -0
  58. package/dist/help.js +93 -25
  59. package/dist/hosted-boot.d.ts +273 -0
  60. package/dist/hosted-boot.d.ts.map +1 -0
  61. package/dist/hosted-bootstrap-rehearsal.d.ts +86 -0
  62. package/dist/hosted-bootstrap-rehearsal.d.ts.map +1 -0
  63. package/dist/hosted-bootstrap.d.ts +188 -0
  64. package/dist/hosted-bootstrap.d.ts.map +1 -0
  65. package/dist/hosted-broker-server.d.ts +50 -0
  66. package/dist/hosted-broker-server.d.ts.map +1 -0
  67. package/dist/hosted-git-http-server.d.ts +36 -0
  68. package/dist/hosted-git-http-server.d.ts.map +1 -0
  69. package/dist/hosted-harness-claude.d.ts +195 -0
  70. package/dist/hosted-harness-claude.d.ts.map +1 -0
  71. package/dist/hosted-harness-opencode.d.ts +227 -0
  72. package/dist/hosted-harness-opencode.d.ts.map +1 -0
  73. package/dist/hosted-harness.d.ts +118 -0
  74. package/dist/hosted-harness.d.ts.map +1 -0
  75. package/dist/hosted-harvest.d.ts +68 -0
  76. package/dist/hosted-harvest.d.ts.map +1 -0
  77. package/dist/hosted-headless.d.ts +72 -0
  78. package/dist/hosted-headless.d.ts.map +1 -0
  79. package/dist/hosted-loop-lifecycle.d.ts +206 -0
  80. package/dist/hosted-loop-lifecycle.d.ts.map +1 -0
  81. package/dist/hosted-loop.d.ts +170 -0
  82. package/dist/hosted-loop.d.ts.map +1 -0
  83. package/dist/hosted-run-event-sink.d.ts +222 -0
  84. package/dist/hosted-run-event-sink.d.ts.map +1 -0
  85. package/dist/hosted-runtime-assets.d.ts +186 -0
  86. package/dist/hosted-runtime-assets.d.ts.map +1 -0
  87. package/dist/hosted-session-cli.d.ts +258 -0
  88. package/dist/hosted-session-cli.d.ts.map +1 -0
  89. package/dist/hosted-skill-staging.d.ts +73 -0
  90. package/dist/hosted-skill-staging.d.ts.map +1 -0
  91. package/dist/http.d.ts +8 -0
  92. package/dist/http.d.ts.map +1 -0
  93. package/dist/index.d.ts +22 -0
  94. package/dist/index.d.ts.map +1 -0
  95. package/dist/index.js +119 -129
  96. package/dist/instruction-set-gepa-launch.d.ts +3 -0
  97. package/dist/instruction-set-gepa-launch.d.ts.map +1 -0
  98. package/dist/instruction-set-gepa-launch.js +15 -0
  99. package/dist/instruction-set-loader.d.ts +6 -0
  100. package/dist/instruction-set-loader.d.ts.map +1 -0
  101. package/dist/instruction-set-loader.js +59 -0
  102. package/dist/instruction-set-manifest.d.ts +14 -0
  103. package/dist/instruction-set-manifest.d.ts.map +1 -0
  104. package/dist/instruction-set-manifest.js +162 -0
  105. package/dist/instruction-sets-cli.d.ts +40 -0
  106. package/dist/instruction-sets-cli.d.ts.map +1 -0
  107. package/dist/instruction-sets-cli.js +361 -0
  108. package/dist/json-response.d.ts +4 -0
  109. package/dist/json-response.d.ts.map +1 -0
  110. package/dist/jsonl-stream.d.ts +8 -0
  111. package/dist/jsonl-stream.d.ts.map +1 -0
  112. package/dist/kill-switch-cli.d.ts +30 -0
  113. package/dist/kill-switch-cli.d.ts.map +1 -0
  114. package/dist/loopback-serve.d.ts +25 -0
  115. package/dist/loopback-serve.d.ts.map +1 -0
  116. package/dist/manifests-cli.d.ts +22 -0
  117. package/dist/manifests-cli.d.ts.map +1 -0
  118. package/dist/markdown-report-input.d.ts +7 -0
  119. package/dist/markdown-report-input.d.ts.map +1 -0
  120. package/dist/markdown-report-input.js +15 -1
  121. package/dist/merge-job.d.ts +155 -0
  122. package/dist/merge-job.d.ts.map +1 -0
  123. package/dist/model-configs-cli.d.ts +19 -0
  124. package/dist/model-configs-cli.d.ts.map +1 -0
  125. package/dist/model-configs-cli.js +104 -0
  126. package/dist/optimization-export-cli.d.ts +19 -0
  127. package/dist/optimization-export-cli.d.ts.map +1 -0
  128. package/dist/optimizations-list-cli.d.ts +20 -0
  129. package/dist/optimizations-list-cli.d.ts.map +1 -0
  130. package/dist/optimizations-promote-cli.d.ts +8 -0
  131. package/dist/optimizations-promote-cli.d.ts.map +1 -0
  132. package/dist/optimizations-promote-cli.js +34 -0
  133. package/dist/option-validation.d.ts +15 -0
  134. package/dist/option-validation.d.ts.map +1 -0
  135. package/dist/preview-runtime.d.ts +63 -0
  136. package/dist/preview-runtime.d.ts.map +1 -0
  137. package/dist/prompt-draft-push.d.ts +60 -0
  138. package/dist/prompt-draft-push.d.ts.map +1 -0
  139. package/dist/prompt-label-cli.d.ts +11 -0
  140. package/dist/prompt-label-cli.d.ts.map +1 -0
  141. package/dist/prompt-label-cli.js +29 -0
  142. package/dist/prompt-length-wire.d.ts +28 -0
  143. package/dist/prompt-length-wire.d.ts.map +1 -0
  144. package/dist/prompt-length-wire.js +2 -2
  145. package/dist/prompt-report-cli.d.ts +10 -0
  146. package/dist/prompt-report-cli.d.ts.map +1 -0
  147. package/dist/prompt-report-cli.js +2 -2
  148. package/dist/prompt-summary-table.d.ts +15 -0
  149. package/dist/prompt-summary-table.d.ts.map +1 -0
  150. package/dist/prompt-summary-table.js +6 -0
  151. package/dist/registration-tag-warning.d.ts +32 -0
  152. package/dist/registration-tag-warning.d.ts.map +1 -0
  153. package/dist/report-comments-cli.d.ts +16 -0
  154. package/dist/report-comments-cli.d.ts.map +1 -0
  155. package/dist/report-markdown-blankness.d.ts +2 -0
  156. package/dist/report-markdown-blankness.d.ts.map +1 -0
  157. package/dist/report-markdown-blankness.js +6 -0
  158. package/dist/report-replacement-warning.d.ts +17 -0
  159. package/dist/report-replacement-warning.d.ts.map +1 -0
  160. package/dist/report-replacement-warning.js +31 -0
  161. package/dist/repository-backup-core.d.ts +225 -0
  162. package/dist/repository-backup-core.d.ts.map +1 -0
  163. package/dist/repository-recovery-manifest.d.ts +83 -0
  164. package/dist/repository-recovery-manifest.d.ts.map +1 -0
  165. package/dist/run-event-digest.d.ts +74 -0
  166. package/dist/run-event-digest.d.ts.map +1 -0
  167. package/dist/runner-dir-verify.d.ts +66 -0
  168. package/dist/runner-dir-verify.d.ts.map +1 -0
  169. package/dist/runner-instruction-set-contract.d.ts +24 -0
  170. package/dist/runner-instruction-set-contract.d.ts.map +1 -0
  171. package/dist/runner-instruction-set-contract.js +50 -0
  172. package/dist/sandbox-hygiene.d.ts +45 -0
  173. package/dist/sandbox-hygiene.d.ts.map +1 -0
  174. package/dist/sandbox-provider.d.ts +193 -0
  175. package/dist/sandbox-provider.d.ts.map +1 -0
  176. package/dist/scorer-draft-push.d.ts +50 -0
  177. package/dist/scorer-draft-push.d.ts.map +1 -0
  178. package/dist/scorers-cli.d.ts +20 -0
  179. package/dist/scorers-cli.d.ts.map +1 -0
  180. package/dist/scorers-cli.js +22 -0
  181. package/dist/scorers-verify-parity-bridge.d.ts +16 -0
  182. package/dist/scorers-verify-parity-bridge.d.ts.map +1 -0
  183. package/dist/scorers-verify-parity-bridge.js +90 -0
  184. package/dist/scorers-verify-parity.d.ts +81 -0
  185. package/dist/scorers-verify-parity.d.ts.map +1 -0
  186. package/dist/scorers-verify-parity.js +502 -0
  187. package/dist/scores-accept-cli.d.ts +21 -0
  188. package/dist/scores-accept-cli.d.ts.map +1 -0
  189. package/dist/secret-redaction.d.ts +47 -0
  190. package/dist/secret-redaction.d.ts.map +1 -0
  191. package/dist/session-timeline.d.ts +54 -0
  192. package/dist/session-timeline.d.ts.map +1 -0
  193. package/dist/setup-prompt.d.ts +5 -0
  194. package/dist/setup-prompt.d.ts.map +1 -0
  195. package/dist/skill-installer.d.ts +68 -0
  196. package/dist/skill-installer.d.ts.map +1 -0
  197. package/dist/skilled-proposer-launch.d.ts +7 -0
  198. package/dist/skilled-proposer-launch.d.ts.map +1 -0
  199. package/dist/skilled-proposer-launch.js +60 -0
  200. package/dist/smoke.d.ts +102 -0
  201. package/dist/smoke.d.ts.map +1 -0
  202. package/dist/start-intent.d.ts +12 -0
  203. package/dist/start-intent.d.ts.map +1 -0
  204. package/dist/task-assignment-manifest.d.ts +15 -0
  205. package/dist/task-assignment-manifest.d.ts.map +1 -0
  206. package/dist/task-create-error.d.ts +18 -0
  207. package/dist/task-create-error.d.ts.map +1 -0
  208. package/dist/team-connectors-cli.d.ts +29 -0
  209. package/dist/team-connectors-cli.d.ts.map +1 -0
  210. package/dist/types.d.ts +39 -0
  211. package/dist/types.d.ts.map +1 -0
  212. package/dist/vercel-sandbox-provider.d.ts +156 -0
  213. package/dist/vercel-sandbox-provider.d.ts.map +1 -0
  214. package/dist/workbench-cli.d.ts +233 -0
  215. package/dist/workbench-cli.d.ts.map +1 -0
  216. package/dist/workspace-sync.d.ts +207 -0
  217. package/dist/workspace-sync.d.ts.map +1 -0
  218. package/dist/workspace.d.ts +92 -0
  219. package/dist/workspace.d.ts.map +1 -0
  220. package/dist/zip-draft-push.d.ts +55 -0
  221. package/dist/zip-draft-push.d.ts.map +1 -0
  222. package/package.json +15 -2
  223. package/requirements/README.md +138 -0
  224. package/requirements/skilled-proposer.in +66 -0
  225. package/requirements/skilled-proposer.lock +265 -0
  226. package/scripts/build-cli-dist.mjs +30 -0
  227. package/scripts/ensure-skilled-proposer-venv.mjs +5 -0
  228. package/scripts/orizu-source-checkout.d.mts +1 -0
  229. package/scripts/orizu-source-checkout.mjs +10 -0
  230. package/scripts/refresh-skilled-proposer-lock.mjs +256 -0
  231. package/scripts/vendor-gepa-python.mjs +187 -4
  232. package/src/diff-comments-cli.ts +41 -3
  233. package/src/gepa-engine-dispatch.ts +340 -0
  234. package/src/gepa-python-command.ts +31 -0
  235. package/src/gepa-python-paths.ts +56 -0
  236. package/src/help.ts +95 -25
  237. package/src/index.ts +131 -166
  238. package/src/instruction-set-gepa-launch.ts +28 -0
  239. package/src/instruction-set-loader.ts +37 -0
  240. package/src/instruction-set-manifest.ts +120 -0
  241. package/src/instruction-sets-cli.ts +306 -0
  242. package/src/markdown-report-input.ts +19 -1
  243. package/src/model-configs-cli.ts +119 -0
  244. package/src/optimizations-promote-cli.ts +41 -0
  245. package/src/prompt-label-cli.ts +55 -0
  246. package/src/prompt-length-wire.ts +1 -1
  247. package/src/prompt-report-cli.ts +2 -2
  248. package/src/prompt-summary-table.ts +12 -0
  249. package/src/report-markdown-blankness.ts +6 -0
  250. package/src/report-replacement-warning.ts +35 -0
  251. package/src/runner-instruction-set-contract.ts +64 -0
  252. package/src/scorers-cli.ts +40 -0
  253. package/src/scorers-verify-parity-bridge.ts +90 -0
  254. package/src/scorers-verify-parity.ts +564 -0
  255. package/src/skilled-proposer-launch.ts +89 -0
  256. package/src/skilled-proposer-venv-manager.mjs +757 -0
  257. package/tsconfig.json +2 -0
  258. package/vendor/gepa-python/LICENSE +7 -0
  259. package/vendor/gepa-python/manifest.json +107 -0
  260. package/vendor/gepa-python/src/gepa/__init__.py +22 -0
  261. package/vendor/gepa-python/src/gepa/adapters/__init__.py +0 -0
  262. package/vendor/gepa-python/src/gepa/adapters/anymaths_adapter/__init__.py +1 -0
  263. package/vendor/gepa-python/src/gepa/adapters/anymaths_adapter/anymaths_adapter.py +174 -0
  264. package/vendor/gepa-python/src/gepa/adapters/confidence_adapter/__init__.py +26 -0
  265. package/vendor/gepa-python/src/gepa/adapters/confidence_adapter/confidence_adapter.py +618 -0
  266. package/vendor/gepa-python/src/gepa/adapters/confidence_adapter/scoring.py +206 -0
  267. package/vendor/gepa-python/src/gepa/adapters/default_adapter/__init__.py +0 -0
  268. package/vendor/gepa-python/src/gepa/adapters/default_adapter/default_adapter.py +206 -0
  269. package/vendor/gepa-python/src/gepa/adapters/dspy_adapter/__init__.py +0 -0
  270. package/vendor/gepa-python/src/gepa/adapters/dspy_adapter/dspy_adapter.py +525 -0
  271. package/vendor/gepa-python/src/gepa/adapters/dspy_adapter/instruction_proposal.py +500 -0
  272. package/vendor/gepa-python/src/gepa/adapters/dspy_full_program_adapter/__init__.py +6 -0
  273. package/vendor/gepa-python/src/gepa/adapters/dspy_full_program_adapter/dspy_program_proposal_signature.py +137 -0
  274. package/vendor/gepa-python/src/gepa/adapters/dspy_full_program_adapter/full_program_adapter.py +269 -0
  275. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/__init__.py +56 -0
  276. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/evaluation_metrics.py +226 -0
  277. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/generic_rag_adapter.py +496 -0
  278. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/rag_pipeline.py +238 -0
  279. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_store_interface.py +212 -0
  280. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/__init__.py +2 -0
  281. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/chroma_store.py +196 -0
  282. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/lancedb_store.py +422 -0
  283. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/milvus_store.py +409 -0
  284. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/qdrant_store.py +368 -0
  285. package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/weaviate_store.py +418 -0
  286. package/vendor/gepa-python/src/gepa/adapters/langchain_adapter/__init__.py +11 -0
  287. package/vendor/gepa-python/src/gepa/adapters/langchain_adapter/langchain_adapter.py +261 -0
  288. package/vendor/gepa-python/src/gepa/adapters/mcp_adapter/__init__.py +37 -0
  289. package/vendor/gepa-python/src/gepa/adapters/mcp_adapter/mcp_adapter.py +693 -0
  290. package/vendor/gepa-python/src/gepa/adapters/mcp_adapter/mcp_client.py +364 -0
  291. package/vendor/gepa-python/src/gepa/adapters/optimize_anything_adapter/optimize_anything_adapter.py +879 -0
  292. package/vendor/gepa-python/src/gepa/adapters/terminal_bench_adapter/__init__.py +0 -0
  293. package/vendor/gepa-python/src/gepa/adapters/terminal_bench_adapter/terminal_bench_adapter.py +217 -0
  294. package/vendor/gepa-python/src/gepa/api.py +468 -0
  295. package/vendor/gepa-python/src/gepa/core/__init__.py +0 -0
  296. package/vendor/gepa-python/src/gepa/core/adapter.py +227 -0
  297. package/vendor/gepa-python/src/gepa/core/callbacks.py +551 -0
  298. package/vendor/gepa-python/src/gepa/core/data_loader.py +74 -0
  299. package/vendor/gepa-python/src/gepa/core/engine.py +1025 -0
  300. package/vendor/gepa-python/src/gepa/core/result.py +271 -0
  301. package/vendor/gepa-python/src/gepa/core/state.py +706 -0
  302. package/vendor/gepa-python/src/gepa/examples/__init__.py +0 -0
  303. package/vendor/gepa-python/src/gepa/examples/aime.py +24 -0
  304. package/vendor/gepa-python/src/gepa/examples/anymaths-bench/eval_default.py +111 -0
  305. package/vendor/gepa-python/src/gepa/examples/anymaths-bench/train_anymaths.py +177 -0
  306. package/vendor/gepa-python/src/gepa/examples/mcp_adapter/__init__.py +4 -0
  307. package/vendor/gepa-python/src/gepa/examples/mcp_adapter/mcp_optimization_example.py +456 -0
  308. package/vendor/gepa-python/src/gepa/examples/rag_adapter/__init__.py +9 -0
  309. package/vendor/gepa-python/src/gepa/examples/rag_adapter/rag_optimization.py +824 -0
  310. package/vendor/gepa-python/src/gepa/examples/terminal-bench/train_terminus.py +161 -0
  311. package/vendor/gepa-python/src/gepa/gepa_utils.py +117 -0
  312. package/vendor/gepa-python/src/gepa/gskill/__init__.py +1 -0
  313. package/vendor/gepa-python/src/gepa/gskill/gskill/__init__.py +0 -0
  314. package/vendor/gepa-python/src/gepa/gskill/gskill/cost_tracker.py +194 -0
  315. package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/__init__.py +0 -0
  316. package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/claude_code.py +1117 -0
  317. package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/claude_code_skills.py +613 -0
  318. package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/mini_swe_agent.py +440 -0
  319. package/vendor/gepa-python/src/gepa/gskill/gskill/experiment_logger.py +367 -0
  320. package/vendor/gepa-python/src/gepa/gskill/gskill/swe_fitness_fn.py +209 -0
  321. package/vendor/gepa-python/src/gepa/gskill/gskill/swe_harness.py +352 -0
  322. package/vendor/gepa-python/src/gepa/gskill/gskill/train_optimize_anything.py +830 -0
  323. package/vendor/gepa-python/src/gepa/image.py +104 -0
  324. package/vendor/gepa-python/src/gepa/lm.py +261 -0
  325. package/vendor/gepa-python/src/gepa/logging/__init__.py +0 -0
  326. package/vendor/gepa-python/src/gepa/logging/experiment_tracker.py +457 -0
  327. package/vendor/gepa-python/src/gepa/logging/logger.py +75 -0
  328. package/vendor/gepa-python/src/gepa/logging/utils.py +130 -0
  329. package/vendor/gepa-python/src/gepa/optimize_anything.py +1701 -0
  330. package/vendor/gepa-python/src/gepa/proposer/__init__.py +0 -0
  331. package/vendor/gepa-python/src/gepa/proposer/base.py +53 -0
  332. package/vendor/gepa-python/src/gepa/proposer/merge.py +403 -0
  333. package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/__init__.py +0 -0
  334. package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/base.py +64 -0
  335. package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/reflection_lm.py +178 -0
  336. package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/reflective_mutation.py +641 -0
  337. package/vendor/gepa-python/src/gepa/py.typed +0 -0
  338. package/vendor/gepa-python/src/gepa/strategies/__init__.py +0 -0
  339. package/vendor/gepa-python/src/gepa/strategies/acceptance.py +66 -0
  340. package/vendor/gepa-python/src/gepa/strategies/batch_sampler.py +103 -0
  341. package/vendor/gepa-python/src/gepa/strategies/candidate_selector.py +82 -0
  342. package/vendor/gepa-python/src/gepa/strategies/component_selector.py +36 -0
  343. package/vendor/gepa-python/src/gepa/strategies/eval_policy.py +64 -0
  344. package/vendor/gepa-python/src/gepa/strategies/instruction_proposal.py +153 -0
  345. package/vendor/gepa-python/src/gepa/strategies/proposal_sampling.py +128 -0
  346. package/vendor/gepa-python/src/gepa/strategies/proposal_selection.py +84 -0
  347. package/vendor/gepa-python/src/gepa/utils/__init__.py +63 -0
  348. package/vendor/gepa-python/src/gepa/utils/code_execution.py +626 -0
  349. package/vendor/gepa-python/src/gepa/utils/stdio_capture.py +145 -0
  350. package/vendor/gepa-python/src/gepa/utils/stop_condition.py +230 -0
  351. package/vendor/gepa-python/src/gepa/visualization.py +359 -0
  352. package/vendor/orizu-gepa/pyproject.toml +18 -0
  353. package/vendor/orizu-gepa/src/orizu_gepa_connector/__init__.py +9 -0
  354. package/vendor/orizu-gepa/src/orizu_gepa_connector/__main__.py +5 -0
  355. package/vendor/orizu-gepa/src/orizu_gepa_connector/adapter.py +138 -0
  356. package/vendor/orizu-gepa/src/orizu_gepa_connector/callbacks.py +666 -0
  357. package/vendor/orizu-gepa/src/orizu_gepa_connector/cli.py +7 -0
  358. package/vendor/orizu-gepa/src/orizu_gepa_connector/engine.py +269 -0
  359. package/vendor/orizu-gepa/src/orizu_gepa_connector/instruction_set_loader.py +52 -0
  360. package/vendor/orizu-gepa/src/orizu_gepa_connector/preflight.py +64 -0
  361. package/vendor/orizu-gepa/src/orizu_gepa_connector/reflection.py +186 -0
  362. package/vendor/orizu-gepa/src/orizu_gepa_connector/runtime.py +721 -0
  363. package/vendor/orizu-gepa/src/orizu_gepa_connector/skilled_proposer_bridge.py +381 -0
  364. package/vendor/orizu-gepa/src/orizu_gepa_connector/stop_conditions.py +55 -0
  365. package/vendor/orizu-gepa/src/orizu_gepa_connector/translator.py +203 -0
  366. package/vendor/orizu-gepa-python/pyproject.toml +1 -1
  367. package/vendor/orizu-gepa-python/src/orizu_gepa/cli.py +1 -0
  368. package/vendor/orizu-gepa-python/src/orizu_gepa/client.py +52 -7
  369. package/vendor/orizu-gepa-python/src/orizu_gepa/local_log.py +52 -0
  370. package/vendor/orizu-gepa-python/src/orizu_gepa/optimizer.py +10 -5
  371. package/vendor/orizu-gepa-python/src/orizu_gepa/reflection.py +323 -68
  372. package/vendor/orizu-gepa-python/src/orizu_gepa/runner.py +207 -13
  373. package/vendor/skills/orizu-cli/SKILL.md +3 -1
  374. package/vendor/skills/orizu-cli/references/cli-reference.md +85 -1
  375. package/vendor/skills/orizu-cli/references/migrate-existing-gepa-setup.md +303 -0
  376. package/vendor/skills/orizu-cli/references/optimization-reports.md +1 -1
  377. package/vendor/skills/orizu-cli/references/optimization-with-gepa.md +26 -1
  378. package/vendor/skills/orizu-cli/references/prompt-control-plane.md +113 -10
package/dist/index.js CHANGED
@@ -28,11 +28,15 @@ import { formatTaskCreateError } from './task-create-error.js';
28
28
  import { renderAgentSetupPrompt } from './setup-prompt.js';
29
29
  import { getWorkspaceRoot, initOrizuWorkspace, workspaceExists, } from './workspace.js';
30
30
  import { connectorsCommand } from './connectors-cli.js';
31
+ import { modelConfigsCommand } from './model-configs-cli.js';
31
32
  import { ARTIFACT_MAX_BYTES, runnerOptimizerCommand } from './artifact-pull.js';
32
33
  import { killSwitchCommand } from './kill-switch-cli.js';
33
34
  import { egressAllowlistCommand } from './egress-allowlist-cli.js';
34
35
  import { acceptScoreRunCommand } from './scores-accept-cli.js';
35
36
  import { listOptimizationRunsCommand } from './optimizations-list-cli.js';
37
+ import { promoteOptimizationCommand } from './optimizations-promote-cli.js';
38
+ import { scorersCommand } from './scorers-cli.js';
39
+ import { verifyScorerParityCommand } from './scorers-verify-parity.js';
36
40
  import { archiveArtifactCommand, listAssignmentsCommand, printAppSummaries, printDatasetSummaries, printScorerSummaries, printTaskSummaries, } from './archive-artifacts-cli.js';
37
41
  import { teamConnectorsCommand } from './team-connectors-cli.js';
38
42
  import { manifestsCommand } from './manifests-cli.js';
@@ -40,18 +44,28 @@ import { workbenchCommand } from './workbench-cli.js';
40
44
  import { hostedCommand } from './hosted-session-cli.js';
41
45
  import { workspaceSyncCommand } from './workspace-sync.js';
42
46
  import { runGitCredentialInvocation } from './git-credential.js';
47
+ import { instructionSetsCommand, syncToDisk } from './instruction-sets-cli.js';
48
+ export { loadInstructionSet } from './instruction-set-loader.js';
49
+ import { runnerInputInstructionSet, runnerInputPrompt, runnerInstructionSetSyncSet } from './runner-instruction-set-contract.js';
43
50
  import { pushPromptDraft } from './prompt-draft-push.js';
44
51
  import { readMarkdownReportInput } from './markdown-report-input.js';
45
52
  import { promptPushErrorMessage, promptReportCommand } from './prompt-report-cli.js';
53
+ import { setPromptLabel } from './prompt-label-cli.js';
46
54
  import { printPromptSummaryTable } from './prompt-summary-table.js';
47
55
  import { assertSnapshotManifestConfined, verifyGepaRunnerDirsFromArgs, verifyRunnerDirRegistered } from './runner-dir-verify.js';
48
56
  import { runScorersRegister } from './scorer-draft-push.js';
49
57
  import { runZipArtifactPush } from './zip-draft-push.js';
50
58
  import { runGithubLink, runInteractiveHostedSetup } from './github-setup.js';
51
59
  import { parseJsonResponse, sanitizeTerminalText } from './json-response.js';
60
+ import { reportReplacementWarning } from './report-replacement-warning.js';
52
61
  import { reportCommentsCommand, throwDeprecatedPromptCommentsCommand, } from './report-comments-cli.js';
53
62
  import { diffCommentsCommand } from './diff-comments-cli.js';
54
63
  import { exportOptimizationRunCommand } from './optimization-export-cli.js';
64
+ import { dispatchGepaEngine } from './gepa-engine-dispatch.js';
65
+ import { resolveGepaInstructionSetProfileVersion } from './instruction-set-gepa-launch.js';
66
+ import { getGepaPythonCommand } from './gepa-python-command.js';
67
+ import { getGepaPythonPathEntries } from './gepa-python-paths.js';
68
+ import { prepareSkilledProposerLaunch } from './skilled-proposer-launch.js';
55
69
  export { parseJsonResponse, sanitizeTerminalText } from './json-response.js';
56
70
  function getErrorMessage(error) {
57
71
  return error instanceof Error ? error.message : String(error);
@@ -185,6 +199,14 @@ export function createCodeChallenge(verifier) {
185
199
  function printError(message) {
186
200
  console.error(sanitizeTerminalText(message));
187
201
  }
202
+ function printPushDisclosures(data) {
203
+ const warning = reportReplacementWarning(data);
204
+ if (warning)
205
+ printError(warning);
206
+ if (data.metadata_updated === true) {
207
+ printError('Updated prompt metadata on the identical existing version');
208
+ }
209
+ }
188
210
  export function validateBrowserUrl(url, expectedOrigin) {
189
211
  let parsed;
190
212
  try {
@@ -1014,8 +1036,10 @@ async function pushPromptArtifact(kind) {
1014
1036
  });
1015
1037
  if (hasJsonFlag())
1016
1038
  printJson(data);
1017
- else
1039
+ else {
1040
+ printPushDisclosures(data);
1018
1041
  printLine(message);
1042
+ }
1019
1043
  return;
1020
1044
  }
1021
1045
  // LEGACY SESSIONLESS PATH (no branch to commit to; the server dual-writes
@@ -1061,6 +1085,7 @@ async function pushPromptArtifact(kind) {
1061
1085
  printJson(data);
1062
1086
  return;
1063
1087
  }
1088
+ printPushDisclosures(data);
1064
1089
  printLine(`Pushed ${kind} ${sanitizeTerminalText(String(manifest.name || promptDir))} (${sanitizeTerminalText(String(data.prompt_version_id || 'unknown version'))})`);
1065
1090
  }
1066
1091
  async function pullPromptArtifact(kind) {
@@ -1159,6 +1184,7 @@ async function pullPromptArtifact(kind) {
1159
1184
  scorer_version_id: data.scorerVersionId || undefined,
1160
1185
  scorer_version_ids: scorerVersions.map(item => item.id),
1161
1186
  path: targetDir,
1187
+ owner: data.owner || undefined,
1162
1188
  });
1163
1189
  return;
1164
1190
  }
@@ -1170,55 +1196,14 @@ async function pullPromptArtifact(kind) {
1170
1196
  else if (!data.scorerVersionId && kind === 'judge') {
1171
1197
  printLine(`Warning: prompt version ${sanitizeTerminalText(data.version.id)} does not map to an executable scorer version.`);
1172
1198
  }
1173
- }
1174
- async function setPromptLabel() {
1175
- const promptName = getPositionalArg(3);
1176
- const label = getPositionalArg(4);
1177
- const project = getArg('--project') || await resolveProjectSlug(null);
1178
- const promptVersionId = getArg('--version');
1179
- if (!promptName || !label || !promptVersionId) {
1180
- throw new Error('Usage: orizu prompts labels set <prompt-name> <label> --version <prompt-version-id> [--project <team/project>] [--json]');
1181
- }
1182
- const response = await authedFetch(`/api/cli/prompts/labels?project=${encodeURIComponent(project)}`, {
1183
- method: 'POST',
1184
- headers: { 'Content-Type': 'application/json' },
1185
- body: JSON.stringify({
1186
- promptName,
1187
- label,
1188
- promptVersionId,
1189
- }),
1190
- });
1191
- if (!response.ok) {
1192
- throw new Error(`Failed to set prompt label: ${await response.text()}`);
1193
- }
1194
- const data = await parseJsonResponse(response, 'Prompt label set');
1195
- if (hasJsonFlag()) {
1196
- printJson(data);
1197
- return;
1199
+ if (kind === 'prompt' && data.owner) {
1200
+ printLine(`Owner: ${sanitizeTerminalText(data.prompt.name)} (${sanitizeTerminalText(data.prompt.id)}) -> ` +
1201
+ `${sanitizeTerminalText(data.owner.instructionSetSlug)} / ${sanitizeTerminalText(data.owner.componentKey)}`);
1198
1202
  }
1199
- printLine(`Moved ${sanitizeTerminalText(label)} to ${sanitizeTerminalText(promptVersionId)}`);
1200
1203
  }
1201
- async function setPromptArchivedState(archived) {
1202
- const promptRef = getPositionalArg(2);
1203
- const project = getArg('--project') || await resolveProjectSlug(null);
1204
- const command = archived ? 'archive' : 'restore';
1205
- if (!promptRef) {
1206
- throw new Error(`Usage: orizu prompts ${command} <prompt-id-or-name> --project <team/project> [--json]`);
1207
- }
1208
- const response = await authedFetch(`/api/cli/prompts/${encodeURIComponent(promptRef)}?project=${encodeURIComponent(project)}`, {
1209
- method: 'PATCH',
1210
- headers: { 'Content-Type': 'application/json' },
1211
- body: JSON.stringify({ archived }),
1212
- });
1213
- if (!response.ok) {
1214
- throw new Error(`Failed to ${command} prompt: ${await response.text()}`);
1215
- }
1216
- const data = await parseJsonResponse(response, `Prompt ${command}`);
1217
- if (hasJsonFlag()) {
1218
- printJson(data);
1219
- return;
1220
- }
1221
- printLine(`${archived ? 'Archived' : 'Restored'} prompt ${sanitizeTerminalText(data.prompt.name)} (${sanitizeTerminalText(data.prompt.id)})`);
1204
+ function refusePromptMutation(replacement) {
1205
+ process.exitCode = 1;
1206
+ throw new Error(`Use: orizu instructions ${replacement}`);
1222
1207
  }
1223
1208
  async function bindPromptScorer(role) {
1224
1209
  const promptId = getPositionalArg(3);
@@ -1248,6 +1233,10 @@ async function bindPromptScorer(role) {
1248
1233
  return;
1249
1234
  }
1250
1235
  printLine(`${role === 'headline' ? 'Set headline' : 'Added'} scorer ${sanitizeTerminalText(scorerVersionId)} for ${sanitizeTerminalText(promptId)}`);
1236
+ if (data.owner) {
1237
+ printLine(`Owner: ${sanitizeTerminalText(promptId)} -> ` +
1238
+ `${sanitizeTerminalText(data.owner.instructionSetSlug)} / ${sanitizeTerminalText(data.owner.componentKey)}`);
1239
+ }
1251
1240
  }
1252
1241
  function getPositionalArg(index) {
1253
1242
  const value = cliArgs[index];
@@ -1795,30 +1784,12 @@ async function updateOptimizationRunLifecycle(action) {
1795
1784
  }
1796
1785
  // ALI-1073 list moved to optimizations-list-cli.ts (line ratchet, ALI-976);
1797
1786
  // ALI-1175 labels its best scores as agent-reported evidence there.
1798
- function removeFlagWithValue(args, flag) {
1799
- const filtered = [];
1800
- for (let index = 0; index < args.length; index += 1) {
1801
- if (args[index] === flag) {
1802
- index += 1;
1803
- continue;
1804
- }
1805
- filtered.push(args[index]);
1806
- }
1807
- return filtered;
1808
- }
1809
- function bundledOrizuGepaPythonPath() {
1810
- const candidates = [
1811
- fileURLToPath(new URL('../vendor/orizu-gepa-python/src', import.meta.url)),
1812
- fileURLToPath(new URL('../../orizu-gepa-python/src', import.meta.url)),
1813
- ];
1814
- return candidates.find(candidate => existsSync(candidate)) ?? null;
1815
- }
1816
1787
  async function runGepaOptimization() {
1817
1788
  const project = getArg('--project') || await resolveProjectSlug(null);
1818
1789
  const baseUrl = getBaseUrl();
1819
- const python = getArg('--python') || process.env.PYTHON || 'python3';
1820
- const bundledPythonPath = bundledOrizuGepaPythonPath();
1821
- let forwardedArgs = removeFlagWithValue(cliArgs.slice(2), '--python');
1790
+ const runGepa = getGepaPythonCommand(cliArgs.slice(2), process.env);
1791
+ const python = runGepa.python;
1792
+ let forwardedArgs = runGepa.args;
1822
1793
  // ALI-1159 (ADR-007): GEPA executes ad-hoc local runner dirs while
1823
1794
  // attributing records to registered runner version ids — verify the bytes
1824
1795
  // ARE those versions before the optimizer spawns. Scans the forwarded argv
@@ -1828,6 +1799,7 @@ async function runGepaOptimization() {
1828
1799
  const verified = await verifyGepaRunnerDirsFromArgs(forwardedArgs);
1829
1800
  forwardedArgs = verified.args;
1830
1801
  let result;
1802
+ let selectedEngine = 'official';
1831
1803
  try {
1832
1804
  // Uniform resolution (ALI-1090): honors ORIZU_TOKEN / ORIZU_TOKEN_FILE before
1833
1805
  // credentials.json so hosted sandboxes can run optimizations. Read at spawn
@@ -1838,33 +1810,33 @@ async function runGepaOptimization() {
1838
1810
  if (!forwardedArgs.includes('--project')) {
1839
1811
  forwardedArgs = ['--project', project, ...forwardedArgs];
1840
1812
  }
1841
- const pythonPathEntries = [
1842
- bundledPythonPath,
1843
- process.env.PYTHONPATH,
1844
- ].filter((entry) => Boolean(entry));
1845
- result = spawnSync(python, ['-m', 'orizu_gepa.cli', ...forwardedArgs], {
1846
- stdio: 'inherit',
1847
- env: {
1848
- ...process.env,
1849
- ORIZU_API_URL: baseUrl,
1850
- ORIZU_TOKEN: token,
1851
- ORIZU_PROJECT: project,
1852
- // Integrity handshake (ALI-1159): the Python entrypoint refuses
1853
- // runner dirs that are not in this wrapper-verified list.
1854
- ORIZU_VERIFIED_RUNNER_DIRS: JSON.stringify(verified.verifiedDirs),
1855
- PYTHONPATH: pythonPathEntries.join(delimiter),
1856
- PYTHONUNBUFFERED: process.env.PYTHONUNBUFFERED || '1',
1857
- },
1813
+ const dispatch = dispatchGepaEngine(forwardedArgs, project, {
1814
+ ...process.env,
1815
+ ORIZU_API_URL: baseUrl,
1816
+ ORIZU_TOKEN: token,
1817
+ ORIZU_PROJECT: project,
1818
+ ORIZU_VERIFIED_RUNNER_DIRS: JSON.stringify(verified.verifiedDirs),
1819
+ PYTHONPATH: getGepaPythonPathEntries(process.env.PYTHONPATH).join(delimiter),
1820
+ PYTHONUNBUFFERED: process.env.PYTHONUNBUFFERED || '1',
1858
1821
  });
1822
+ const instructionSetName = dispatch.environment.ORIZU_INSTRUCTION_SET_NAME;
1823
+ const modelConfigIdentity = dispatch.environment.ORIZU_MODEL_CONFIG_IDENTITY;
1824
+ const instructionSetProfileVersionId = instructionSetName && modelConfigIdentity
1825
+ ? await resolveGepaInstructionSetProfileVersion(instructionSetName, modelConfigIdentity, project) : undefined;
1826
+ if (instructionSetProfileVersionId)
1827
+ dispatch.environment.ORIZU_INSTRUCTION_SET_PROFILE_VERSION_ID = instructionSetProfileVersionId;
1828
+ selectedEngine = dispatch.engine;
1829
+ const launch = prepareSkilledProposerLaunch(python, dispatch.engine, dispatch.environment);
1830
+ result = spawnSync(launch.python, ['-m', dispatch.module, ...dispatch.args], { stdio: 'inherit', env: launch.environment });
1859
1831
  }
1860
1832
  finally {
1861
1833
  verified.cleanup();
1862
1834
  }
1863
1835
  if (result.error) {
1864
- throw result.error;
1836
+ throw new Error(`${selectedEngine} GEPA engine failed: ${result.error.message}`, { cause: result.error });
1865
1837
  }
1866
1838
  if (result.status !== 0) {
1867
- throw new Error(`orizu-gepa failed with exit code ${result.status}`);
1839
+ throw new Error(`${selectedEngine} GEPA engine failed with exit code ${result.status}`);
1868
1840
  }
1869
1841
  if (hasJsonFlag()) {
1870
1842
  printJson({ status: 'completed', exitCode: 0 });
@@ -4459,7 +4431,7 @@ async function downloadAnnotations() {
4459
4431
  }
4460
4432
  printLine(`Saved ${format.toUpperCase()} export to ${sanitizeTerminalText(filename)}`);
4461
4433
  }
4462
- function readRunnerManifest(runnerDir) {
4434
+ export function readRunnerManifest(runnerDir) {
4463
4435
  const manifestPath = join(runnerDir, 'manifest.json');
4464
4436
  const raw = readSourceFile(manifestPath);
4465
4437
  const manifest = JSON.parse(raw);
@@ -4477,9 +4449,9 @@ function readRunnerManifest(runnerDir) {
4477
4449
  supports_body_kind: supportedBodyKinds,
4478
4450
  };
4479
4451
  }
4480
- const RUNNER_TIMEOUT_MS = 120_000;
4481
- const RUNNER_OUTPUT_MAX_BYTES = 2 * 1024 * 1024;
4482
- const RUNNER_ENV_ALLOWLIST = new Set([
4452
+ export const RUNNER_TIMEOUT_MS = 120_000;
4453
+ export const RUNNER_OUTPUT_MAX_BYTES = 2 * 1024 * 1024;
4454
+ export const RUNNER_ENV_ALLOWLIST = new Set([
4483
4455
  'PATH',
4484
4456
  'SystemRoot',
4485
4457
  'WINDIR',
@@ -4496,7 +4468,7 @@ const RUNNER_ENV_ALLOWLIST = new Set([
4496
4468
  'GEMINI_API_KEY',
4497
4469
  'GOOGLE_API_KEY',
4498
4470
  ]);
4499
- function runnerSubprocessEnv(inputPath, outputPath) {
4471
+ export function runnerSubprocessEnv(inputPath, outputPath, instructionSetDir) {
4500
4472
  const env = {};
4501
4473
  for (const key of RUNNER_ENV_ALLOWLIST) {
4502
4474
  const value = process.env[key];
@@ -4506,6 +4478,9 @@ function runnerSubprocessEnv(inputPath, outputPath) {
4506
4478
  }
4507
4479
  env.ORIZU_RUNNER_INPUT_PATH = inputPath;
4508
4480
  env.ORIZU_RUNNER_OUTPUT_PATH = outputPath;
4481
+ delete env.ORIZU_INSTRUCTION_SET_DIR;
4482
+ if (instructionSetDir)
4483
+ env.ORIZU_INSTRUCTION_SET_DIR = instructionSetDir;
4509
4484
  return env;
4510
4485
  }
4511
4486
  function boundedRunnerOutput(value) {
@@ -4517,7 +4492,7 @@ function boundedRunnerOutput(value) {
4517
4492
  }
4518
4493
  return `${buffer.subarray(0, RUNNER_OUTPUT_MAX_BYTES).toString('utf8')}\n[truncated]`;
4519
4494
  }
4520
- async function materializeRunnerVersion(runnerVersionId) {
4495
+ export async function materializeRunnerVersion(runnerVersionId) {
4521
4496
  const response = await authedFetch(`/api/cli/runner-versions/${encodeURIComponent(runnerVersionId)}/download`);
4522
4497
  if (!response.ok) {
4523
4498
  throw new Error(`Failed to download runner version: ${await response.text()}`);
@@ -4614,15 +4589,15 @@ async function runnersExec() {
4614
4589
  const tempDir = mkdtempSync(join(tmpdir(), 'orizu-runner-'));
4615
4590
  const inputPath = join(tempDir, 'input.json');
4616
4591
  const outputPath = join(tempDir, 'output.json');
4592
+ const instructionSetDir = context.instructionSet ? join(tempDir, 'instruction-set') : undefined;
4617
4593
  try {
4618
4594
  const modelOutput = row.row.model_output ?? row.row.modelOutput ?? row.row.output ?? null;
4595
+ if (instructionSetDir && context.instructionSet)
4596
+ syncToDisk(instructionSetDir, runnerInstructionSetSyncSet(context.instructionSet));
4619
4597
  writeFileSync(inputPath, JSON.stringify({
4620
4598
  row: row.row,
4621
- prompt: {
4622
- body: context.prompt.body,
4623
- body_kind: context.prompt.bodyKind,
4624
- provider_settings: context.prompt.providerSettings,
4625
- },
4599
+ prompt: runnerInputPrompt(context.prompt),
4600
+ ...(context.instructionSet ? { instruction_set: runnerInputInstructionSet(context.instructionSet) } : {}),
4626
4601
  subject: scorerVersion
4627
4602
  ? {
4628
4603
  type: 'scorer_row',
@@ -4649,7 +4624,7 @@ async function runnersExec() {
4649
4624
  }));
4650
4625
  const result = spawnSync(manifest.command[0], manifest.command.slice(1), {
4651
4626
  cwd: runnerDir,
4652
- env: runnerSubprocessEnv(inputPath, outputPath),
4627
+ env: runnerSubprocessEnv(inputPath, outputPath, instructionSetDir),
4653
4628
  encoding: 'utf8',
4654
4629
  maxBuffer: RUNNER_OUTPUT_MAX_BYTES,
4655
4630
  timeout: RUNNER_TIMEOUT_MS,
@@ -4845,8 +4820,11 @@ export async function main(rawArgs = process.argv.slice(2)) {
4845
4820
  return;
4846
4821
  }
4847
4822
  if (command === 'prompts' && subcommand === 'push') {
4848
- await pushPromptArtifact('prompt');
4849
- return;
4823
+ if (getArg('--session')) {
4824
+ await pushPromptArtifact('prompt');
4825
+ return;
4826
+ }
4827
+ refusePromptMutation('push <manifest> --project <team/project>');
4850
4828
  }
4851
4829
  if (command === 'prompts' && subcommand === 'report' &&
4852
4830
  (cliArgs[2] === 'set' || cliArgs[2] === 'upload')) {
@@ -4856,15 +4834,23 @@ export async function main(rawArgs = process.argv.slice(2)) {
4856
4834
  return;
4857
4835
  }
4858
4836
  if (command === 'prompts' && subcommand === 'archive') {
4859
- await setPromptArchivedState(true);
4860
- return;
4837
+ refusePromptMutation('archive <slug-or-exact-name> --project <team/project>');
4861
4838
  }
4862
4839
  if (command === 'prompts' && subcommand === 'restore') {
4863
- await setPromptArchivedState(false);
4864
- return;
4840
+ refusePromptMutation('restore <slug-or-exact-name> --project <team/project>');
4865
4841
  }
4866
4842
  if (command === 'prompts' && subcommand === 'labels' && cliArgs[2] === 'set') {
4867
- await setPromptLabel();
4843
+ if (getPositionalArg(4) === 'production') {
4844
+ refusePromptMutation('profiles promote <set> --project <team/project> --model-config <identity> --version <n>');
4845
+ }
4846
+ await setPromptLabel({
4847
+ getArg,
4848
+ getPositionalArg,
4849
+ json: hasJsonFlag(),
4850
+ printJson,
4851
+ printLine,
4852
+ resolveProjectSlug,
4853
+ });
4868
4854
  return;
4869
4855
  }
4870
4856
  if (command === 'prompts' && subcommand === 'scorers' && cliArgs[2] === 'set-headline') {
@@ -4905,25 +4891,20 @@ export async function main(rawArgs = process.argv.slice(2)) {
4905
4891
  });
4906
4892
  return;
4907
4893
  }
4908
- if (command === 'scorers' && subcommand === 'list') {
4909
- await listScorers();
4910
- return;
4911
- }
4912
- if (command === 'scorers' && subcommand === 'register') {
4913
- await registerScorer();
4914
- return;
4915
- }
4916
- if (command === 'scorers' && subcommand === 'detail') {
4917
- await showScorerDetail();
4918
- return;
4919
- }
4920
- if (command === 'scorers' && subcommand === 'labels' && cliArgs[2] === 'set') {
4921
- await setScorerLabel();
4922
- return;
4923
- }
4924
- if (command === 'scorers' && subcommand === 'exec') {
4925
- await execScorer();
4926
- return;
4894
+ if (command === 'scorers') {
4895
+ const scorersExit = await scorersCommand(cliArgs, {
4896
+ list: listScorers, register: registerScorer, detail: showScorerDetail,
4897
+ labelsSet: setScorerLabel, exec: execScorer,
4898
+ verifyParity: args => verifyScorerParityCommand(args, {
4899
+ json: hasJsonFlag(), print: printLine, printErr: printError,
4900
+ materializeRunnerVersion, readRunnerManifest, runnerSubprocessEnv,
4901
+ timeoutMs: RUNNER_TIMEOUT_MS, maxOutputBytes: RUNNER_OUTPUT_MAX_BYTES,
4902
+ }),
4903
+ });
4904
+ if (scorersExit !== null) {
4905
+ process.exitCode = scorersExit;
4906
+ return;
4907
+ }
4927
4908
  }
4928
4909
  if ((command === 'runners' || command === 'optimizers') && subcommand === 'push') {
4929
4910
  await pushRunnerArtifact(command === 'runners' ? 'runner' : 'optimizer');
@@ -4975,6 +4956,12 @@ export async function main(rawArgs = process.argv.slice(2)) {
4975
4956
  await listOptimizationRunsCommand(cliArgs.slice(2), { json: hasJsonFlag(), print: printLine, resolveProjectSlug });
4976
4957
  return;
4977
4958
  }
4959
+ if (command === 'optimizations' && subcommand === 'promote') {
4960
+ await promoteOptimizationCommand(cliArgs.slice(2), {
4961
+ json: hasJsonFlag(), print: printLine, resolveProjectSlug, fetcher: authedFetch,
4962
+ });
4963
+ return;
4964
+ }
4978
4965
  if (command === 'optimizations' &&
4979
4966
  (subcommand === 'pause' ||
4980
4967
  subcommand === 'resume' ||
@@ -5141,9 +5128,12 @@ export async function main(rawArgs = process.argv.slice(2)) {
5141
5128
  await runGithubLink(team, { print: printLine, fetcher: authedFetch, openUrl: openInBrowser, confirm: (org) => askYesNo(`Connect this team to GitHub org '${org}'?`, true) });
5142
5129
  return;
5143
5130
  }
5144
- if (command === 'connectors' || command === 'manifests') {
5145
- const moduleCommand = command === 'connectors' ? connectorsCommand : manifestsCommand;
5146
- process.exitCode = await moduleCommand(cliArgs.slice(1), { json: hasJsonFlag(), print: printLine, resolveProjectSlug });
5131
+ if (command === 'connectors' || command === 'manifests' || command === 'model-configs') {
5132
+ process.exitCode = await (command === 'connectors' ? connectorsCommand : command === 'manifests' ? manifestsCommand : modelConfigsCommand)(cliArgs.slice(1), { json: hasJsonFlag(), print: printLine, resolveProjectSlug });
5133
+ return;
5134
+ }
5135
+ if (command === 'instructions' || command === 'instruction-sets') {
5136
+ process.exitCode = await instructionSetsCommand(cliArgs.slice(1), { json: hasJsonFlag(), print: printLine, resolveProjectSlug });
5147
5137
  return;
5148
5138
  }
5149
5139
  if (command === 'team' && (subcommand === 'kill-agents' || subcommand === 'release-agents')) {
@@ -0,0 +1,3 @@
1
+ /** Resolve the same production-or-default tuple served for a model identity. */
2
+ export declare function resolveGepaInstructionSetProfileVersion(instructionSetName: string, modelConfigIdentity: string, project: string): Promise<string>;
3
+ //# sourceMappingURL=instruction-set-gepa-launch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instruction-set-gepa-launch.d.ts","sourceRoot":"","sources":["../src/instruction-set-gepa-launch.ts"],"names":[],"mappings":"AAaA,gFAAgF;AAChF,wBAAsB,uCAAuC,CAC3D,kBAAkB,EAAE,MAAM,EAC1B,mBAAmB,EAAE,MAAM,EAC3B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CASjB"}
@@ -0,0 +1,15 @@
1
+ import { authedFetch } from './http.js';
2
+ import { parseJsonResponse } from './json-response.js';
3
+ /** Resolve the same production-or-default tuple served for a model identity. */
4
+ export async function resolveGepaInstructionSetProfileVersion(instructionSetName, modelConfigIdentity, project) {
5
+ const response = await authedFetch(`/api/cli/instruction-sets/${encodeURIComponent(instructionSetName)}?project=${encodeURIComponent(project)}`);
6
+ if (!response.ok)
7
+ throw new Error(`Instruction set resolution failed: ${await response.text()}`);
8
+ const payload = await parseJsonResponse(response, 'Instruction set resolution');
9
+ const instructionSet = payload.instructionSet;
10
+ const profile = instructionSet?.profiles?.find(candidate => candidate.modelConfigIdentity === modelConfigIdentity);
11
+ const profileVersionId = profile?.production?.profileVersionId || instructionSet?.default?.profileVersionId;
12
+ if (!profileVersionId)
13
+ throw new Error('instruction_set_profile_version_unresolvable');
14
+ return profileVersionId;
15
+ }
@@ -0,0 +1,6 @@
1
+ export declare class InstructionSetLoaderError extends Error {
2
+ readonly code: string;
3
+ constructor(code: string);
4
+ }
5
+ export declare function loadInstructionSet(directory: string, name: string, modelConfigIdentity: string): Record<string, string>;
6
+ //# sourceMappingURL=instruction-set-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instruction-set-loader.d.ts","sourceRoot":"","sources":["../src/instruction-set-loader.ts"],"names":[],"mappings":"AAGA,qBAAa,yBAA0B,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAClC;AAOD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAwBvH"}
@@ -0,0 +1,59 @@
1
+ import { existsSync, realpathSync, readFileSync, statSync } from 'node:fs';
2
+ import { resolve, sep } from 'node:path';
3
+ export class InstructionSetLoaderError extends Error {
4
+ code;
5
+ constructor(code) {
6
+ super(code);
7
+ this.code = code;
8
+ this.name = 'InstructionSetLoaderError';
9
+ }
10
+ }
11
+ function inside(root, candidate) { return candidate === root || candidate.startsWith(`${root}${sep}`); }
12
+ export function loadInstructionSet(directory, name, modelConfigIdentity) {
13
+ const unresolvedRoot = resolve(directory, name);
14
+ if (!existsSync(unresolvedRoot) || !statSync(unresolvedRoot).isDirectory())
15
+ throw new InstructionSetLoaderError('instruction_set_not_synced');
16
+ const setRoot = realpathSync(unresolvedRoot);
17
+ const manifestPath = resolve(setRoot, 'manifest.json');
18
+ if (!existsSync(manifestPath))
19
+ throw new InstructionSetLoaderError('instruction_set_manifest_missing');
20
+ let manifest;
21
+ try {
22
+ manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
23
+ }
24
+ catch {
25
+ throw new InstructionSetLoaderError('instruction_set_manifest_missing');
26
+ }
27
+ if (manifest.manifestVersion !== 1)
28
+ throw new InstructionSetLoaderError('instruction_set_manifest_version_unsupported');
29
+ if (manifest.filteredTo && !manifest.filteredTo.includes(modelConfigIdentity))
30
+ throw new InstructionSetLoaderError('instruction_set_profile_not_synced');
31
+ const selected = manifest.profiles.find(profile => profile.modelConfigIdentity === modelConfigIdentity)?.production || manifest.default;
32
+ const result = {};
33
+ for (const key of manifest.shape) {
34
+ if (selected.pinnedComponents?.[key])
35
+ throw new InstructionSetLoaderError('instruction_set_component_unavailable');
36
+ const relativePath = selected.files?.[key];
37
+ if (!relativePath)
38
+ throw new InstructionSetLoaderError('instruction_set_profile_key_missing');
39
+ const unresolvedPath = resolve(setRoot, relativePath);
40
+ if (!inside(setRoot, unresolvedPath))
41
+ throw new InstructionSetLoaderError('instruction_set_path_unsafe');
42
+ let path;
43
+ try {
44
+ path = realpathSync(unresolvedPath);
45
+ }
46
+ catch {
47
+ throw new InstructionSetLoaderError('instruction_set_component_unreadable');
48
+ }
49
+ if (!inside(setRoot, path))
50
+ throw new InstructionSetLoaderError('instruction_set_path_unsafe');
51
+ try {
52
+ result[key] = readFileSync(path, 'utf8');
53
+ }
54
+ catch {
55
+ throw new InstructionSetLoaderError('instruction_set_component_unreadable');
56
+ }
57
+ }
58
+ return result;
59
+ }
@@ -0,0 +1,14 @@
1
+ export interface InstructionSetComponent {
2
+ key: string;
3
+ modelConfig?: string;
4
+ text: string;
5
+ }
6
+ export interface InstructionSetManifest {
7
+ name: string;
8
+ description?: string | null;
9
+ shape: string[];
10
+ components: InstructionSetComponent[];
11
+ }
12
+ export declare const MAX_INSTRUCTION_SET_COMPONENT_BYTES: number;
13
+ export declare function loadInstructionSetManifest(path: string): InstructionSetManifest;
14
+ //# sourceMappingURL=instruction-set-manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instruction-set-manifest.d.ts","sourceRoot":"","sources":["../src/instruction-set-manifest.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,uBAAuB;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AAC5F,MAAM,WAAW,sBAAsB;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,uBAAuB,EAAE,CAAA;CAAE;AAI7I,eAAO,MAAM,mCAAmC,QAAa,CAAA;AAW7D,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB,CAmG/E"}