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.
- package/README.md +23 -0
- package/dist/archive-artifacts-cli.d.ts +50 -0
- package/dist/archive-artifacts-cli.d.ts.map +1 -0
- package/dist/artifact-archive.d.ts +48 -0
- package/dist/artifact-archive.d.ts.map +1 -0
- package/dist/artifact-pull.d.ts +22 -0
- package/dist/artifact-pull.d.ts.map +1 -0
- package/dist/banner.d.ts +3 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/connectors-cli.d.ts +31 -0
- package/dist/connectors-cli.d.ts.map +1 -0
- package/dist/credentials.d.ts +46 -0
- package/dist/credentials.d.ts.map +1 -0
- package/dist/csv.d.ts +49 -0
- package/dist/csv.d.ts.map +1 -0
- package/dist/dataset-download.d.ts +6 -0
- package/dist/dataset-download.d.ts.map +1 -0
- package/dist/dataset-edit-rows.d.ts +10 -0
- package/dist/dataset-edit-rows.d.ts.map +1 -0
- package/dist/dataset-upload-snapshot.d.ts +13 -0
- package/dist/dataset-upload-snapshot.d.ts.map +1 -0
- package/dist/daytona-slice-rehearsal.d.ts +89 -0
- package/dist/daytona-slice-rehearsal.d.ts.map +1 -0
- package/dist/daytona-slice.d.ts +106 -0
- package/dist/daytona-slice.d.ts.map +1 -0
- package/dist/deploy-key-merge-core.d.ts +121 -0
- package/dist/deploy-key-merge-core.d.ts.map +1 -0
- package/dist/diff-comments-cli.d.ts +12 -0
- package/dist/diff-comments-cli.d.ts.map +1 -0
- package/dist/diff-comments-cli.js +21 -2
- package/dist/egress-allowlist-cli.d.ts +23 -0
- package/dist/egress-allowlist-cli.d.ts.map +1 -0
- package/dist/egress-policy.d.ts +108 -0
- package/dist/egress-policy.d.ts.map +1 -0
- package/dist/error-response.d.ts +9 -0
- package/dist/error-response.d.ts.map +1 -0
- package/dist/file-parser.d.ts +5 -0
- package/dist/file-parser.d.ts.map +1 -0
- package/dist/gepa-engine-dispatch.d.ts +9 -0
- package/dist/gepa-engine-dispatch.d.ts.map +1 -0
- package/dist/gepa-engine-dispatch.js +307 -0
- package/dist/gepa-python-command.d.ts +6 -0
- package/dist/gepa-python-command.d.ts.map +1 -0
- package/dist/gepa-python-command.js +26 -0
- package/dist/gepa-python-paths.d.ts +6 -0
- package/dist/gepa-python-paths.d.ts.map +1 -0
- package/dist/gepa-python-paths.js +42 -0
- package/dist/git-credential.d.ts +69 -0
- package/dist/git-credential.d.ts.map +1 -0
- package/dist/git-recovery-environment.d.ts +31 -0
- package/dist/git-recovery-environment.d.ts.map +1 -0
- package/dist/github-setup.d.ts +122 -0
- package/dist/github-setup.d.ts.map +1 -0
- package/dist/global-flags.d.ts +12 -0
- package/dist/global-flags.d.ts.map +1 -0
- package/dist/help.d.ts +46 -0
- package/dist/help.d.ts.map +1 -0
- package/dist/help.js +93 -25
- package/dist/hosted-boot.d.ts +273 -0
- package/dist/hosted-boot.d.ts.map +1 -0
- package/dist/hosted-bootstrap-rehearsal.d.ts +86 -0
- package/dist/hosted-bootstrap-rehearsal.d.ts.map +1 -0
- package/dist/hosted-bootstrap.d.ts +188 -0
- package/dist/hosted-bootstrap.d.ts.map +1 -0
- package/dist/hosted-broker-server.d.ts +50 -0
- package/dist/hosted-broker-server.d.ts.map +1 -0
- package/dist/hosted-git-http-server.d.ts +36 -0
- package/dist/hosted-git-http-server.d.ts.map +1 -0
- package/dist/hosted-harness-claude.d.ts +195 -0
- package/dist/hosted-harness-claude.d.ts.map +1 -0
- package/dist/hosted-harness-opencode.d.ts +227 -0
- package/dist/hosted-harness-opencode.d.ts.map +1 -0
- package/dist/hosted-harness.d.ts +118 -0
- package/dist/hosted-harness.d.ts.map +1 -0
- package/dist/hosted-harvest.d.ts +68 -0
- package/dist/hosted-harvest.d.ts.map +1 -0
- package/dist/hosted-headless.d.ts +72 -0
- package/dist/hosted-headless.d.ts.map +1 -0
- package/dist/hosted-loop-lifecycle.d.ts +206 -0
- package/dist/hosted-loop-lifecycle.d.ts.map +1 -0
- package/dist/hosted-loop.d.ts +170 -0
- package/dist/hosted-loop.d.ts.map +1 -0
- package/dist/hosted-run-event-sink.d.ts +222 -0
- package/dist/hosted-run-event-sink.d.ts.map +1 -0
- package/dist/hosted-runtime-assets.d.ts +186 -0
- package/dist/hosted-runtime-assets.d.ts.map +1 -0
- package/dist/hosted-session-cli.d.ts +258 -0
- package/dist/hosted-session-cli.d.ts.map +1 -0
- package/dist/hosted-skill-staging.d.ts +73 -0
- package/dist/hosted-skill-staging.d.ts.map +1 -0
- package/dist/http.d.ts +8 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +119 -129
- package/dist/instruction-set-gepa-launch.d.ts +3 -0
- package/dist/instruction-set-gepa-launch.d.ts.map +1 -0
- package/dist/instruction-set-gepa-launch.js +15 -0
- package/dist/instruction-set-loader.d.ts +6 -0
- package/dist/instruction-set-loader.d.ts.map +1 -0
- package/dist/instruction-set-loader.js +59 -0
- package/dist/instruction-set-manifest.d.ts +14 -0
- package/dist/instruction-set-manifest.d.ts.map +1 -0
- package/dist/instruction-set-manifest.js +162 -0
- package/dist/instruction-sets-cli.d.ts +40 -0
- package/dist/instruction-sets-cli.d.ts.map +1 -0
- package/dist/instruction-sets-cli.js +361 -0
- package/dist/json-response.d.ts +4 -0
- package/dist/json-response.d.ts.map +1 -0
- package/dist/jsonl-stream.d.ts +8 -0
- package/dist/jsonl-stream.d.ts.map +1 -0
- package/dist/kill-switch-cli.d.ts +30 -0
- package/dist/kill-switch-cli.d.ts.map +1 -0
- package/dist/loopback-serve.d.ts +25 -0
- package/dist/loopback-serve.d.ts.map +1 -0
- package/dist/manifests-cli.d.ts +22 -0
- package/dist/manifests-cli.d.ts.map +1 -0
- package/dist/markdown-report-input.d.ts +7 -0
- package/dist/markdown-report-input.d.ts.map +1 -0
- package/dist/markdown-report-input.js +15 -1
- package/dist/merge-job.d.ts +155 -0
- package/dist/merge-job.d.ts.map +1 -0
- package/dist/model-configs-cli.d.ts +19 -0
- package/dist/model-configs-cli.d.ts.map +1 -0
- package/dist/model-configs-cli.js +104 -0
- package/dist/optimization-export-cli.d.ts +19 -0
- package/dist/optimization-export-cli.d.ts.map +1 -0
- package/dist/optimizations-list-cli.d.ts +20 -0
- package/dist/optimizations-list-cli.d.ts.map +1 -0
- package/dist/optimizations-promote-cli.d.ts +8 -0
- package/dist/optimizations-promote-cli.d.ts.map +1 -0
- package/dist/optimizations-promote-cli.js +34 -0
- package/dist/option-validation.d.ts +15 -0
- package/dist/option-validation.d.ts.map +1 -0
- package/dist/preview-runtime.d.ts +63 -0
- package/dist/preview-runtime.d.ts.map +1 -0
- package/dist/prompt-draft-push.d.ts +60 -0
- package/dist/prompt-draft-push.d.ts.map +1 -0
- package/dist/prompt-label-cli.d.ts +11 -0
- package/dist/prompt-label-cli.d.ts.map +1 -0
- package/dist/prompt-label-cli.js +29 -0
- package/dist/prompt-length-wire.d.ts +28 -0
- package/dist/prompt-length-wire.d.ts.map +1 -0
- package/dist/prompt-length-wire.js +2 -2
- package/dist/prompt-report-cli.d.ts +10 -0
- package/dist/prompt-report-cli.d.ts.map +1 -0
- package/dist/prompt-report-cli.js +2 -2
- package/dist/prompt-summary-table.d.ts +15 -0
- package/dist/prompt-summary-table.d.ts.map +1 -0
- package/dist/prompt-summary-table.js +6 -0
- package/dist/registration-tag-warning.d.ts +32 -0
- package/dist/registration-tag-warning.d.ts.map +1 -0
- package/dist/report-comments-cli.d.ts +16 -0
- package/dist/report-comments-cli.d.ts.map +1 -0
- package/dist/report-markdown-blankness.d.ts +2 -0
- package/dist/report-markdown-blankness.d.ts.map +1 -0
- package/dist/report-markdown-blankness.js +6 -0
- package/dist/report-replacement-warning.d.ts +17 -0
- package/dist/report-replacement-warning.d.ts.map +1 -0
- package/dist/report-replacement-warning.js +31 -0
- package/dist/repository-backup-core.d.ts +225 -0
- package/dist/repository-backup-core.d.ts.map +1 -0
- package/dist/repository-recovery-manifest.d.ts +83 -0
- package/dist/repository-recovery-manifest.d.ts.map +1 -0
- package/dist/run-event-digest.d.ts +74 -0
- package/dist/run-event-digest.d.ts.map +1 -0
- package/dist/runner-dir-verify.d.ts +66 -0
- package/dist/runner-dir-verify.d.ts.map +1 -0
- package/dist/runner-instruction-set-contract.d.ts +24 -0
- package/dist/runner-instruction-set-contract.d.ts.map +1 -0
- package/dist/runner-instruction-set-contract.js +50 -0
- package/dist/sandbox-hygiene.d.ts +45 -0
- package/dist/sandbox-hygiene.d.ts.map +1 -0
- package/dist/sandbox-provider.d.ts +193 -0
- package/dist/sandbox-provider.d.ts.map +1 -0
- package/dist/scorer-draft-push.d.ts +50 -0
- package/dist/scorer-draft-push.d.ts.map +1 -0
- package/dist/scorers-cli.d.ts +20 -0
- package/dist/scorers-cli.d.ts.map +1 -0
- package/dist/scorers-cli.js +22 -0
- package/dist/scorers-verify-parity-bridge.d.ts +16 -0
- package/dist/scorers-verify-parity-bridge.d.ts.map +1 -0
- package/dist/scorers-verify-parity-bridge.js +90 -0
- package/dist/scorers-verify-parity.d.ts +81 -0
- package/dist/scorers-verify-parity.d.ts.map +1 -0
- package/dist/scorers-verify-parity.js +502 -0
- package/dist/scores-accept-cli.d.ts +21 -0
- package/dist/scores-accept-cli.d.ts.map +1 -0
- package/dist/secret-redaction.d.ts +47 -0
- package/dist/secret-redaction.d.ts.map +1 -0
- package/dist/session-timeline.d.ts +54 -0
- package/dist/session-timeline.d.ts.map +1 -0
- package/dist/setup-prompt.d.ts +5 -0
- package/dist/setup-prompt.d.ts.map +1 -0
- package/dist/skill-installer.d.ts +68 -0
- package/dist/skill-installer.d.ts.map +1 -0
- package/dist/skilled-proposer-launch.d.ts +7 -0
- package/dist/skilled-proposer-launch.d.ts.map +1 -0
- package/dist/skilled-proposer-launch.js +60 -0
- package/dist/smoke.d.ts +102 -0
- package/dist/smoke.d.ts.map +1 -0
- package/dist/start-intent.d.ts +12 -0
- package/dist/start-intent.d.ts.map +1 -0
- package/dist/task-assignment-manifest.d.ts +15 -0
- package/dist/task-assignment-manifest.d.ts.map +1 -0
- package/dist/task-create-error.d.ts +18 -0
- package/dist/task-create-error.d.ts.map +1 -0
- package/dist/team-connectors-cli.d.ts +29 -0
- package/dist/team-connectors-cli.d.ts.map +1 -0
- package/dist/types.d.ts +39 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/vercel-sandbox-provider.d.ts +156 -0
- package/dist/vercel-sandbox-provider.d.ts.map +1 -0
- package/dist/workbench-cli.d.ts +233 -0
- package/dist/workbench-cli.d.ts.map +1 -0
- package/dist/workspace-sync.d.ts +207 -0
- package/dist/workspace-sync.d.ts.map +1 -0
- package/dist/workspace.d.ts +92 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/zip-draft-push.d.ts +55 -0
- package/dist/zip-draft-push.d.ts.map +1 -0
- package/package.json +15 -2
- package/requirements/README.md +138 -0
- package/requirements/skilled-proposer.in +66 -0
- package/requirements/skilled-proposer.lock +265 -0
- package/scripts/build-cli-dist.mjs +30 -0
- package/scripts/ensure-skilled-proposer-venv.mjs +5 -0
- package/scripts/orizu-source-checkout.d.mts +1 -0
- package/scripts/orizu-source-checkout.mjs +10 -0
- package/scripts/refresh-skilled-proposer-lock.mjs +256 -0
- package/scripts/vendor-gepa-python.mjs +187 -4
- package/src/diff-comments-cli.ts +41 -3
- package/src/gepa-engine-dispatch.ts +340 -0
- package/src/gepa-python-command.ts +31 -0
- package/src/gepa-python-paths.ts +56 -0
- package/src/help.ts +95 -25
- package/src/index.ts +131 -166
- package/src/instruction-set-gepa-launch.ts +28 -0
- package/src/instruction-set-loader.ts +37 -0
- package/src/instruction-set-manifest.ts +120 -0
- package/src/instruction-sets-cli.ts +306 -0
- package/src/markdown-report-input.ts +19 -1
- package/src/model-configs-cli.ts +119 -0
- package/src/optimizations-promote-cli.ts +41 -0
- package/src/prompt-label-cli.ts +55 -0
- package/src/prompt-length-wire.ts +1 -1
- package/src/prompt-report-cli.ts +2 -2
- package/src/prompt-summary-table.ts +12 -0
- package/src/report-markdown-blankness.ts +6 -0
- package/src/report-replacement-warning.ts +35 -0
- package/src/runner-instruction-set-contract.ts +64 -0
- package/src/scorers-cli.ts +40 -0
- package/src/scorers-verify-parity-bridge.ts +90 -0
- package/src/scorers-verify-parity.ts +564 -0
- package/src/skilled-proposer-launch.ts +89 -0
- package/src/skilled-proposer-venv-manager.mjs +757 -0
- package/tsconfig.json +2 -0
- package/vendor/gepa-python/LICENSE +7 -0
- package/vendor/gepa-python/manifest.json +107 -0
- package/vendor/gepa-python/src/gepa/__init__.py +22 -0
- package/vendor/gepa-python/src/gepa/adapters/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/adapters/anymaths_adapter/__init__.py +1 -0
- package/vendor/gepa-python/src/gepa/adapters/anymaths_adapter/anymaths_adapter.py +174 -0
- package/vendor/gepa-python/src/gepa/adapters/confidence_adapter/__init__.py +26 -0
- package/vendor/gepa-python/src/gepa/adapters/confidence_adapter/confidence_adapter.py +618 -0
- package/vendor/gepa-python/src/gepa/adapters/confidence_adapter/scoring.py +206 -0
- package/vendor/gepa-python/src/gepa/adapters/default_adapter/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/adapters/default_adapter/default_adapter.py +206 -0
- package/vendor/gepa-python/src/gepa/adapters/dspy_adapter/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/adapters/dspy_adapter/dspy_adapter.py +525 -0
- package/vendor/gepa-python/src/gepa/adapters/dspy_adapter/instruction_proposal.py +500 -0
- package/vendor/gepa-python/src/gepa/adapters/dspy_full_program_adapter/__init__.py +6 -0
- package/vendor/gepa-python/src/gepa/adapters/dspy_full_program_adapter/dspy_program_proposal_signature.py +137 -0
- package/vendor/gepa-python/src/gepa/adapters/dspy_full_program_adapter/full_program_adapter.py +269 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/__init__.py +56 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/evaluation_metrics.py +226 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/generic_rag_adapter.py +496 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/rag_pipeline.py +238 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_store_interface.py +212 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/__init__.py +2 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/chroma_store.py +196 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/lancedb_store.py +422 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/milvus_store.py +409 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/qdrant_store.py +368 -0
- package/vendor/gepa-python/src/gepa/adapters/generic_rag_adapter/vector_stores/weaviate_store.py +418 -0
- package/vendor/gepa-python/src/gepa/adapters/langchain_adapter/__init__.py +11 -0
- package/vendor/gepa-python/src/gepa/adapters/langchain_adapter/langchain_adapter.py +261 -0
- package/vendor/gepa-python/src/gepa/adapters/mcp_adapter/__init__.py +37 -0
- package/vendor/gepa-python/src/gepa/adapters/mcp_adapter/mcp_adapter.py +693 -0
- package/vendor/gepa-python/src/gepa/adapters/mcp_adapter/mcp_client.py +364 -0
- package/vendor/gepa-python/src/gepa/adapters/optimize_anything_adapter/optimize_anything_adapter.py +879 -0
- package/vendor/gepa-python/src/gepa/adapters/terminal_bench_adapter/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/adapters/terminal_bench_adapter/terminal_bench_adapter.py +217 -0
- package/vendor/gepa-python/src/gepa/api.py +468 -0
- package/vendor/gepa-python/src/gepa/core/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/core/adapter.py +227 -0
- package/vendor/gepa-python/src/gepa/core/callbacks.py +551 -0
- package/vendor/gepa-python/src/gepa/core/data_loader.py +74 -0
- package/vendor/gepa-python/src/gepa/core/engine.py +1025 -0
- package/vendor/gepa-python/src/gepa/core/result.py +271 -0
- package/vendor/gepa-python/src/gepa/core/state.py +706 -0
- package/vendor/gepa-python/src/gepa/examples/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/examples/aime.py +24 -0
- package/vendor/gepa-python/src/gepa/examples/anymaths-bench/eval_default.py +111 -0
- package/vendor/gepa-python/src/gepa/examples/anymaths-bench/train_anymaths.py +177 -0
- package/vendor/gepa-python/src/gepa/examples/mcp_adapter/__init__.py +4 -0
- package/vendor/gepa-python/src/gepa/examples/mcp_adapter/mcp_optimization_example.py +456 -0
- package/vendor/gepa-python/src/gepa/examples/rag_adapter/__init__.py +9 -0
- package/vendor/gepa-python/src/gepa/examples/rag_adapter/rag_optimization.py +824 -0
- package/vendor/gepa-python/src/gepa/examples/terminal-bench/train_terminus.py +161 -0
- package/vendor/gepa-python/src/gepa/gepa_utils.py +117 -0
- package/vendor/gepa-python/src/gepa/gskill/__init__.py +1 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/cost_tracker.py +194 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/claude_code.py +1117 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/claude_code_skills.py +613 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/evaluate/mini_swe_agent.py +440 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/experiment_logger.py +367 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/swe_fitness_fn.py +209 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/swe_harness.py +352 -0
- package/vendor/gepa-python/src/gepa/gskill/gskill/train_optimize_anything.py +830 -0
- package/vendor/gepa-python/src/gepa/image.py +104 -0
- package/vendor/gepa-python/src/gepa/lm.py +261 -0
- package/vendor/gepa-python/src/gepa/logging/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/logging/experiment_tracker.py +457 -0
- package/vendor/gepa-python/src/gepa/logging/logger.py +75 -0
- package/vendor/gepa-python/src/gepa/logging/utils.py +130 -0
- package/vendor/gepa-python/src/gepa/optimize_anything.py +1701 -0
- package/vendor/gepa-python/src/gepa/proposer/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/proposer/base.py +53 -0
- package/vendor/gepa-python/src/gepa/proposer/merge.py +403 -0
- package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/base.py +64 -0
- package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/reflection_lm.py +178 -0
- package/vendor/gepa-python/src/gepa/proposer/reflective_mutation/reflective_mutation.py +641 -0
- package/vendor/gepa-python/src/gepa/py.typed +0 -0
- package/vendor/gepa-python/src/gepa/strategies/__init__.py +0 -0
- package/vendor/gepa-python/src/gepa/strategies/acceptance.py +66 -0
- package/vendor/gepa-python/src/gepa/strategies/batch_sampler.py +103 -0
- package/vendor/gepa-python/src/gepa/strategies/candidate_selector.py +82 -0
- package/vendor/gepa-python/src/gepa/strategies/component_selector.py +36 -0
- package/vendor/gepa-python/src/gepa/strategies/eval_policy.py +64 -0
- package/vendor/gepa-python/src/gepa/strategies/instruction_proposal.py +153 -0
- package/vendor/gepa-python/src/gepa/strategies/proposal_sampling.py +128 -0
- package/vendor/gepa-python/src/gepa/strategies/proposal_selection.py +84 -0
- package/vendor/gepa-python/src/gepa/utils/__init__.py +63 -0
- package/vendor/gepa-python/src/gepa/utils/code_execution.py +626 -0
- package/vendor/gepa-python/src/gepa/utils/stdio_capture.py +145 -0
- package/vendor/gepa-python/src/gepa/utils/stop_condition.py +230 -0
- package/vendor/gepa-python/src/gepa/visualization.py +359 -0
- package/vendor/orizu-gepa/pyproject.toml +18 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/__init__.py +9 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/__main__.py +5 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/adapter.py +138 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/callbacks.py +666 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/cli.py +7 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/engine.py +269 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/instruction_set_loader.py +52 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/preflight.py +64 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/reflection.py +186 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/runtime.py +721 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/skilled_proposer_bridge.py +381 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/stop_conditions.py +55 -0
- package/vendor/orizu-gepa/src/orizu_gepa_connector/translator.py +203 -0
- package/vendor/orizu-gepa-python/pyproject.toml +1 -1
- package/vendor/orizu-gepa-python/src/orizu_gepa/cli.py +1 -0
- package/vendor/orizu-gepa-python/src/orizu_gepa/client.py +52 -7
- package/vendor/orizu-gepa-python/src/orizu_gepa/local_log.py +52 -0
- package/vendor/orizu-gepa-python/src/orizu_gepa/optimizer.py +10 -5
- package/vendor/orizu-gepa-python/src/orizu_gepa/reflection.py +323 -68
- package/vendor/orizu-gepa-python/src/orizu_gepa/runner.py +207 -13
- package/vendor/skills/orizu-cli/SKILL.md +3 -1
- package/vendor/skills/orizu-cli/references/cli-reference.md +85 -1
- package/vendor/skills/orizu-cli/references/migrate-existing-gepa-setup.md +303 -0
- package/vendor/skills/orizu-cli/references/optimization-reports.md +1 -1
- package/vendor/skills/orizu-cli/references/optimization-with-gepa.md +26 -1
- package/vendor/skills/orizu-cli/references/prompt-control-plane.md +113 -10
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Thread-safe stdout/stderr capture utilities for GEPA evaluation.
|
|
3
|
+
|
|
4
|
+
When ``capture_stdio=True`` is set in :class:`EngineConfig`, these utilities
|
|
5
|
+
replace ``sys.stdout`` and ``sys.stderr`` with per-thread wrappers so that
|
|
6
|
+
print output produced inside an evaluator is captured without polluting the
|
|
7
|
+
main process output or leaking between concurrent evaluations.
|
|
8
|
+
|
|
9
|
+
Classes:
|
|
10
|
+
ThreadLocalStreamCapture: A ``sys.stdout``/``sys.stderr`` replacement
|
|
11
|
+
that routes writes to a private buffer on threads that have opted in,
|
|
12
|
+
while passing all other threads through to the original stream.
|
|
13
|
+
StreamCaptureManager: Reference-counted manager that installs/removes the
|
|
14
|
+
capture wrappers, allowing multiple concurrent ``optimize_anything``
|
|
15
|
+
calls to share them safely.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
import io
|
|
19
|
+
import sys
|
|
20
|
+
import threading
|
|
21
|
+
from typing import Any
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class ThreadLocalStreamCapture:
|
|
25
|
+
"""A ``sys.stdout`` / ``sys.stderr`` replacement that captures output per-thread.
|
|
26
|
+
|
|
27
|
+
Threads that have called :meth:`start_capture` get their writes routed to a
|
|
28
|
+
private ``StringIO``; all other threads pass through to the original stream.
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
def __init__(self, original: Any) -> None:
|
|
32
|
+
self._original = original
|
|
33
|
+
self._local = threading.local()
|
|
34
|
+
|
|
35
|
+
# -- file-like interface --------------------------------------------------
|
|
36
|
+
|
|
37
|
+
def write(self, text: str) -> int:
|
|
38
|
+
if getattr(self._local, "capturing", False):
|
|
39
|
+
return self._local.buffer.write(text)
|
|
40
|
+
return self._original.write(text)
|
|
41
|
+
|
|
42
|
+
def flush(self) -> None:
|
|
43
|
+
if getattr(self._local, "capturing", False):
|
|
44
|
+
self._local.buffer.flush()
|
|
45
|
+
self._original.flush()
|
|
46
|
+
|
|
47
|
+
def fileno(self) -> int:
|
|
48
|
+
# Always delegate to the original stream so that libraries (tqdm, rich,
|
|
49
|
+
# subprocess, logging handlers, etc.) that call sys.stdout.fileno()
|
|
50
|
+
# continue to work even while this thread is being captured.
|
|
51
|
+
return self._original.fileno()
|
|
52
|
+
|
|
53
|
+
@property
|
|
54
|
+
def encoding(self) -> str:
|
|
55
|
+
return self._original.encoding
|
|
56
|
+
|
|
57
|
+
@property
|
|
58
|
+
def errors(self) -> str | None:
|
|
59
|
+
return self._original.errors
|
|
60
|
+
|
|
61
|
+
def isatty(self) -> bool:
|
|
62
|
+
if getattr(self._local, "capturing", False):
|
|
63
|
+
return False
|
|
64
|
+
return self._original.isatty()
|
|
65
|
+
|
|
66
|
+
def writable(self) -> bool:
|
|
67
|
+
return True
|
|
68
|
+
|
|
69
|
+
def readable(self) -> bool:
|
|
70
|
+
return False
|
|
71
|
+
|
|
72
|
+
def __getattr__(self, name: str) -> Any:
|
|
73
|
+
return getattr(self._original, name)
|
|
74
|
+
|
|
75
|
+
# -- capture control ------------------------------------------------------
|
|
76
|
+
|
|
77
|
+
def start_capture(self) -> None:
|
|
78
|
+
"""Start capturing for the current thread."""
|
|
79
|
+
assert not getattr(self._local, "capturing", False), (
|
|
80
|
+
"start_capture() called while already capturing on this thread. "
|
|
81
|
+
"Call stop_capture() first to retrieve the buffered output."
|
|
82
|
+
)
|
|
83
|
+
self._local.capturing = True
|
|
84
|
+
self._local.buffer = io.StringIO()
|
|
85
|
+
|
|
86
|
+
def stop_capture(self) -> str:
|
|
87
|
+
"""Stop capturing and return the captured text for the current thread.
|
|
88
|
+
|
|
89
|
+
Safe to call even if :meth:`start_capture` was never called on this
|
|
90
|
+
thread — returns an empty string in that case.
|
|
91
|
+
"""
|
|
92
|
+
if not getattr(self._local, "capturing", False):
|
|
93
|
+
return ""
|
|
94
|
+
self._local.capturing = False
|
|
95
|
+
text = self._local.buffer.getvalue()
|
|
96
|
+
self._local.buffer = io.StringIO()
|
|
97
|
+
return text
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class StreamCaptureManager:
|
|
101
|
+
"""Reference-counted manager for per-thread stdout/stderr capture.
|
|
102
|
+
|
|
103
|
+
Allows multiple concurrent optimize_anything calls with capture_stdio=True
|
|
104
|
+
to share the same stream wrappers. sys.stdout/stderr are only restored when
|
|
105
|
+
the last user releases.
|
|
106
|
+
"""
|
|
107
|
+
|
|
108
|
+
def __init__(self) -> None:
|
|
109
|
+
self._lock = threading.Lock()
|
|
110
|
+
self._refcount = 0
|
|
111
|
+
self._stdout_capturer: ThreadLocalStreamCapture | None = None
|
|
112
|
+
self._stderr_capturer: ThreadLocalStreamCapture | None = None
|
|
113
|
+
self._original_stdout: Any = None
|
|
114
|
+
self._original_stderr: Any = None
|
|
115
|
+
|
|
116
|
+
def acquire(self) -> tuple[ThreadLocalStreamCapture, ThreadLocalStreamCapture]:
|
|
117
|
+
"""Install capture wrappers (or reuse existing). Returns (stdout_cap, stderr_cap)."""
|
|
118
|
+
with self._lock:
|
|
119
|
+
if self._refcount == 0:
|
|
120
|
+
self._original_stdout = sys.stdout
|
|
121
|
+
self._original_stderr = sys.stderr
|
|
122
|
+
self._stdout_capturer = ThreadLocalStreamCapture(sys.stdout)
|
|
123
|
+
self._stderr_capturer = ThreadLocalStreamCapture(sys.stderr)
|
|
124
|
+
sys.stdout = self._stdout_capturer # type: ignore[assignment]
|
|
125
|
+
sys.stderr = self._stderr_capturer # type: ignore[assignment]
|
|
126
|
+
self._refcount += 1
|
|
127
|
+
assert self._stdout_capturer is not None and self._stderr_capturer is not None
|
|
128
|
+
return self._stdout_capturer, self._stderr_capturer
|
|
129
|
+
|
|
130
|
+
def release(self) -> None:
|
|
131
|
+
"""Decrement ref count. Restores original streams when last user releases."""
|
|
132
|
+
with self._lock:
|
|
133
|
+
self._refcount -= 1
|
|
134
|
+
if self._refcount <= 0:
|
|
135
|
+
if self._original_stdout is not None:
|
|
136
|
+
sys.stdout = self._original_stdout
|
|
137
|
+
if self._original_stderr is not None:
|
|
138
|
+
sys.stderr = self._original_stderr
|
|
139
|
+
self._stdout_capturer = None
|
|
140
|
+
self._stderr_capturer = None
|
|
141
|
+
self._refcount = 0
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# Module-level singleton shared across all optimize_anything calls.
|
|
145
|
+
stream_manager = StreamCaptureManager()
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Utility functions for graceful stopping of GEPA runs.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
import signal
|
|
7
|
+
import time
|
|
8
|
+
from typing import Literal, Protocol, runtime_checkable
|
|
9
|
+
|
|
10
|
+
from gepa.core.state import GEPAState
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@runtime_checkable
|
|
14
|
+
class StopperProtocol(Protocol):
|
|
15
|
+
"""
|
|
16
|
+
Protocol for stop condition objects.
|
|
17
|
+
|
|
18
|
+
A stopper is a callable object that returns True when the optimization should stop.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
def __call__(self, gepa_state: GEPAState) -> bool:
|
|
22
|
+
"""
|
|
23
|
+
Check if the optimization should stop.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
gepa_state: The current GEPA state containing optimization information
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
True if the optimization should stop, False otherwise.
|
|
30
|
+
"""
|
|
31
|
+
...
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class TimeoutStopCondition(StopperProtocol):
|
|
35
|
+
"""Stop callback that stops after a specified timeout."""
|
|
36
|
+
|
|
37
|
+
def __init__(self, timeout_seconds: float):
|
|
38
|
+
self.timeout_seconds = timeout_seconds
|
|
39
|
+
self.start_time = time.time()
|
|
40
|
+
|
|
41
|
+
def __call__(self, gepa_state: GEPAState) -> bool:
|
|
42
|
+
# return true if timeout has been reached
|
|
43
|
+
return time.time() - self.start_time > self.timeout_seconds
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class FileStopper(StopperProtocol):
|
|
47
|
+
"""
|
|
48
|
+
Stop callback that stops when a specific file exists.
|
|
49
|
+
"""
|
|
50
|
+
|
|
51
|
+
def __init__(self, stop_file_path: str):
|
|
52
|
+
self.stop_file_path = stop_file_path
|
|
53
|
+
|
|
54
|
+
def __call__(self, gepa_state: GEPAState) -> bool:
|
|
55
|
+
# returns true if stop file exists
|
|
56
|
+
return os.path.exists(self.stop_file_path)
|
|
57
|
+
|
|
58
|
+
def remove_stop_file(self):
|
|
59
|
+
# remove the stop file
|
|
60
|
+
if os.path.exists(self.stop_file_path):
|
|
61
|
+
os.remove(self.stop_file_path)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class ScoreThresholdStopper(StopperProtocol):
|
|
65
|
+
"""
|
|
66
|
+
Stop callback that stops when a score threshold is reached.
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
def __init__(self, threshold: float):
|
|
70
|
+
self.threshold = threshold
|
|
71
|
+
|
|
72
|
+
def __call__(self, gepa_state: GEPAState) -> bool:
|
|
73
|
+
# return true if score threshold is reached
|
|
74
|
+
try:
|
|
75
|
+
current_best_score = (
|
|
76
|
+
max(gepa_state.program_full_scores_val_set) if gepa_state.program_full_scores_val_set else 0.0
|
|
77
|
+
)
|
|
78
|
+
return current_best_score >= self.threshold
|
|
79
|
+
except Exception:
|
|
80
|
+
return False
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class NoImprovementStopper(StopperProtocol):
|
|
84
|
+
"""
|
|
85
|
+
Stop callback that stops after a specified number of iterations without improvement.
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
def __init__(self, max_iterations_without_improvement: int):
|
|
89
|
+
self.max_iterations_without_improvement = max_iterations_without_improvement
|
|
90
|
+
self.best_score = float("-inf")
|
|
91
|
+
self.iterations_without_improvement = 0
|
|
92
|
+
|
|
93
|
+
def __call__(self, gepa_state: GEPAState) -> bool:
|
|
94
|
+
# return true if max iterations without improvement reached
|
|
95
|
+
try:
|
|
96
|
+
current_score = (
|
|
97
|
+
max(gepa_state.program_full_scores_val_set) if gepa_state.program_full_scores_val_set else 0.0
|
|
98
|
+
)
|
|
99
|
+
if current_score > self.best_score:
|
|
100
|
+
self.best_score = current_score
|
|
101
|
+
self.iterations_without_improvement = 0
|
|
102
|
+
else:
|
|
103
|
+
self.iterations_without_improvement += 1
|
|
104
|
+
|
|
105
|
+
return self.iterations_without_improvement >= self.max_iterations_without_improvement
|
|
106
|
+
except Exception:
|
|
107
|
+
return False
|
|
108
|
+
|
|
109
|
+
def reset(self):
|
|
110
|
+
"""Reset the counter (useful when manually improving the score)."""
|
|
111
|
+
self.iterations_without_improvement = 0
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class SignalStopper(StopperProtocol):
|
|
115
|
+
"""Stop callback that stops when a signal is received."""
|
|
116
|
+
|
|
117
|
+
def __init__(self, signals=None):
|
|
118
|
+
self.signals = signals or [signal.SIGINT, signal.SIGTERM]
|
|
119
|
+
self._stop_requested = False
|
|
120
|
+
self._original_handlers = {}
|
|
121
|
+
self._setup_signal_handlers()
|
|
122
|
+
|
|
123
|
+
def _setup_signal_handlers(self):
|
|
124
|
+
"""Set up signal handlers for graceful shutdown."""
|
|
125
|
+
|
|
126
|
+
def signal_handler(signum, frame):
|
|
127
|
+
self._stop_requested = True
|
|
128
|
+
|
|
129
|
+
# Store original handlers and set new ones
|
|
130
|
+
for sig in self.signals:
|
|
131
|
+
try:
|
|
132
|
+
self._original_handlers[sig] = signal.signal(sig, signal_handler)
|
|
133
|
+
except (OSError, ValueError):
|
|
134
|
+
# Signal not available on this platform
|
|
135
|
+
pass
|
|
136
|
+
|
|
137
|
+
def __call__(self, gepa_state: GEPAState) -> bool:
|
|
138
|
+
# return true if a signal was received
|
|
139
|
+
return self._stop_requested
|
|
140
|
+
|
|
141
|
+
def cleanup(self):
|
|
142
|
+
"""Restore original signal handlers."""
|
|
143
|
+
for sig, handler in self._original_handlers.items():
|
|
144
|
+
try:
|
|
145
|
+
signal.signal(sig, handler)
|
|
146
|
+
except (OSError, ValueError):
|
|
147
|
+
pass
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class MaxTrackedCandidatesStopper(StopperProtocol):
|
|
151
|
+
"""
|
|
152
|
+
Stop callback that stops after a maximum number of tracked candidates.
|
|
153
|
+
"""
|
|
154
|
+
|
|
155
|
+
def __init__(self, max_tracked_candidates: int):
|
|
156
|
+
self.max_tracked_candidates = max_tracked_candidates
|
|
157
|
+
|
|
158
|
+
def __call__(self, gepa_state: GEPAState) -> bool:
|
|
159
|
+
# return true if max tracked candidates reached
|
|
160
|
+
return len(gepa_state.program_candidates) >= self.max_tracked_candidates
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
class MaxMetricCallsStopper(StopperProtocol):
|
|
164
|
+
"""
|
|
165
|
+
Stop callback that stops after a maximum number of metric calls.
|
|
166
|
+
"""
|
|
167
|
+
|
|
168
|
+
def __init__(self, max_metric_calls: int):
|
|
169
|
+
self.max_metric_calls = max_metric_calls
|
|
170
|
+
|
|
171
|
+
def __call__(self, gepa_state: GEPAState) -> bool:
|
|
172
|
+
# return true if max metric calls reached
|
|
173
|
+
return gepa_state.total_num_evals >= self.max_metric_calls
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
class MaxReflectionCostStopper(StopperProtocol):
|
|
177
|
+
"""Stop once the reflection LM's cumulative cost (USD) reaches a budget.
|
|
178
|
+
|
|
179
|
+
Reads ``lm.total_cost`` from the :class:`~gepa.lm.LM` instance passed
|
|
180
|
+
at construction time. Custom callables wrapped in ``TrackingLM``
|
|
181
|
+
always report ``0.0`` cost and never trip this stopper.
|
|
182
|
+
"""
|
|
183
|
+
|
|
184
|
+
def __init__(self, max_reflection_cost_usd: float, reflection_lm: object | None = None):
|
|
185
|
+
self.max_reflection_cost_usd = max_reflection_cost_usd
|
|
186
|
+
self._reflection_lm = reflection_lm
|
|
187
|
+
|
|
188
|
+
def __call__(self, gepa_state: GEPAState) -> bool:
|
|
189
|
+
cost = getattr(self._reflection_lm, "total_cost", 0.0)
|
|
190
|
+
return cost >= self.max_reflection_cost_usd
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
class MaxCandidateProposalsStopper(StopperProtocol):
|
|
194
|
+
"""
|
|
195
|
+
Stop callback that stops after a maximum number of candidate proposals.
|
|
196
|
+
|
|
197
|
+
Note: state.i starts at -1, and is incremented at the START of each loop iteration.
|
|
198
|
+
The stopper is checked BEFORE the increment, so when state.i = N-1, we're about to
|
|
199
|
+
run proposal N. To allow exactly max_proposals proposals, we stop when
|
|
200
|
+
state.i >= max_proposals - 1 (i.e., we've completed max_proposals proposals).
|
|
201
|
+
"""
|
|
202
|
+
|
|
203
|
+
def __init__(self, max_proposals: int):
|
|
204
|
+
self.max_proposals = max_proposals
|
|
205
|
+
|
|
206
|
+
def __call__(self, gepa_state: GEPAState) -> bool:
|
|
207
|
+
return gepa_state.i >= self.max_proposals - 1
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
class CompositeStopper(StopperProtocol):
|
|
211
|
+
"""
|
|
212
|
+
Stop callback that combines multiple stopping conditions.
|
|
213
|
+
|
|
214
|
+
Allows combining several stoppers and stopping when any or all of them are triggered.
|
|
215
|
+
"""
|
|
216
|
+
|
|
217
|
+
def __init__(self, *stoppers: StopperProtocol, mode: Literal["any", "all"] = "any"):
|
|
218
|
+
# initialize composite stopper
|
|
219
|
+
|
|
220
|
+
self.stoppers = stoppers
|
|
221
|
+
self.mode = mode
|
|
222
|
+
|
|
223
|
+
def __call__(self, gepa_state: GEPAState) -> bool:
|
|
224
|
+
# return true if stopping condition is met
|
|
225
|
+
if self.mode == "any":
|
|
226
|
+
return any(stopper(gepa_state) for stopper in self.stoppers)
|
|
227
|
+
elif self.mode == "all":
|
|
228
|
+
return all(stopper(gepa_state) for stopper in self.stoppers)
|
|
229
|
+
else:
|
|
230
|
+
raise ValueError(f"Unknown mode: {self.mode}")
|