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
@@ -0,0 +1,340 @@
1
+ import { existsSync, readFileSync } from 'fs'
2
+
3
+ export type GepaEngine = 'official' | 'legacy'
4
+
5
+ export interface GepaEngineDispatch {
6
+ engine: GepaEngine
7
+ args: string[]
8
+ environment: NodeJS.ProcessEnv
9
+ module: string
10
+ }
11
+
12
+ interface EnvironmentOption {
13
+ flag: string
14
+ environment: string
15
+ readFile?: boolean
16
+ json?: boolean
17
+ allowEmpty?: boolean
18
+ }
19
+
20
+ const VALUE_OPTIONS: EnvironmentOption[] = [
21
+ { flag: '--optimizer-version-id', environment: 'ORIZU_OPTIMIZER_VERSION_ID' },
22
+ { flag: '--candidate-version-id', environment: 'ORIZU_PROMPT_VERSION_ID' },
23
+ { flag: '--runner-version-id', environment: 'ORIZU_RUNNER_VERSION_ID' },
24
+ { flag: '--candidate-runner-dir', environment: 'ORIZU_CANDIDATE_RUNNER_DIR' },
25
+ { flag: '--scorer-version-id', environment: 'ORIZU_SCORER_VERSION_ID' },
26
+ { flag: '--scorer-runner-version-id', environment: 'ORIZU_SCORER_RUNNER_VERSION_ID' },
27
+ { flag: '--scorer-runner-dir', environment: 'ORIZU_SCORER_RUNNER_DIR' },
28
+ { flag: '--scorer-input-contract', environment: 'ORIZU_SCORER_INPUT_CONTRACT' },
29
+ { flag: '--scorer-candidate-field', environment: 'ORIZU_SCORER_CANDIDATE_FIELD' },
30
+ { flag: '--dataset-version-id', environment: 'ORIZU_DATASET_VERSION_ID' },
31
+ { flag: '--split-set-id', environment: 'ORIZU_SPLIT_SET_ID' },
32
+ { flag: '--train-split', environment: 'ORIZU_TRAIN_SPLIT', allowEmpty: true },
33
+ { flag: '--val-split', environment: 'ORIZU_VALIDATION_SPLIT', allowEmpty: true },
34
+ { flag: '--budget', environment: 'ORIZU_BUDGET' },
35
+ { flag: '--max-iterations', environment: 'ORIZU_MAX_ITERATIONS' },
36
+ { flag: '--max-candidate-proposals', environment: 'ORIZU_MAX_CANDIDATE_PROPOSALS' },
37
+ { flag: '--proposal-max-calls', environment: 'ORIZU_PROPOSAL_MAX_CALLS' },
38
+ { flag: '--proposal-max-tokens', environment: 'ORIZU_PROPOSAL_MAX_TOKENS' },
39
+ { flag: '--max-full-evals', environment: 'ORIZU_MAX_FULL_EVALS' },
40
+ { flag: '--max-metric-calls', environment: 'ORIZU_MAX_METRIC_CALLS' },
41
+ { flag: '--minibatch-size', environment: 'ORIZU_MINIBATCH_SIZE' },
42
+ { flag: '--num-threads', environment: 'ORIZU_NUM_THREADS' },
43
+ { flag: '--candidate-selection-strategy', environment: 'ORIZU_CANDIDATE_SELECTION_STRATEGY' },
44
+ { flag: '--epsilon', environment: 'ORIZU_EPSILON' },
45
+ { flag: '--reflection-model', environment: 'ORIZU_REFLECTION_MODEL' },
46
+ { flag: '--reflection-temperature', environment: 'ORIZU_REFLECTION_TEMPERATURE' },
47
+ { flag: '--reflection-max-tokens', environment: 'ORIZU_REFLECTION_MAX_TOKENS' },
48
+ { flag: '--reflection-retry-attempts', environment: 'ORIZU_REFLECTION_RETRY_ATTEMPTS' },
49
+ { flag: '--reflection-http-timeout-seconds', environment: 'ORIZU_REFLECTION_HTTP_TIMEOUT_SECONDS' },
50
+ { flag: '--reflection-prompt-template', environment: 'ORIZU_REFLECTION_PROMPT_TEMPLATE', readFile: true },
51
+ { flag: '--reflection-provider-settings', environment: 'ORIZU_REFLECTION_PROVIDER_SETTINGS', readFile: true, json: true },
52
+ { flag: '--objective', environment: 'ORIZU_OBJECTIVE', allowEmpty: true },
53
+ { flag: '--seed', environment: 'ORIZU_SEED' },
54
+ { flag: '--promotion-label', environment: 'ORIZU_PROMOTION_LABEL', allowEmpty: true },
55
+ { flag: '--log-dir', environment: 'ORIZU_LOCAL_LOG_DIR' },
56
+ { flag: '--instruction-set', environment: 'ORIZU_INSTRUCTION_SET_NAME' },
57
+ { flag: '--model-config', environment: 'ORIZU_MODEL_CONFIG_IDENTITY' },
58
+ ]
59
+
60
+ const BOOLEAN_OPTIONS = [
61
+ ['--allow-degenerate-seed', 'ORIZU_ALLOW_DEGENERATE_SEED', '1'],
62
+ ['--disable-evaluation-cache', 'ORIZU_DISABLE_EVALUATION_CACHE', '1'],
63
+ ['--auto-promote', 'ORIZU_AUTO_PROMOTE', '1'],
64
+ ['--log-row-snapshots', 'ORIZU_LOG_ROW_SNAPSHOTS', '1'],
65
+ ['--no-local-log', 'ORIZU_NO_LOCAL_LOG', '1'],
66
+ ['--skip-perfect-parent-reflection', 'ORIZU_SKIP_PERFECT_PARENT_REFLECTION', '1'],
67
+ ['--no-skip-perfect-parent-reflection', 'ORIZU_SKIP_PERFECT_PARENT_REFLECTION', '0'],
68
+ ] as const
69
+
70
+ function textValue(value: string): string {
71
+ if (value.startsWith('@')) return readFileSync(value.slice(1), 'utf8')
72
+ const path = value
73
+ return existsSync(path) ? readFileSync(path, 'utf8') : value
74
+ }
75
+
76
+ function jsonObjectValue(value: string, flag: string): string {
77
+ const raw = textValue(value)
78
+ const parsed: unknown = JSON.parse(raw)
79
+ if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
80
+ throw new Error(`${flag} must be a JSON object`)
81
+ }
82
+ // Validate in JavaScript, but preserve the raw spelling for Python's JSON
83
+ // parser so large numbers and exponent forms do not lose precision here.
84
+ return raw
85
+ }
86
+
87
+ function removeEngine(args: string[]): { engine: GepaEngine; args: string[] } {
88
+ let engine: string | undefined
89
+ const forwarded: string[] = []
90
+ for (let index = 0; index < args.length; index += 1) {
91
+ const argument = args[index]
92
+ if (argument === '--engine') {
93
+ const value = args[index + 1]
94
+ if (!value || value.startsWith('--')) {
95
+ throw new Error('--engine must be one of official, legacy')
96
+ }
97
+ if (engine !== undefined && engine !== value) {
98
+ throw new Error('--engine must select exactly one of official, legacy')
99
+ }
100
+ engine = value
101
+ index += 1
102
+ continue
103
+ }
104
+ if (argument.startsWith('--engine=')) {
105
+ const value = argument.slice('--engine='.length)
106
+ if (engine !== undefined && engine !== value) {
107
+ throw new Error('--engine must select exactly one of official, legacy')
108
+ }
109
+ engine = value
110
+ continue
111
+ }
112
+ forwarded.push(argument)
113
+ }
114
+ if (engine !== undefined && engine !== 'official' && engine !== 'legacy') {
115
+ throw new Error(`--engine must be one of official, legacy; received ${engine}`)
116
+ }
117
+ return { engine: engine ?? 'official', args: forwarded }
118
+ }
119
+
120
+ function validateLegacyMetadata(args: string[]): void {
121
+ let raw: string | undefined
122
+ for (let index = 0; index < args.length; index += 1) {
123
+ if (args[index] === '--metadata') {
124
+ const value = args[index + 1]
125
+ if (!value || value.startsWith('--')) {
126
+ throw new Error('--metadata must be a JSON object')
127
+ }
128
+ raw = value
129
+ index += 1
130
+ continue
131
+ }
132
+ if (args[index].startsWith('--metadata=')) {
133
+ raw = args[index].slice('--metadata='.length)
134
+ }
135
+ }
136
+ let metadata: unknown = {}
137
+ if (raw !== undefined) {
138
+ try {
139
+ // The frozen legacy CLI hands this value directly to json.loads. Do not
140
+ // add @file/path expansion here: only reflection inputs support it.
141
+ metadata = JSON.parse(raw)
142
+ } catch {
143
+ throw new Error('--metadata must be a JSON object containing valid JSON')
144
+ }
145
+ }
146
+ if (typeof metadata !== 'object' || metadata === null || Array.isArray(metadata)) {
147
+ throw new Error('--metadata must be a JSON object')
148
+ }
149
+ // The frozen CLI consumes the original argv with json.loads. Keep the raw
150
+ // spelling so Python, not JavaScript, owns JSON number precision and adds
151
+ // the selected legacy-engine tag to the run metadata.
152
+ }
153
+
154
+ interface BooleanEnvironmentOption {
155
+ environment: string
156
+ value: string
157
+ }
158
+
159
+ // Parsing starts from an arbitrary command-line string. Keep the literal
160
+ // tuples above checked, then widen only the map boundary used for lookup.
161
+ const VALUE_OPTIONS_BY_FLAG: ReadonlyMap<string, EnvironmentOption> = new Map(
162
+ VALUE_OPTIONS.map(option => [option.flag, option])
163
+ )
164
+ const BOOLEAN_OPTIONS_BY_FLAG: ReadonlyMap<string, BooleanEnvironmentOption> = new Map(
165
+ BOOLEAN_OPTIONS.map(([flag, environment, value]) => [flag, { environment, value }])
166
+ )
167
+ const CONTROLLED_ENVIRONMENT_NAMES = new Set([
168
+ 'ORIZU_PROJECT',
169
+ 'ORIZU_METADATA',
170
+ ...VALUE_OPTIONS.map(option => option.environment),
171
+ ...BOOLEAN_OPTIONS.map(([, environment]) => environment),
172
+ 'ORIZU_USE_MERGE',
173
+ 'ORIZU_MAX_MERGE_INVOCATIONS',
174
+ 'ORIZU_SAMPLING_STRATEGY',
175
+ 'ORIZU_SELECTION_STRATEGY',
176
+ 'ORIZU_MAX_PAYLOAD_CHARS',
177
+ 'ORIZU_INSTRUCTION_SET_PROFILE_VERSION_ID',
178
+ // Candidate selection is an explicit opt-in. Clearing it before option
179
+ // translation prevents an inherited environment from selecting a proposer
180
+ // on an otherwise byte-for-byte normal official-GEPA launch.
181
+ 'ORIZU_CANDIDATE_PROPOSER',
182
+ 'ORIZU_COMPONENT_SELECTOR',
183
+ ])
184
+
185
+ function optionValueOrThrow(args: string[], index: number, flag: string, allowEmpty = false): { value: string; nextIndex: number } {
186
+ const argument = args[index]
187
+ const equalsPrefix = `${flag}=`
188
+ if (argument.startsWith(equalsPrefix)) {
189
+ const value = argument.slice(equalsPrefix.length)
190
+ if ((!allowEmpty && value === '') || value.startsWith('--')) {
191
+ throw new Error(`${flag} requires a value that does not start with --`)
192
+ }
193
+ return { value, nextIndex: index }
194
+ }
195
+
196
+ const value = args[index + 1]
197
+ if (value === undefined || value.startsWith('--')) {
198
+ throw new Error(`${flag} requires a value that does not start with --`)
199
+ }
200
+ return { value, nextIndex: index + 1 }
201
+ }
202
+
203
+ function translateOfficialOptions(args: string[], project: string, environment: NodeJS.ProcessEnv): NodeJS.ProcessEnv {
204
+ const connectorEnvironment: NodeJS.ProcessEnv = { ...environment }
205
+ for (const name of CONTROLLED_ENVIRONMENT_NAMES) {
206
+ delete connectorEnvironment[name]
207
+ }
208
+ connectorEnvironment.ORIZU_PROJECT = project
209
+
210
+ let metadata: string | undefined
211
+ let hasInstructionSet = false
212
+ let hasCandidateVersion = false
213
+ const budgetFlags: string[] = []
214
+ for (let index = 0; index < args.length; index += 1) {
215
+ const argument = args[index]
216
+ if (!argument.startsWith('--')) {
217
+ throw new Error(`Unexpected run-gepa argument ${argument}`)
218
+ }
219
+
220
+ const flag = argument.includes('=') ? argument.slice(0, argument.indexOf('=')) : argument
221
+ if (flag === '--candidate-version-id') hasCandidateVersion = true
222
+ if (flag === '--project') {
223
+ const parsed = optionValueOrThrow(args, index, flag)
224
+ connectorEnvironment.ORIZU_PROJECT = parsed.value
225
+ index = parsed.nextIndex
226
+ continue
227
+ }
228
+ if (flag === '--metadata') {
229
+ const parsed = optionValueOrThrow(args, index, flag)
230
+ metadata = parsed.value
231
+ index = parsed.nextIndex
232
+ continue
233
+ }
234
+ if (flag === '--candidate-proposer') {
235
+ const parsed = optionValueOrThrow(args, index, flag)
236
+ if (parsed.value !== 'skilled-proposer') {
237
+ throw new Error('--candidate-proposer must be skilled-proposer')
238
+ }
239
+ connectorEnvironment.ORIZU_CANDIDATE_PROPOSER = parsed.value
240
+ index = parsed.nextIndex
241
+ continue
242
+ }
243
+ const option = VALUE_OPTIONS_BY_FLAG.get(flag)
244
+ if (option) {
245
+ const parsed = optionValueOrThrow(args, index, flag, option.allowEmpty)
246
+ if (flag === '--budget') {
247
+ if (!['auto', 'light', 'medium', 'heavy'].includes(parsed.value)) {
248
+ throw new Error('--budget must be one of auto, light, medium, heavy')
249
+ }
250
+ budgetFlags.push(flag)
251
+ }
252
+ if (['--max-metric-calls', '--max-full-evals', '--max-iterations', '--max-candidate-proposals'].includes(flag)) {
253
+ budgetFlags.push(flag)
254
+ }
255
+ if (flag === '--candidate-selection-strategy' && !['pareto', 'current_best', 'epsilon_greedy'].includes(parsed.value)) {
256
+ throw new Error('--candidate-selection-strategy must be one of pareto, current_best, epsilon_greedy')
257
+ }
258
+ if (flag === '--scorer-input-contract' && !['gepa', 'flat_row'].includes(parsed.value)) {
259
+ throw new Error('--scorer-input-contract must be one of gepa, flat_row')
260
+ }
261
+ connectorEnvironment[option.environment] = option.json
262
+ ? jsonObjectValue(parsed.value, option.flag)
263
+ : option.readFile ? textValue(parsed.value) : parsed.value
264
+ if (flag === '--instruction-set') hasInstructionSet = true
265
+ index = parsed.nextIndex
266
+ continue
267
+ }
268
+ if (flag === '--component-selector') {
269
+ const parsed = optionValueOrThrow(args, index, flag)
270
+ if (!['round-robin', 'all'].includes(parsed.value)) throw new Error('--component-selector must be one of round-robin, all')
271
+ connectorEnvironment.ORIZU_COMPONENT_SELECTOR = parsed.value.replace('-', '_')
272
+ index = parsed.nextIndex
273
+ continue
274
+ }
275
+ const boolean = BOOLEAN_OPTIONS_BY_FLAG.get(flag)
276
+ if (boolean) {
277
+ if (argument.includes('=')) {
278
+ throw new Error(`${flag} does not accept a value`)
279
+ }
280
+ if (args[index + 1] !== undefined && !args[index + 1].startsWith('--')) {
281
+ throw new Error(`${flag} does not accept a value`)
282
+ }
283
+ connectorEnvironment[boolean.environment] = boolean.value
284
+ continue
285
+ }
286
+ throw new Error(`Unknown run-gepa option ${flag}`)
287
+ }
288
+
289
+ if (budgetFlags.length > 1) {
290
+ throw new Error('Budget options are mutually exclusive; choose at most one of --budget, --max-metric-calls, --max-full-evals, --max-iterations, --max-candidate-proposals')
291
+ }
292
+ if (hasInstructionSet && hasCandidateVersion) throw new Error('--instruction-set and --candidate-version-id are mutually exclusive')
293
+ if (hasInstructionSet && connectorEnvironment.ORIZU_MODEL_CONFIG_IDENTITY === undefined) throw new Error('--instruction-set requires --model-config')
294
+ if (hasInstructionSet && connectorEnvironment.ORIZU_COMPONENT_SELECTOR === undefined) connectorEnvironment.ORIZU_COMPONENT_SELECTOR = 'round_robin'
295
+ if ((connectorEnvironment.ORIZU_PROPOSAL_MAX_CALLS !== undefined
296
+ || connectorEnvironment.ORIZU_PROPOSAL_MAX_TOKENS !== undefined)
297
+ && connectorEnvironment.ORIZU_CANDIDATE_PROPOSER !== 'skilled-proposer') {
298
+ throw new Error('--proposal-max-calls and --proposal-max-tokens require --candidate-proposer skilled-proposer')
299
+ }
300
+
301
+ const reflectionModel = connectorEnvironment.ORIZU_REFLECTION_MODEL ?? 'anthropic/claude-opus-4-7'
302
+ if (!reflectionModel.startsWith('openai/') && connectorEnvironment.ORIZU_REFLECTION_MAX_TOKENS === undefined) {
303
+ throw new Error('--reflection-max-tokens is required for Anthropic reflection models')
304
+ }
305
+
306
+ connectorEnvironment.ORIZU_METADATA = validatedMetadata(metadata)
307
+ return connectorEnvironment
308
+ }
309
+
310
+ function validatedMetadata(raw: string | undefined): string {
311
+ if (raw === undefined) return '{}'
312
+ try {
313
+ const value: unknown = JSON.parse(raw)
314
+ if (typeof value !== 'object' || value === null || Array.isArray(value)) throw new Error()
315
+ } catch {
316
+ throw new Error('--metadata must be a JSON object containing valid JSON')
317
+ }
318
+ return raw
319
+ }
320
+
321
+ export function dispatchGepaEngine(args: string[], project: string, environment: NodeJS.ProcessEnv): GepaEngineDispatch {
322
+ const selected = removeEngine(args)
323
+ if (selected.engine === 'legacy') {
324
+ for (const flag of ['--instruction-set', '--model-config', '--component-selector', '--max-candidate-proposals', '--candidate-proposer', '--proposal-max-calls', '--proposal-max-tokens']) {
325
+ if (selected.args.some(argument => argument === flag || argument.startsWith(`${flag}=`))) {
326
+ throw new Error(`${flag} is supported by the official GEPA engine only`)
327
+ }
328
+ }
329
+ validateLegacyMetadata(selected.args)
330
+ return {
331
+ engine: 'legacy',
332
+ args: selected.args,
333
+ environment,
334
+ module: 'orizu_gepa.cli',
335
+ }
336
+ }
337
+
338
+ const connectorEnvironment = translateOfficialOptions(selected.args, project, environment)
339
+ return { engine: 'official', args: [], environment: connectorEnvironment, module: 'orizu_gepa_connector' }
340
+ }
@@ -0,0 +1,31 @@
1
+ export interface GepaPythonCommand {
2
+ python: string
3
+ args: string[]
4
+ }
5
+
6
+ export function getGepaPythonCommand(args: string[], environment: NodeJS.ProcessEnv): GepaPythonCommand {
7
+ let python = environment.PYTHON || 'python3'
8
+ const forwarded: string[] = []
9
+ for (let index = 0; index < args.length; index += 1) {
10
+ const argument = args[index]
11
+ if (argument === '--python') {
12
+ const value = args[index + 1]
13
+ if (!value || value.startsWith('--')) {
14
+ throw new Error('--python requires a value that does not start with --')
15
+ }
16
+ python = value
17
+ index += 1
18
+ continue
19
+ }
20
+ if (argument.startsWith('--python=')) {
21
+ const value = argument.slice('--python='.length)
22
+ if (!value || value.startsWith('--')) {
23
+ throw new Error('--python requires a value that does not start with --')
24
+ }
25
+ python = value
26
+ continue
27
+ }
28
+ forwarded.push(argument)
29
+ }
30
+ return { python, args: forwarded }
31
+ }
@@ -0,0 +1,56 @@
1
+ import { existsSync } from 'fs'
2
+ import { fileURLToPath } from 'url'
3
+
4
+ import { isOrizuSourceCheckout } from '../scripts/orizu-source-checkout.mjs'
5
+
6
+ function prefersLiveSource(): boolean {
7
+ // The source candidates belong to this monorepo only when the candidate
8
+ // root identifies itself as Orizu. A consumer's .git marker is not proof:
9
+ // npm installs commonly live inside another repository.
10
+ return isOrizuSourceCheckout(fileURLToPath(new URL('../../../package.json', import.meta.url)))
11
+ }
12
+
13
+ export function resolveGepaPythonPath(
14
+ candidates: string[],
15
+ pathExists: (candidate: string) => boolean = existsSync
16
+ ): string | null {
17
+ return candidates.find(pathExists) ?? null
18
+ }
19
+
20
+ export function bundledOrizuGepaPythonPath(): string | null {
21
+ const source = fileURLToPath(new URL('../../orizu-gepa-python/src', import.meta.url))
22
+ const vendor = fileURLToPath(new URL('../vendor/orizu-gepa-python/src', import.meta.url))
23
+ const candidates = prefersLiveSource() ? [source, vendor] : [vendor]
24
+
25
+ return resolveGepaPythonPath(candidates)
26
+ }
27
+
28
+ export function bundledOrizuGepaConnectorPythonPath(): string | null {
29
+ const source = fileURLToPath(new URL('../../orizu-gepa/src', import.meta.url))
30
+ const vendor = fileURLToPath(new URL('../vendor/orizu-gepa/src', import.meta.url))
31
+ const candidates = prefersLiveSource() ? [source, vendor] : [vendor]
32
+
33
+ return resolveGepaPythonPath(candidates)
34
+ }
35
+
36
+ export function bundledOfficialGepaPythonPath(): string | null {
37
+ const sourceArchive = fileURLToPath(new URL('../gepa-python-source.zip', import.meta.url))
38
+ const vendor = fileURLToPath(new URL('../vendor/gepa-python/src', import.meta.url))
39
+ // The checked-in pinned wheel is directly importable from PYTHONPATH in a
40
+ // source checkout. Published packages intentionally omit that archive and
41
+ // must resolve only the verified tree materialized by prepack.
42
+ const candidates = prefersLiveSource() ? [sourceArchive, vendor] : [vendor]
43
+
44
+ return resolveGepaPythonPath(candidates)
45
+ }
46
+
47
+ export function getGepaPythonPathEntries(existingPythonPath: string | undefined): string[] {
48
+ const pythonPathEntries = [
49
+ bundledOrizuGepaConnectorPythonPath(),
50
+ bundledOrizuGepaPythonPath(),
51
+ bundledOfficialGepaPythonPath(),
52
+ existingPythonPath,
53
+ ].filter((entry): entry is string => Boolean(entry))
54
+
55
+ return pythonPathEntries
56
+ }
package/src/help.ts CHANGED
@@ -35,6 +35,7 @@ const GROUPS: CliGroupDoc[] = [
35
35
  { name: 'Teams', summary: 'Manage teams and team memberships.' },
36
36
  { name: 'Projects', summary: 'Manage projects inside teams.' },
37
37
  { name: 'Prompts and judges', summary: 'Work with versioned prompt and judge artifacts.' },
38
+ { name: 'Instruction sets', summary: 'Inspect the project-scoped instruction-set control plane.' },
38
39
  { name: 'Report comments', summary: 'Review and mutate anchored report comments across prompt, optimization, and task reports.' },
39
40
  { name: 'Diff comments', summary: 'Export inline comments with recoverable prompt-diff context.' },
40
41
  { name: 'Scorers and runners', summary: 'Register scorers, push runnable artifacts, execute runners, and submit scores.' },
@@ -50,6 +51,44 @@ const GROUPS: CliGroupDoc[] = [
50
51
  ]
51
52
 
52
53
  export const COMMAND_DOCS: CliCommandDoc[] = [
54
+ { path: ['instructions', 'create'], aliases: [['instruction-sets', 'create']], usage: 'orizu instructions create <manifest> --project <team/project> [--runner-version <id>] [--model-config <identity>] [--json]', summary: 'Create an instruction set from a local manifest.', group: 'Instruction sets', options: [{ name: '--runner-version <id>', help: 'Pin the runner version for component prompt versions.' }, { name: '--model-config <identity>', help: 'Select the default model configuration.' }, { name: '--json', help: 'Print one JSON document.' }], examples: ['orizu instructions create ./orizu.instruction-set.json --project core/evals --model-config anthropic/claude-haiku'] },
55
+ { path: ['instructions', 'push'], aliases: [['instruction-sets', 'push']], usage: 'orizu instructions push <manifest> --project <team/project> [--set <slug-or-exact-name>] [--runner-version <id>] [--json]', summary: 'Push a new instruction-set profile version.', group: 'Instruction sets', options: [{ name: '--set <slug-or-exact-name>', help: 'Target the stable set handle when it differs from the manifest name.' }, { name: '--runner-version <id>', help: 'Pin the runner version for changed component prompt versions.' }, { name: '--json', help: 'Print one JSON document.' }], examples: ['orizu instructions push ./orizu.instruction-set.json --project core/evals --set planner'] },
56
+ {
57
+ path: ['instructions', 'list'],
58
+ aliases: [['instruction-sets', 'list']],
59
+ usage: 'orizu instructions list [--project <team/project>] [--status active|archived|all] [--json]',
60
+ summary: 'List instruction sets in a project.',
61
+ group: 'Instruction sets',
62
+ options: [{ name: '--project <team/project>', help: 'Project slug (defaults to configured context).' }, { name: '--status <active|archived|all>', help: 'Filter archived instruction sets.' }, { name: '--json', help: 'Print JSON.' }],
63
+ examples: ['orizu instructions list --project core/evals', 'orizu instructions list --status archived --json'],
64
+ },
65
+ {
66
+ path: ['instructions', 'show'],
67
+ aliases: [['instruction-sets', 'show']],
68
+ usage: 'orizu instructions show <set> [--project <team/project>] [--status active|archived|all] [--json]',
69
+ summary: 'Show an instruction set shape, default, and profile production state.',
70
+ group: 'Instruction sets',
71
+ options: [{ name: '--project <team/project>', help: 'Project slug (defaults to configured context).' }, { name: '--status <active|archived|all>', help: 'Filter archived instruction sets.' }, { name: '--json', help: 'Print JSON.' }],
72
+ examples: ['orizu instructions show research --project core/evals', 'orizu instructions show research --json'],
73
+ },
74
+ { path: ['instructions', 'profiles', 'new'], aliases: [['instruction-sets', 'profiles', 'new']], usage: 'orizu instructions profiles new <set> --project <team/project> --model-config <identity> [--json]', summary: 'Create a model-config profile seeded from the instruction-set default.', group: 'Instruction sets', options: [{ name: '--model-config <identity>', help: 'Model config identity for the new profile.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions profiles new planner --project core/evals --model-config anthropic/claude-haiku'] },
75
+ { path: ['instructions', 'profiles', 'promote'], aliases: [['instruction-sets', 'profiles', 'promote']], usage: 'orizu instructions profiles promote <set> --project <team/project> --model-config <identity> --version <n> [--json]', summary: 'Move one profile version to production.', group: 'Instruction sets', options: [{ name: '--model-config <identity>', help: 'Profile model config.', required: true }, { name: '--version <n>', help: 'Profile version to promote.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions profiles promote planner --project core/evals --model-config anthropic/claude-haiku --version 2'] },
76
+ { path: ['instructions', 'profiles', 'rollback'], aliases: [['instruction-sets', 'profiles', 'rollback']], usage: 'orizu instructions profiles rollback <set> --project <team/project> --model-config <identity> --to <n> [--json]', summary: 'Create a rollback version and move profile production to it.', group: 'Instruction sets', options: [{ name: '--model-config <identity>', help: 'Profile model config.', required: true }, { name: '--to <n>', help: 'Historical profile version to copy.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions profiles rollback planner --project core/evals --model-config anthropic/claude-haiku --to 1'] },
77
+ { path: ['instructions', 'default', 'show'], aliases: [['instruction-sets', 'default', 'show']], usage: 'orizu instructions default show <set> --project <team/project> [--json]', summary: 'Show the instruction-set default and its resolution impact.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions default show planner --project core/evals'] },
78
+ { path: ['instructions', 'default', 'move'], aliases: [['instruction-sets', 'default', 'move']], usage: 'orizu instructions default move <set> --project <team/project> --model-config <identity> --version <n> [--json]', summary: 'Move the instruction-set default to a profile version.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--model-config <identity>', help: 'Target model config.', required: true }, { name: '--version <n>', help: 'Target profile version.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions default move planner --project core/evals --model-config anthropic/claude-haiku --version 2'] },
79
+ { path: ['instructions', 'shape', 'add'], aliases: [['instruction-sets', 'shape', 'add']], usage: 'orizu instructions shape add <set> --project <team/project> --key <key> --from <manifest> [--json]', summary: 'Add one component key to every instruction-set profile.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--key <key>', help: 'Component key to add.', required: true }, { name: '--from <manifest>', help: 'Manifest containing the component body.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions shape add planner --project core/evals --key skill --from planner.json'] },
80
+ { path: ['instructions', 'shape', 'remove'], aliases: [['instruction-sets', 'shape', 'remove']], usage: 'orizu instructions shape remove <set> --project <team/project> --key <key> [--json]', summary: 'Remove one component key from every instruction-set profile.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--key <key>', help: 'Component key to remove.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions shape remove planner --project core/evals --key skill'] },
81
+ {
82
+ path: ['instructions', 'sync'],
83
+ aliases: [['instruction-sets', 'sync']],
84
+ usage: 'orizu instructions sync <set> --out <dir> [--model-config <identity>] [--project <team/project>] [--json]',
85
+ summary: 'Write an instruction set for offline runner loading.',
86
+ group: 'Instruction sets',
87
+ options: [{ name: '--out <dir>', help: 'Destination parent directory.', required: true }, { name: '--model-config <identity>', help: 'Sync only one profile plus default.' }, { name: '--project <team/project>', help: 'Project slug.' }, { name: '--json', help: 'Print source transport JSON.' }],
88
+ examples: ['orizu instructions sync planner --out ./instructions --project core/evals'],
89
+ },
90
+ { path: ['instructions', 'archive'], aliases: [['instruction-sets', 'archive']], usage: 'orizu instructions archive <slug-or-exact-name> --project <team/project> [--json]', summary: 'Archive an instruction set without changing resolution or sync.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions archive planner --project core/evals'] },
91
+ { path: ['instructions', 'restore'], aliases: [['instruction-sets', 'restore']], usage: 'orizu instructions restore <slug-or-exact-name> --project <team/project> [--json]', summary: 'Restore an archived instruction set.', group: 'Instruction sets', options: [{ name: '--project <team/project>', help: 'Project slug.', required: true }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu instructions restore planner --project core/evals'] },
53
92
  {
54
93
  path: ['login'],
55
94
  usage: 'orizu login [--no-prompt-if-logged-in]',
@@ -342,39 +381,21 @@ export const COMMAND_DOCS: CliCommandDoc[] = [
342
381
  summary: 'List prompt artifacts in a project.',
343
382
  group: 'Prompts and judges',
344
383
  },
345
- {
346
- path: ['prompts', 'archive'],
347
- usage: 'orizu prompts archive <prompt-id-or-name> --project <team/project> [--json]',
348
- summary: 'Mark a prompt artifact as archived.',
349
- group: 'Prompts and judges',
350
- },
351
- {
352
- path: ['prompts', 'restore'],
353
- usage: 'orizu prompts restore <prompt-id-or-name> --project <team/project> [--json]',
354
- summary: 'Restore an archived prompt artifact to active status.',
355
- group: 'Prompts and judges',
356
- },
357
384
  {
358
385
  path: ['prompts', 'pull'],
359
386
  usage: 'orizu prompts pull <prompt-id-or-name> --project <team/project> --out <dir> [--label <label> | --version <id>] [--json]',
360
387
  summary: 'Pull a prompt artifact version to a local directory.',
361
388
  group: 'Prompts and judges',
362
389
  },
363
- {
364
- path: ['prompts', 'push'],
365
- usage: 'orizu prompts push <dir> [--runner-version <id>] [--project <team/project>] [--parent <version-id>] [--session <session-id>] [--report-file <path>] [--json]',
366
- summary: 'Push a local prompt artifact directory as a new version (with --session: a commit-first git draft).',
367
- group: 'Prompts and judges',
368
- },
369
390
  {
370
391
  path: ['prompts', 'report', 'set'],
371
- usage: 'orizu prompts report set --prompt <id-or-name> --project <team/project> (--version <n> | --version-id <id>) (--report <markdown|@file> | --report-file <path>) [--json]',
392
+ usage: 'orizu prompts report set --prompt <id-or-name> [--project <team/project>] (--version <n> | --version-id <id>) (--report <markdown|@file> | --report-file <path>) [--json]',
372
393
  summary: 'Upload or replace the Markdown report for one explicit prompt version.',
373
394
  group: 'Prompts and judges',
374
395
  aliases: [['prompts', 'report', 'upload']],
375
396
  options: [
376
397
  { name: '--prompt <id-or-name>', help: 'Prompt ID or name.', required: true },
377
- { name: '--project <team/project>', help: 'Project slug containing the prompt.', required: true },
398
+ { name: '--project <team/project>', help: 'Project slug containing the prompt.' },
378
399
  { name: '--version <n>', help: 'Positive prompt version number.' },
379
400
  { name: '--version-id <id>', help: 'Explicit prompt version ID.' },
380
401
  { name: '--report <markdown|@file>', help: 'Inline Markdown or an @file reference.' },
@@ -389,7 +410,7 @@ export const COMMAND_DOCS: CliCommandDoc[] = [
389
410
  {
390
411
  path: ['prompts', 'labels', 'set'],
391
412
  usage: 'orizu prompts labels set <prompt-name> <label> --version <version-id> [--project <team/project>] [--json]',
392
- summary: 'Move or set a prompt label to a version.',
413
+ summary: 'Move or set a non-production prompt label; use instructions profiles promote for production.',
393
414
  group: 'Prompts and judges',
394
415
  },
395
416
  {
@@ -464,6 +485,12 @@ export const COMMAND_DOCS: CliCommandDoc[] = [
464
485
  summary: 'Execute a scorer locally for a prompt version or optimization candidate.',
465
486
  group: 'Scorers and runners',
466
487
  },
488
+ {
489
+ path: ['scorers', 'verify-parity'],
490
+ usage: 'orizu scorers verify-parity --scorer-version <id> --dataset-version <id> --split-set <id> [--split <name>] --outputs <outputs.jsonl> --original <module:function> [--scorer-input-contract gepa|flat_row] [--scorer-candidate-field <row-field>] [--runner-dir <dir>] [--python <cmd>] [--tolerance <float>] [--limit <n>] [--json]',
491
+ summary: 'Prove a migrated scorer runner scores rows the same as the original Python metric.',
492
+ group: 'Scorers and runners',
493
+ },
467
494
  {
468
495
  path: ['scores', 'submit'],
469
496
  usage: 'orizu scores submit <results.jsonl|results.json> --scorer-version <id> (--subject-version <prompt-version-id> | --optimization-run <id> --candidate <id>) [--aggregate] [--dataset-version <id> --split-set <id> --split <name>] [--project <team/project>] [--json]',
@@ -536,6 +563,7 @@ export const COMMAND_DOCS: CliCommandDoc[] = [
536
563
  summary: 'List optimization runs with explicit archive visibility.',
537
564
  group: 'Optimizations',
538
565
  },
566
+ { path: ['optimizations', 'promote'], usage: 'orizu optimizations promote <run-id> --candidate <id> [--label production] [--project <team/project>] [--json]', summary: 'Promote a selected optimization candidate.', group: 'Optimizations', options: [{ name: '--candidate <id>', help: 'Candidate to promote.', required: true }, { name: '--label production', help: 'Move the new tuple profile version to production.' }, { name: '--project <team/project>', help: 'Project slug (defaults to configured context).' }, { name: '--json', help: 'Print JSON.' }], examples: ['orizu optimizations promote <run-id> --candidate candidate-2 --label production'] },
539
567
  {
540
568
  path: ['optimizations', 'archive'],
541
569
  usage: 'orizu optimizations archive <run-id> [--project <team/project>] [--json]',
@@ -550,8 +578,8 @@ export const COMMAND_DOCS: CliCommandDoc[] = [
550
578
  },
551
579
  {
552
580
  path: ['optimizations', 'run-gepa'],
553
- usage: 'orizu optimizations run-gepa --project <team/project> --optimizer-version-id <id> --candidate-version-id <id> --runner-version-id <id> --candidate-runner-dir <dir> --scorer-version-id <id> --scorer-runner-version-id <id> --scorer-runner-dir <dir> [--scorer-input-contract gepa|flat_row] [--scorer-candidate-field <row-field>] [--allow-degenerate-seed] --dataset-version-id <id> --split-set-id <id> [--train-split train] [--val-split validation] [--budget auto|light|medium|heavy | --max-metric-calls <n> | --max-full-evals <n> | --max-iterations <n>] [--num-threads auto|N] [--reflection-retry-attempts N] [--reflection-http-timeout-seconds N] [--log-dir logs]',
554
- summary: 'Run the bundled GEPA-style optimizer locally and stream events. Validates the scorer contract on the seed before iterating; judge runners built for flat-row score runs need --scorer-input-contract flat_row (ALI-1158).',
581
+ usage: 'orizu optimizations run-gepa --project <team/project> --optimizer-version-id <id> (--candidate-version-id <id> | --instruction-set <name> --model-config <identity> [--component-selector round-robin|all]) --runner-version-id <id> --candidate-runner-dir <dir> --scorer-version-id <id> --scorer-runner-version-id <id> --scorer-runner-dir <dir> [--engine official|legacy] [--scorer-input-contract gepa|flat_row] [--scorer-candidate-field <row-field>] [--allow-degenerate-seed] --dataset-version-id <id> --split-set-id <id> [--train-split train] [--val-split validation] [--budget auto|light|medium|heavy | --max-metric-calls <n> | --max-full-evals <n> | --max-iterations <n> | --max-candidate-proposals <n>] [--num-threads auto|N] [--reflection-retry-attempts N] [--reflection-http-timeout-seconds N] [--log-dir logs]',
582
+ summary: 'Run official GEPA locally and stream events; pass --engine legacy only for the frozen safety hatch. --instruction-set requires --model-config and cannot be combined with --candidate-version-id; round-robin updates one component-map entry per round and all updates every component. --max-candidate-proposals is official-engine-only. Validates the scorer contract on the seed before iterating; judge runners built for flat-row score runs need --scorer-input-contract flat_row (ALI-1158).',
555
583
  group: 'Optimizations',
556
584
  },
557
585
  {
@@ -1057,6 +1085,46 @@ export const COMMAND_DOCS: CliCommandDoc[] = [
1057
1085
  ],
1058
1086
  examples: ['orizu connectors', 'orizu connectors status --project highlight/hip --json'],
1059
1087
  },
1088
+ {
1089
+ path: ['model-configs', 'create'],
1090
+ usage: 'orizu model-configs create <provider/model> [--settings <json|@file>] [--name <name>] [--project <team/project>] [--json]',
1091
+ summary: 'Create a provider-qualified model config with its first settings version.',
1092
+ group: 'Model configs',
1093
+ options: [{ name: '--settings <json|@file>', help: 'Optional JSON settings object or a JSON file; defaults to {}.' }, { name: '--name <name>', help: 'Optional display name.' }, { name: '--project <team/project>', help: 'Project that owns the config.' }, { name: '--json', help: 'Emit the machine-readable model config.' }],
1094
+ examples: ['orizu model-configs create azure/gpt-5.4-mini --settings @settings.json'],
1095
+ },
1096
+ {
1097
+ path: ['model-configs', 'list'],
1098
+ usage: 'orizu model-configs list [--project <team/project>] [--json]',
1099
+ summary: 'List model configs for a project.',
1100
+ group: 'Model configs',
1101
+ options: [{ name: '--project <team/project>', help: 'Project whose configs to list.' }, { name: '--json', help: 'Emit machine-readable model configs.' }],
1102
+ examples: ['orizu model-configs list --project core/evals --json'],
1103
+ },
1104
+ {
1105
+ path: ['model-configs', 'show'],
1106
+ usage: 'orizu model-configs show <provider/model> [--project <team/project>] [--json]',
1107
+ summary: 'Show a model config and its current settings version.',
1108
+ group: 'Model configs',
1109
+ options: [{ name: '--project <team/project>', help: 'Project that owns the config.' }, { name: '--json', help: 'Emit the machine-readable model config.' }],
1110
+ examples: ['orizu model-configs show openai/gpt-5.4-mini'],
1111
+ },
1112
+ {
1113
+ path: ['model-configs', 'settings', 'set'],
1114
+ usage: 'orizu model-configs settings set <provider/model> --settings <json|@file> [--project <team/project>] [--json]',
1115
+ summary: 'Add a settings version and advance the config current pointer.',
1116
+ group: 'Model configs',
1117
+ options: [{ name: '--settings <json|@file>', help: 'JSON settings object or a JSON file.', required: true }, { name: '--project <team/project>', help: 'Project that owns the config.' }, { name: '--json', help: 'Emit the machine-readable model config.' }],
1118
+ examples: ["orizu model-configs settings set openai/gpt-5.4-mini --settings '{\"temperature\":0.2}'"],
1119
+ },
1120
+ {
1121
+ path: ['model-configs', 'copy'],
1122
+ usage: 'orizu model-configs copy <provider/model> --to <provider/model> [--project <team/project>] [--json]',
1123
+ summary: 'Copy the current settings snapshot to a new provider-qualified config.',
1124
+ group: 'Model configs',
1125
+ options: [{ name: '--to <provider/model>', help: 'New provider-qualified config identity.', required: true }, { name: '--project <team/project>', help: 'Project that owns the config.' }, { name: '--json', help: 'Emit the machine-readable model config.' }],
1126
+ examples: ['orizu model-configs copy openai/gpt-5.4-mini --to azure/gpt-5.4-mini'],
1127
+ },
1060
1128
  {
1061
1129
  path: ['manifests', 'list'],
1062
1130
  usage: 'orizu manifests list [--project <team/project>] [--status <status>] [--json]',
@@ -1133,8 +1201,10 @@ export function commandDocsWithPrefix(args: string[]): CliCommandDoc[] {
1133
1201
  }
1134
1202
 
1135
1203
  return COMMAND_DOCS.filter(doc =>
1136
- args.every((part, index) => doc.path[index] === part) &&
1137
- doc.path.length > args.length
1204
+ [doc.path, ...(doc.aliases || [])].some(path =>
1205
+ args.every((part, index) => path[index] === part) &&
1206
+ path.length > args.length
1207
+ )
1138
1208
  )
1139
1209
  }
1140
1210