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,206 @@
1
+ # Copyright (c) 2025 Lakshya A Agrawal and the GEPA contributors
2
+ # https://github.com/gepa-ai/gepa
3
+
4
+ """Scoring strategies that blend correctness with logprob confidence.
5
+
6
+ Why logprobs?
7
+ ~~~~~~~~~~~~~
8
+ When an LLM generates a structured JSON output constrained by an ``enum``,
9
+ the model must choose one of the allowed values. The token-level
10
+ log-probabilities for those value tokens reveal **how certain** the model
11
+ actually is about that choice -- even when the output always *looks*
12
+ deterministic (temperature = 0, forced choice).
13
+
14
+ The sum of the per-token logprobs for a value (``joint_logprob``) is the
15
+ natural measure of confidence for the chosen classification:
16
+
17
+ * **joint_logprob = 0** means the model considered every token virtually
18
+ certain (probability ≈ 1). In practice values cluster between roughly
19
+ **-0.1** (very confident) and **-5.0** (very uncertain); values below
20
+ **-10** indicate near-random guessing.
21
+ * Because logprobs are *negative*, **closer to 0 = more confident**.
22
+
23
+ Using logprobs in GEPA
24
+ ~~~~~~~~~~~~~~~~~~~~~~~
25
+ The :class:`ConfidenceAdapter` extracts ``joint_logprob`` from the
26
+ ``llm-structured-confidence`` library and passes it to a pluggable
27
+ :class:`ScoringStrategy`. Each strategy maps
28
+ ``(is_correct, logprob_score)`` to a single float in ``[0, 1]`` consumed
29
+ by the GEPA engine (higher is better).
30
+
31
+ Three built-in strategies are provided:
32
+
33
+ * :class:`LinearBlendScoring` -- proportional penalty for low-confidence
34
+ correct answers. **Recommended default** for most classification tasks.
35
+ * :class:`ThresholdScoring` -- binary gate: ``1.0`` only if correct *and*
36
+ logprob exceeds a cutoff.
37
+ * :class:`SigmoidScoring` -- smooth S-curve that maps logprobs to
38
+ ``[0, 1]`` when correct.
39
+
40
+ All strategies degrade gracefully when logprobs are unavailable
41
+ (``logprob_score=None``): correct answers receive ``1.0``, incorrect
42
+ answers receive ``0.0`` -- identical to plain accuracy scoring.
43
+ """
44
+
45
+ from __future__ import annotations
46
+
47
+ import math
48
+ from typing import Protocol, runtime_checkable
49
+
50
+
51
+ @runtime_checkable
52
+ class ScoringStrategy(Protocol):
53
+ """Protocol for combining correctness and logprob confidence into a score.
54
+
55
+ Every implementation must return a value in ``[0, 1]`` following GEPA's
56
+ convention: **higher is better**.
57
+
58
+ The ``logprob_score`` parameter is the **joint logprob** (sum of
59
+ per-token logprobs) for the target field, as returned by
60
+ ``llm-structured-confidence``. It is always **<= 0** (closer to 0 =
61
+ more confident).
62
+ """
63
+
64
+ def score(self, is_correct: bool, logprob_score: float | None) -> float:
65
+ """Return a blended score in ``[0, 1]``.
66
+
67
+ Parameters
68
+ ----------
69
+ is_correct:
70
+ Whether the model's answer matches the expected answer.
71
+ logprob_score:
72
+ Joint logprob (sum of per-token logprobs) for the target field.
73
+ Always ``<= 0``. ``None`` when logprobs are unavailable.
74
+ """
75
+ ...
76
+
77
+ def describe(self) -> str:
78
+ """Human-readable description for logs and reflective feedback.
79
+
80
+ .. note:: Not currently called by the adapter, but available for
81
+ custom logging or user-facing diagnostics.
82
+ """
83
+ ...
84
+
85
+
86
+ class LinearBlendScoring:
87
+ """Proportional scoring that penalises low-confidence correct answers.
88
+
89
+ The joint logprob is converted to a probability via ``exp(logprob)``
90
+ and then compared against a threshold:
91
+
92
+ * **Correct + confident** (probability >= *low_confidence_threshold*)
93
+ -> ``1.0``
94
+ * **Correct + uncertain** (probability < threshold) -> linearly
95
+ interpolated between *min_score_on_correct* and ``1.0``
96
+ * **Incorrect** -> ``0.0``
97
+
98
+ When *logprob_score* is ``None`` (logprobs unavailable), correct answers
99
+ receive ``1.0`` so behaviour degrades gracefully to binary scoring.
100
+
101
+ Parameters
102
+ ----------
103
+ low_confidence_threshold:
104
+ Probability threshold (in ``(0, 1]``) above which a correct answer
105
+ receives a full score of ``1.0``. Default ``0.5``.
106
+ min_score_on_correct:
107
+ Minimum score assigned to a correct answer whose probability falls
108
+ below the threshold. Default ``0.3``.
109
+ """
110
+
111
+ def __init__(
112
+ self,
113
+ low_confidence_threshold: float = 0.5,
114
+ min_score_on_correct: float = 0.3,
115
+ ) -> None:
116
+ if not 0.0 < low_confidence_threshold <= 1.0:
117
+ raise ValueError("low_confidence_threshold must be in (0, 1]")
118
+ if not 0.0 <= min_score_on_correct < 1.0:
119
+ raise ValueError("min_score_on_correct must be in [0, 1)")
120
+ self.low_confidence_threshold = low_confidence_threshold
121
+ self.min_score_on_correct = min_score_on_correct
122
+
123
+ def score(self, is_correct: bool, logprob_score: float | None) -> float:
124
+ if not is_correct:
125
+ return 0.0
126
+ if logprob_score is None:
127
+ return 1.0
128
+ probability = math.exp(logprob_score)
129
+ if probability >= self.low_confidence_threshold:
130
+ return 1.0
131
+ t = probability / self.low_confidence_threshold
132
+ return self.min_score_on_correct + (1.0 - self.min_score_on_correct) * t
133
+
134
+ def describe(self) -> str:
135
+ return f"LinearBlendScoring(threshold={self.low_confidence_threshold}, min_score={self.min_score_on_correct})"
136
+
137
+
138
+ class ThresholdScoring:
139
+ """Binary scoring gated on a logprob threshold.
140
+
141
+ * ``1.0`` only when correct **and** ``exp(logprob)`` >= *threshold*
142
+ * ``0.0`` otherwise
143
+
144
+ When *logprob_score* is ``None``, correct answers receive ``1.0``.
145
+
146
+ Parameters
147
+ ----------
148
+ threshold:
149
+ Probability threshold in ``(0, 1]``. Default ``0.7``.
150
+ """
151
+
152
+ def __init__(self, threshold: float = 0.7) -> None:
153
+ if not 0.0 < threshold <= 1.0:
154
+ raise ValueError("threshold must be in (0, 1]")
155
+ self.threshold = threshold
156
+
157
+ def score(self, is_correct: bool, logprob_score: float | None) -> float:
158
+ if not is_correct:
159
+ return 0.0
160
+ if logprob_score is None:
161
+ return 1.0
162
+ probability = math.exp(logprob_score)
163
+ return 1.0 if probability >= self.threshold else 0.0
164
+
165
+ def describe(self) -> str:
166
+ return f"ThresholdScoring(threshold={self.threshold})"
167
+
168
+
169
+ class SigmoidScoring:
170
+ """Smooth sigmoid curve mapping logprob confidence to ``[0, 1]``.
171
+
172
+ The logprob is converted to probability via ``exp(logprob)`` and then
173
+ passed through a sigmoid:
174
+
175
+ ``score = sigmoid(steepness * (probability - midpoint))``
176
+
177
+ when correct, ``0.0`` when incorrect.
178
+
179
+ When *logprob_score* is ``None``, correct answers receive ``1.0``.
180
+
181
+ Parameters
182
+ ----------
183
+ midpoint:
184
+ Probability value where the sigmoid outputs ``0.5``. Default ``0.5``.
185
+ steepness:
186
+ Controls how sharply the curve transitions. Default ``10.0``.
187
+ """
188
+
189
+ def __init__(self, midpoint: float = 0.5, steepness: float = 10.0) -> None:
190
+ if not 0.0 < midpoint < 1.0:
191
+ raise ValueError("midpoint must be in (0, 1)")
192
+ if steepness <= 0:
193
+ raise ValueError("steepness must be positive")
194
+ self.midpoint = midpoint
195
+ self.steepness = steepness
196
+
197
+ def score(self, is_correct: bool, logprob_score: float | None) -> float:
198
+ if not is_correct:
199
+ return 0.0
200
+ if logprob_score is None:
201
+ return 1.0
202
+ probability = math.exp(logprob_score)
203
+ return 1.0 / (1.0 + math.exp(-self.steepness * (probability - self.midpoint)))
204
+
205
+ def describe(self) -> str:
206
+ return f"SigmoidScoring(midpoint={self.midpoint}, steepness={self.steepness})"
@@ -0,0 +1,206 @@
1
+ # Copyright (c) 2025 Lakshya A Agrawal and the GEPA contributors
2
+ # https://github.com/gepa-ai/gepa
3
+
4
+ from collections.abc import Mapping, Sequence
5
+ from typing import Any, NamedTuple, Protocol, TypedDict, cast
6
+
7
+ from gepa.core.adapter import EvaluationBatch, GEPAAdapter
8
+
9
+
10
+ # DataInst, Trajectory, RolloutOutput
11
+ class DefaultDataInst(TypedDict):
12
+ input: str
13
+ additional_context: dict[str, str]
14
+ answer: str
15
+
16
+
17
+ class EvaluationResult(NamedTuple):
18
+ score: float
19
+ feedback: str
20
+ objective_scores: dict[str, float] | None = None
21
+
22
+
23
+ class DefaultTrajectory(TypedDict):
24
+ data: DefaultDataInst
25
+ full_assistant_response: str
26
+ feedback: str
27
+
28
+
29
+ class DefaultRolloutOutput(TypedDict):
30
+ full_assistant_response: str
31
+
32
+
33
+ DefaultReflectiveRecord = TypedDict(
34
+ "DefaultReflectiveRecord",
35
+ {
36
+ "Inputs": str,
37
+ "Generated Outputs": str,
38
+ "Feedback": str,
39
+ },
40
+ )
41
+
42
+
43
+ class ChatMessage(TypedDict):
44
+ role: str
45
+ content: str
46
+
47
+
48
+ class ChatCompletionCallable(Protocol):
49
+ """Protocol for chat completion callables (duck typing for custom model wrappers)."""
50
+
51
+ def __call__(self, messages: Sequence[ChatMessage]) -> str: ...
52
+
53
+
54
+ # Callable that evaluates a response and returns (score, feedback, optional objective_scores)
55
+ class Evaluator(Protocol):
56
+ def __call__(self, data: DefaultDataInst, response: str) -> EvaluationResult:
57
+ """
58
+ Evaluates a response and returns a score, feedback, and optional objective scores.
59
+ """
60
+ ...
61
+
62
+
63
+ class ContainsAnswerEvaluator:
64
+ """Default evaluator that checks if the expected answer is contained in the response."""
65
+
66
+ def __init__(self, failure_score: float = 0.0):
67
+ self.failure_score = failure_score
68
+
69
+ def __call__(self, data: DefaultDataInst, response: str) -> EvaluationResult:
70
+ is_correct = data["answer"] in response
71
+ score = 1.0 if is_correct else self.failure_score
72
+
73
+ if is_correct:
74
+ feedback = f"The generated response is correct. The response include the correct answer '{data['answer']}'"
75
+ else:
76
+ additional_context_str = "\n".join(f"{k}: {v}" for k, v in data["additional_context"].items())
77
+ feedback = (
78
+ f"The generated response is incorrect. The correct answer is '{data['answer']}'. "
79
+ "Ensure that the correct answer is included in the response exactly as it is."
80
+ )
81
+ if additional_context_str:
82
+ feedback += f" Here is some additional context that might be helpful:\n{additional_context_str}"
83
+
84
+ return EvaluationResult(score=score, feedback=feedback, objective_scores=None)
85
+
86
+
87
+ class DefaultAdapter(GEPAAdapter[DefaultDataInst, DefaultTrajectory, DefaultRolloutOutput]):
88
+ def __init__(
89
+ self,
90
+ model: str | ChatCompletionCallable,
91
+ evaluator: Evaluator | None = None,
92
+ max_litellm_workers: int = 10,
93
+ litellm_batch_completion_kwargs: dict[str, Any] | None = None,
94
+ ):
95
+ if isinstance(model, str):
96
+ from gepa.lm import LM
97
+
98
+ self._lm = LM(model)
99
+ else:
100
+ self._lm = None
101
+ self.model = model
102
+ self.evaluator = evaluator or ContainsAnswerEvaluator()
103
+ self.max_litellm_workers = max_litellm_workers
104
+ self.litellm_batch_completion_kwargs = litellm_batch_completion_kwargs or {}
105
+
106
+ def evaluate(
107
+ self,
108
+ batch: list[DefaultDataInst],
109
+ candidate: dict[str, str],
110
+ capture_traces: bool = False,
111
+ ) -> EvaluationBatch[DefaultTrajectory, DefaultRolloutOutput]:
112
+ outputs: list[DefaultRolloutOutput] = []
113
+ scores: list[float] = []
114
+ objective_scores: list[dict[str, float] | None] = []
115
+ trajectories: list[DefaultTrajectory] | None = [] if capture_traces else None
116
+
117
+ system_content = next(iter(candidate.values()))
118
+
119
+ litellm_requests = []
120
+
121
+ for data in batch:
122
+ user_content = f"{data['input']}"
123
+
124
+ messages: list[ChatMessage] = [
125
+ {"role": "system", "content": system_content},
126
+ {"role": "user", "content": user_content},
127
+ ]
128
+
129
+ litellm_requests.append(messages)
130
+
131
+ if self._lm is not None:
132
+ responses = self._lm.batch_complete(
133
+ litellm_requests, max_workers=self.max_litellm_workers, **self.litellm_batch_completion_kwargs
134
+ )
135
+ else:
136
+ model_fn = cast(ChatCompletionCallable, self.model)
137
+ responses = [model_fn(messages) for messages in litellm_requests]
138
+
139
+ for data, assistant_response in zip(batch, responses, strict=True):
140
+ eval_result = self.evaluator(data, assistant_response)
141
+ score = eval_result.score
142
+ feedback = eval_result.feedback
143
+ obj_scores = eval_result.objective_scores
144
+
145
+ output: DefaultRolloutOutput = {"full_assistant_response": assistant_response}
146
+
147
+ outputs.append(output)
148
+ scores.append(score)
149
+ objective_scores.append(obj_scores)
150
+
151
+ if trajectories is not None:
152
+ trajectories.append(
153
+ {
154
+ "data": data,
155
+ "full_assistant_response": assistant_response,
156
+ "feedback": feedback,
157
+ }
158
+ )
159
+
160
+ objective_scores_arg: list[dict[str, float]] | None = None
161
+ if objective_scores:
162
+ all_none = all(x is None for x in objective_scores)
163
+ all_not_none = all(x is not None for x in objective_scores)
164
+ if not (all_none or all_not_none):
165
+ raise ValueError("Objective scores must either be all None or all not None.")
166
+ if all_not_none:
167
+ objective_scores_arg = cast(list[dict[str, float]], objective_scores)
168
+
169
+ return EvaluationBatch(
170
+ outputs=outputs,
171
+ scores=scores,
172
+ trajectories=trajectories,
173
+ objective_scores=objective_scores_arg,
174
+ )
175
+
176
+ def make_reflective_dataset(
177
+ self,
178
+ candidate: dict[str, str],
179
+ eval_batch: EvaluationBatch[DefaultTrajectory, DefaultRolloutOutput],
180
+ components_to_update: list[str],
181
+ ) -> Mapping[str, Sequence[Mapping[str, Any]]]:
182
+ ret_d: dict[str, list[DefaultReflectiveRecord]] = {}
183
+
184
+ assert len(components_to_update) == 1
185
+ comp = components_to_update[0]
186
+
187
+ trajectories = eval_batch.trajectories
188
+ assert trajectories is not None, "Trajectories are required to build a reflective dataset."
189
+
190
+ items: list[DefaultReflectiveRecord] = []
191
+
192
+ for traj in trajectories:
193
+ d: DefaultReflectiveRecord = {
194
+ "Inputs": traj["data"]["input"],
195
+ "Generated Outputs": traj["full_assistant_response"],
196
+ "Feedback": traj["feedback"],
197
+ }
198
+
199
+ items.append(d)
200
+
201
+ ret_d[comp] = items
202
+
203
+ if len(items) == 0:
204
+ raise Exception("No valid predictions found for any module.")
205
+
206
+ return ret_d