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
package/dist/index.js
CHANGED
|
@@ -28,11 +28,15 @@ import { formatTaskCreateError } from './task-create-error.js';
|
|
|
28
28
|
import { renderAgentSetupPrompt } from './setup-prompt.js';
|
|
29
29
|
import { getWorkspaceRoot, initOrizuWorkspace, workspaceExists, } from './workspace.js';
|
|
30
30
|
import { connectorsCommand } from './connectors-cli.js';
|
|
31
|
+
import { modelConfigsCommand } from './model-configs-cli.js';
|
|
31
32
|
import { ARTIFACT_MAX_BYTES, runnerOptimizerCommand } from './artifact-pull.js';
|
|
32
33
|
import { killSwitchCommand } from './kill-switch-cli.js';
|
|
33
34
|
import { egressAllowlistCommand } from './egress-allowlist-cli.js';
|
|
34
35
|
import { acceptScoreRunCommand } from './scores-accept-cli.js';
|
|
35
36
|
import { listOptimizationRunsCommand } from './optimizations-list-cli.js';
|
|
37
|
+
import { promoteOptimizationCommand } from './optimizations-promote-cli.js';
|
|
38
|
+
import { scorersCommand } from './scorers-cli.js';
|
|
39
|
+
import { verifyScorerParityCommand } from './scorers-verify-parity.js';
|
|
36
40
|
import { archiveArtifactCommand, listAssignmentsCommand, printAppSummaries, printDatasetSummaries, printScorerSummaries, printTaskSummaries, } from './archive-artifacts-cli.js';
|
|
37
41
|
import { teamConnectorsCommand } from './team-connectors-cli.js';
|
|
38
42
|
import { manifestsCommand } from './manifests-cli.js';
|
|
@@ -40,18 +44,28 @@ import { workbenchCommand } from './workbench-cli.js';
|
|
|
40
44
|
import { hostedCommand } from './hosted-session-cli.js';
|
|
41
45
|
import { workspaceSyncCommand } from './workspace-sync.js';
|
|
42
46
|
import { runGitCredentialInvocation } from './git-credential.js';
|
|
47
|
+
import { instructionSetsCommand, syncToDisk } from './instruction-sets-cli.js';
|
|
48
|
+
export { loadInstructionSet } from './instruction-set-loader.js';
|
|
49
|
+
import { runnerInputInstructionSet, runnerInputPrompt, runnerInstructionSetSyncSet } from './runner-instruction-set-contract.js';
|
|
43
50
|
import { pushPromptDraft } from './prompt-draft-push.js';
|
|
44
51
|
import { readMarkdownReportInput } from './markdown-report-input.js';
|
|
45
52
|
import { promptPushErrorMessage, promptReportCommand } from './prompt-report-cli.js';
|
|
53
|
+
import { setPromptLabel } from './prompt-label-cli.js';
|
|
46
54
|
import { printPromptSummaryTable } from './prompt-summary-table.js';
|
|
47
55
|
import { assertSnapshotManifestConfined, verifyGepaRunnerDirsFromArgs, verifyRunnerDirRegistered } from './runner-dir-verify.js';
|
|
48
56
|
import { runScorersRegister } from './scorer-draft-push.js';
|
|
49
57
|
import { runZipArtifactPush } from './zip-draft-push.js';
|
|
50
58
|
import { runGithubLink, runInteractiveHostedSetup } from './github-setup.js';
|
|
51
59
|
import { parseJsonResponse, sanitizeTerminalText } from './json-response.js';
|
|
60
|
+
import { reportReplacementWarning } from './report-replacement-warning.js';
|
|
52
61
|
import { reportCommentsCommand, throwDeprecatedPromptCommentsCommand, } from './report-comments-cli.js';
|
|
53
62
|
import { diffCommentsCommand } from './diff-comments-cli.js';
|
|
54
63
|
import { exportOptimizationRunCommand } from './optimization-export-cli.js';
|
|
64
|
+
import { dispatchGepaEngine } from './gepa-engine-dispatch.js';
|
|
65
|
+
import { resolveGepaInstructionSetProfileVersion } from './instruction-set-gepa-launch.js';
|
|
66
|
+
import { getGepaPythonCommand } from './gepa-python-command.js';
|
|
67
|
+
import { getGepaPythonPathEntries } from './gepa-python-paths.js';
|
|
68
|
+
import { prepareSkilledProposerLaunch } from './skilled-proposer-launch.js';
|
|
55
69
|
export { parseJsonResponse, sanitizeTerminalText } from './json-response.js';
|
|
56
70
|
function getErrorMessage(error) {
|
|
57
71
|
return error instanceof Error ? error.message : String(error);
|
|
@@ -185,6 +199,14 @@ export function createCodeChallenge(verifier) {
|
|
|
185
199
|
function printError(message) {
|
|
186
200
|
console.error(sanitizeTerminalText(message));
|
|
187
201
|
}
|
|
202
|
+
function printPushDisclosures(data) {
|
|
203
|
+
const warning = reportReplacementWarning(data);
|
|
204
|
+
if (warning)
|
|
205
|
+
printError(warning);
|
|
206
|
+
if (data.metadata_updated === true) {
|
|
207
|
+
printError('Updated prompt metadata on the identical existing version');
|
|
208
|
+
}
|
|
209
|
+
}
|
|
188
210
|
export function validateBrowserUrl(url, expectedOrigin) {
|
|
189
211
|
let parsed;
|
|
190
212
|
try {
|
|
@@ -1014,8 +1036,10 @@ async function pushPromptArtifact(kind) {
|
|
|
1014
1036
|
});
|
|
1015
1037
|
if (hasJsonFlag())
|
|
1016
1038
|
printJson(data);
|
|
1017
|
-
else
|
|
1039
|
+
else {
|
|
1040
|
+
printPushDisclosures(data);
|
|
1018
1041
|
printLine(message);
|
|
1042
|
+
}
|
|
1019
1043
|
return;
|
|
1020
1044
|
}
|
|
1021
1045
|
// LEGACY SESSIONLESS PATH (no branch to commit to; the server dual-writes
|
|
@@ -1061,6 +1085,7 @@ async function pushPromptArtifact(kind) {
|
|
|
1061
1085
|
printJson(data);
|
|
1062
1086
|
return;
|
|
1063
1087
|
}
|
|
1088
|
+
printPushDisclosures(data);
|
|
1064
1089
|
printLine(`Pushed ${kind} ${sanitizeTerminalText(String(manifest.name || promptDir))} (${sanitizeTerminalText(String(data.prompt_version_id || 'unknown version'))})`);
|
|
1065
1090
|
}
|
|
1066
1091
|
async function pullPromptArtifact(kind) {
|
|
@@ -1159,6 +1184,7 @@ async function pullPromptArtifact(kind) {
|
|
|
1159
1184
|
scorer_version_id: data.scorerVersionId || undefined,
|
|
1160
1185
|
scorer_version_ids: scorerVersions.map(item => item.id),
|
|
1161
1186
|
path: targetDir,
|
|
1187
|
+
owner: data.owner || undefined,
|
|
1162
1188
|
});
|
|
1163
1189
|
return;
|
|
1164
1190
|
}
|
|
@@ -1170,55 +1196,14 @@ async function pullPromptArtifact(kind) {
|
|
|
1170
1196
|
else if (!data.scorerVersionId && kind === 'judge') {
|
|
1171
1197
|
printLine(`Warning: prompt version ${sanitizeTerminalText(data.version.id)} does not map to an executable scorer version.`);
|
|
1172
1198
|
}
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
const label = getPositionalArg(4);
|
|
1177
|
-
const project = getArg('--project') || await resolveProjectSlug(null);
|
|
1178
|
-
const promptVersionId = getArg('--version');
|
|
1179
|
-
if (!promptName || !label || !promptVersionId) {
|
|
1180
|
-
throw new Error('Usage: orizu prompts labels set <prompt-name> <label> --version <prompt-version-id> [--project <team/project>] [--json]');
|
|
1181
|
-
}
|
|
1182
|
-
const response = await authedFetch(`/api/cli/prompts/labels?project=${encodeURIComponent(project)}`, {
|
|
1183
|
-
method: 'POST',
|
|
1184
|
-
headers: { 'Content-Type': 'application/json' },
|
|
1185
|
-
body: JSON.stringify({
|
|
1186
|
-
promptName,
|
|
1187
|
-
label,
|
|
1188
|
-
promptVersionId,
|
|
1189
|
-
}),
|
|
1190
|
-
});
|
|
1191
|
-
if (!response.ok) {
|
|
1192
|
-
throw new Error(`Failed to set prompt label: ${await response.text()}`);
|
|
1193
|
-
}
|
|
1194
|
-
const data = await parseJsonResponse(response, 'Prompt label set');
|
|
1195
|
-
if (hasJsonFlag()) {
|
|
1196
|
-
printJson(data);
|
|
1197
|
-
return;
|
|
1199
|
+
if (kind === 'prompt' && data.owner) {
|
|
1200
|
+
printLine(`Owner: ${sanitizeTerminalText(data.prompt.name)} (${sanitizeTerminalText(data.prompt.id)}) -> ` +
|
|
1201
|
+
`${sanitizeTerminalText(data.owner.instructionSetSlug)} / ${sanitizeTerminalText(data.owner.componentKey)}`);
|
|
1198
1202
|
}
|
|
1199
|
-
printLine(`Moved ${sanitizeTerminalText(label)} to ${sanitizeTerminalText(promptVersionId)}`);
|
|
1200
1203
|
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
const command = archived ? 'archive' : 'restore';
|
|
1205
|
-
if (!promptRef) {
|
|
1206
|
-
throw new Error(`Usage: orizu prompts ${command} <prompt-id-or-name> --project <team/project> [--json]`);
|
|
1207
|
-
}
|
|
1208
|
-
const response = await authedFetch(`/api/cli/prompts/${encodeURIComponent(promptRef)}?project=${encodeURIComponent(project)}`, {
|
|
1209
|
-
method: 'PATCH',
|
|
1210
|
-
headers: { 'Content-Type': 'application/json' },
|
|
1211
|
-
body: JSON.stringify({ archived }),
|
|
1212
|
-
});
|
|
1213
|
-
if (!response.ok) {
|
|
1214
|
-
throw new Error(`Failed to ${command} prompt: ${await response.text()}`);
|
|
1215
|
-
}
|
|
1216
|
-
const data = await parseJsonResponse(response, `Prompt ${command}`);
|
|
1217
|
-
if (hasJsonFlag()) {
|
|
1218
|
-
printJson(data);
|
|
1219
|
-
return;
|
|
1220
|
-
}
|
|
1221
|
-
printLine(`${archived ? 'Archived' : 'Restored'} prompt ${sanitizeTerminalText(data.prompt.name)} (${sanitizeTerminalText(data.prompt.id)})`);
|
|
1204
|
+
function refusePromptMutation(replacement) {
|
|
1205
|
+
process.exitCode = 1;
|
|
1206
|
+
throw new Error(`Use: orizu instructions ${replacement}`);
|
|
1222
1207
|
}
|
|
1223
1208
|
async function bindPromptScorer(role) {
|
|
1224
1209
|
const promptId = getPositionalArg(3);
|
|
@@ -1248,6 +1233,10 @@ async function bindPromptScorer(role) {
|
|
|
1248
1233
|
return;
|
|
1249
1234
|
}
|
|
1250
1235
|
printLine(`${role === 'headline' ? 'Set headline' : 'Added'} scorer ${sanitizeTerminalText(scorerVersionId)} for ${sanitizeTerminalText(promptId)}`);
|
|
1236
|
+
if (data.owner) {
|
|
1237
|
+
printLine(`Owner: ${sanitizeTerminalText(promptId)} -> ` +
|
|
1238
|
+
`${sanitizeTerminalText(data.owner.instructionSetSlug)} / ${sanitizeTerminalText(data.owner.componentKey)}`);
|
|
1239
|
+
}
|
|
1251
1240
|
}
|
|
1252
1241
|
function getPositionalArg(index) {
|
|
1253
1242
|
const value = cliArgs[index];
|
|
@@ -1795,30 +1784,12 @@ async function updateOptimizationRunLifecycle(action) {
|
|
|
1795
1784
|
}
|
|
1796
1785
|
// ALI-1073 list moved to optimizations-list-cli.ts (line ratchet, ALI-976);
|
|
1797
1786
|
// ALI-1175 labels its best scores as agent-reported evidence there.
|
|
1798
|
-
function removeFlagWithValue(args, flag) {
|
|
1799
|
-
const filtered = [];
|
|
1800
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
1801
|
-
if (args[index] === flag) {
|
|
1802
|
-
index += 1;
|
|
1803
|
-
continue;
|
|
1804
|
-
}
|
|
1805
|
-
filtered.push(args[index]);
|
|
1806
|
-
}
|
|
1807
|
-
return filtered;
|
|
1808
|
-
}
|
|
1809
|
-
function bundledOrizuGepaPythonPath() {
|
|
1810
|
-
const candidates = [
|
|
1811
|
-
fileURLToPath(new URL('../vendor/orizu-gepa-python/src', import.meta.url)),
|
|
1812
|
-
fileURLToPath(new URL('../../orizu-gepa-python/src', import.meta.url)),
|
|
1813
|
-
];
|
|
1814
|
-
return candidates.find(candidate => existsSync(candidate)) ?? null;
|
|
1815
|
-
}
|
|
1816
1787
|
async function runGepaOptimization() {
|
|
1817
1788
|
const project = getArg('--project') || await resolveProjectSlug(null);
|
|
1818
1789
|
const baseUrl = getBaseUrl();
|
|
1819
|
-
const
|
|
1820
|
-
const
|
|
1821
|
-
let forwardedArgs =
|
|
1790
|
+
const runGepa = getGepaPythonCommand(cliArgs.slice(2), process.env);
|
|
1791
|
+
const python = runGepa.python;
|
|
1792
|
+
let forwardedArgs = runGepa.args;
|
|
1822
1793
|
// ALI-1159 (ADR-007): GEPA executes ad-hoc local runner dirs while
|
|
1823
1794
|
// attributing records to registered runner version ids — verify the bytes
|
|
1824
1795
|
// ARE those versions before the optimizer spawns. Scans the forwarded argv
|
|
@@ -1828,6 +1799,7 @@ async function runGepaOptimization() {
|
|
|
1828
1799
|
const verified = await verifyGepaRunnerDirsFromArgs(forwardedArgs);
|
|
1829
1800
|
forwardedArgs = verified.args;
|
|
1830
1801
|
let result;
|
|
1802
|
+
let selectedEngine = 'official';
|
|
1831
1803
|
try {
|
|
1832
1804
|
// Uniform resolution (ALI-1090): honors ORIZU_TOKEN / ORIZU_TOKEN_FILE before
|
|
1833
1805
|
// credentials.json so hosted sandboxes can run optimizations. Read at spawn
|
|
@@ -1838,33 +1810,33 @@ async function runGepaOptimization() {
|
|
|
1838
1810
|
if (!forwardedArgs.includes('--project')) {
|
|
1839
1811
|
forwardedArgs = ['--project', project, ...forwardedArgs];
|
|
1840
1812
|
}
|
|
1841
|
-
const
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
ORIZU_API_URL: baseUrl,
|
|
1850
|
-
ORIZU_TOKEN: token,
|
|
1851
|
-
ORIZU_PROJECT: project,
|
|
1852
|
-
// Integrity handshake (ALI-1159): the Python entrypoint refuses
|
|
1853
|
-
// runner dirs that are not in this wrapper-verified list.
|
|
1854
|
-
ORIZU_VERIFIED_RUNNER_DIRS: JSON.stringify(verified.verifiedDirs),
|
|
1855
|
-
PYTHONPATH: pythonPathEntries.join(delimiter),
|
|
1856
|
-
PYTHONUNBUFFERED: process.env.PYTHONUNBUFFERED || '1',
|
|
1857
|
-
},
|
|
1813
|
+
const dispatch = dispatchGepaEngine(forwardedArgs, project, {
|
|
1814
|
+
...process.env,
|
|
1815
|
+
ORIZU_API_URL: baseUrl,
|
|
1816
|
+
ORIZU_TOKEN: token,
|
|
1817
|
+
ORIZU_PROJECT: project,
|
|
1818
|
+
ORIZU_VERIFIED_RUNNER_DIRS: JSON.stringify(verified.verifiedDirs),
|
|
1819
|
+
PYTHONPATH: getGepaPythonPathEntries(process.env.PYTHONPATH).join(delimiter),
|
|
1820
|
+
PYTHONUNBUFFERED: process.env.PYTHONUNBUFFERED || '1',
|
|
1858
1821
|
});
|
|
1822
|
+
const instructionSetName = dispatch.environment.ORIZU_INSTRUCTION_SET_NAME;
|
|
1823
|
+
const modelConfigIdentity = dispatch.environment.ORIZU_MODEL_CONFIG_IDENTITY;
|
|
1824
|
+
const instructionSetProfileVersionId = instructionSetName && modelConfigIdentity
|
|
1825
|
+
? await resolveGepaInstructionSetProfileVersion(instructionSetName, modelConfigIdentity, project) : undefined;
|
|
1826
|
+
if (instructionSetProfileVersionId)
|
|
1827
|
+
dispatch.environment.ORIZU_INSTRUCTION_SET_PROFILE_VERSION_ID = instructionSetProfileVersionId;
|
|
1828
|
+
selectedEngine = dispatch.engine;
|
|
1829
|
+
const launch = prepareSkilledProposerLaunch(python, dispatch.engine, dispatch.environment);
|
|
1830
|
+
result = spawnSync(launch.python, ['-m', dispatch.module, ...dispatch.args], { stdio: 'inherit', env: launch.environment });
|
|
1859
1831
|
}
|
|
1860
1832
|
finally {
|
|
1861
1833
|
verified.cleanup();
|
|
1862
1834
|
}
|
|
1863
1835
|
if (result.error) {
|
|
1864
|
-
throw result.error;
|
|
1836
|
+
throw new Error(`${selectedEngine} GEPA engine failed: ${result.error.message}`, { cause: result.error });
|
|
1865
1837
|
}
|
|
1866
1838
|
if (result.status !== 0) {
|
|
1867
|
-
throw new Error(
|
|
1839
|
+
throw new Error(`${selectedEngine} GEPA engine failed with exit code ${result.status}`);
|
|
1868
1840
|
}
|
|
1869
1841
|
if (hasJsonFlag()) {
|
|
1870
1842
|
printJson({ status: 'completed', exitCode: 0 });
|
|
@@ -4459,7 +4431,7 @@ async function downloadAnnotations() {
|
|
|
4459
4431
|
}
|
|
4460
4432
|
printLine(`Saved ${format.toUpperCase()} export to ${sanitizeTerminalText(filename)}`);
|
|
4461
4433
|
}
|
|
4462
|
-
function readRunnerManifest(runnerDir) {
|
|
4434
|
+
export function readRunnerManifest(runnerDir) {
|
|
4463
4435
|
const manifestPath = join(runnerDir, 'manifest.json');
|
|
4464
4436
|
const raw = readSourceFile(manifestPath);
|
|
4465
4437
|
const manifest = JSON.parse(raw);
|
|
@@ -4477,9 +4449,9 @@ function readRunnerManifest(runnerDir) {
|
|
|
4477
4449
|
supports_body_kind: supportedBodyKinds,
|
|
4478
4450
|
};
|
|
4479
4451
|
}
|
|
4480
|
-
const RUNNER_TIMEOUT_MS = 120_000;
|
|
4481
|
-
const RUNNER_OUTPUT_MAX_BYTES = 2 * 1024 * 1024;
|
|
4482
|
-
const RUNNER_ENV_ALLOWLIST = new Set([
|
|
4452
|
+
export const RUNNER_TIMEOUT_MS = 120_000;
|
|
4453
|
+
export const RUNNER_OUTPUT_MAX_BYTES = 2 * 1024 * 1024;
|
|
4454
|
+
export const RUNNER_ENV_ALLOWLIST = new Set([
|
|
4483
4455
|
'PATH',
|
|
4484
4456
|
'SystemRoot',
|
|
4485
4457
|
'WINDIR',
|
|
@@ -4496,7 +4468,7 @@ const RUNNER_ENV_ALLOWLIST = new Set([
|
|
|
4496
4468
|
'GEMINI_API_KEY',
|
|
4497
4469
|
'GOOGLE_API_KEY',
|
|
4498
4470
|
]);
|
|
4499
|
-
function runnerSubprocessEnv(inputPath, outputPath) {
|
|
4471
|
+
export function runnerSubprocessEnv(inputPath, outputPath, instructionSetDir) {
|
|
4500
4472
|
const env = {};
|
|
4501
4473
|
for (const key of RUNNER_ENV_ALLOWLIST) {
|
|
4502
4474
|
const value = process.env[key];
|
|
@@ -4506,6 +4478,9 @@ function runnerSubprocessEnv(inputPath, outputPath) {
|
|
|
4506
4478
|
}
|
|
4507
4479
|
env.ORIZU_RUNNER_INPUT_PATH = inputPath;
|
|
4508
4480
|
env.ORIZU_RUNNER_OUTPUT_PATH = outputPath;
|
|
4481
|
+
delete env.ORIZU_INSTRUCTION_SET_DIR;
|
|
4482
|
+
if (instructionSetDir)
|
|
4483
|
+
env.ORIZU_INSTRUCTION_SET_DIR = instructionSetDir;
|
|
4509
4484
|
return env;
|
|
4510
4485
|
}
|
|
4511
4486
|
function boundedRunnerOutput(value) {
|
|
@@ -4517,7 +4492,7 @@ function boundedRunnerOutput(value) {
|
|
|
4517
4492
|
}
|
|
4518
4493
|
return `${buffer.subarray(0, RUNNER_OUTPUT_MAX_BYTES).toString('utf8')}\n[truncated]`;
|
|
4519
4494
|
}
|
|
4520
|
-
async function materializeRunnerVersion(runnerVersionId) {
|
|
4495
|
+
export async function materializeRunnerVersion(runnerVersionId) {
|
|
4521
4496
|
const response = await authedFetch(`/api/cli/runner-versions/${encodeURIComponent(runnerVersionId)}/download`);
|
|
4522
4497
|
if (!response.ok) {
|
|
4523
4498
|
throw new Error(`Failed to download runner version: ${await response.text()}`);
|
|
@@ -4614,15 +4589,15 @@ async function runnersExec() {
|
|
|
4614
4589
|
const tempDir = mkdtempSync(join(tmpdir(), 'orizu-runner-'));
|
|
4615
4590
|
const inputPath = join(tempDir, 'input.json');
|
|
4616
4591
|
const outputPath = join(tempDir, 'output.json');
|
|
4592
|
+
const instructionSetDir = context.instructionSet ? join(tempDir, 'instruction-set') : undefined;
|
|
4617
4593
|
try {
|
|
4618
4594
|
const modelOutput = row.row.model_output ?? row.row.modelOutput ?? row.row.output ?? null;
|
|
4595
|
+
if (instructionSetDir && context.instructionSet)
|
|
4596
|
+
syncToDisk(instructionSetDir, runnerInstructionSetSyncSet(context.instructionSet));
|
|
4619
4597
|
writeFileSync(inputPath, JSON.stringify({
|
|
4620
4598
|
row: row.row,
|
|
4621
|
-
prompt:
|
|
4622
|
-
|
|
4623
|
-
body_kind: context.prompt.bodyKind,
|
|
4624
|
-
provider_settings: context.prompt.providerSettings,
|
|
4625
|
-
},
|
|
4599
|
+
prompt: runnerInputPrompt(context.prompt),
|
|
4600
|
+
...(context.instructionSet ? { instruction_set: runnerInputInstructionSet(context.instructionSet) } : {}),
|
|
4626
4601
|
subject: scorerVersion
|
|
4627
4602
|
? {
|
|
4628
4603
|
type: 'scorer_row',
|
|
@@ -4649,7 +4624,7 @@ async function runnersExec() {
|
|
|
4649
4624
|
}));
|
|
4650
4625
|
const result = spawnSync(manifest.command[0], manifest.command.slice(1), {
|
|
4651
4626
|
cwd: runnerDir,
|
|
4652
|
-
env: runnerSubprocessEnv(inputPath, outputPath),
|
|
4627
|
+
env: runnerSubprocessEnv(inputPath, outputPath, instructionSetDir),
|
|
4653
4628
|
encoding: 'utf8',
|
|
4654
4629
|
maxBuffer: RUNNER_OUTPUT_MAX_BYTES,
|
|
4655
4630
|
timeout: RUNNER_TIMEOUT_MS,
|
|
@@ -4845,8 +4820,11 @@ export async function main(rawArgs = process.argv.slice(2)) {
|
|
|
4845
4820
|
return;
|
|
4846
4821
|
}
|
|
4847
4822
|
if (command === 'prompts' && subcommand === 'push') {
|
|
4848
|
-
|
|
4849
|
-
|
|
4823
|
+
if (getArg('--session')) {
|
|
4824
|
+
await pushPromptArtifact('prompt');
|
|
4825
|
+
return;
|
|
4826
|
+
}
|
|
4827
|
+
refusePromptMutation('push <manifest> --project <team/project>');
|
|
4850
4828
|
}
|
|
4851
4829
|
if (command === 'prompts' && subcommand === 'report' &&
|
|
4852
4830
|
(cliArgs[2] === 'set' || cliArgs[2] === 'upload')) {
|
|
@@ -4856,15 +4834,23 @@ export async function main(rawArgs = process.argv.slice(2)) {
|
|
|
4856
4834
|
return;
|
|
4857
4835
|
}
|
|
4858
4836
|
if (command === 'prompts' && subcommand === 'archive') {
|
|
4859
|
-
|
|
4860
|
-
return;
|
|
4837
|
+
refusePromptMutation('archive <slug-or-exact-name> --project <team/project>');
|
|
4861
4838
|
}
|
|
4862
4839
|
if (command === 'prompts' && subcommand === 'restore') {
|
|
4863
|
-
|
|
4864
|
-
return;
|
|
4840
|
+
refusePromptMutation('restore <slug-or-exact-name> --project <team/project>');
|
|
4865
4841
|
}
|
|
4866
4842
|
if (command === 'prompts' && subcommand === 'labels' && cliArgs[2] === 'set') {
|
|
4867
|
-
|
|
4843
|
+
if (getPositionalArg(4) === 'production') {
|
|
4844
|
+
refusePromptMutation('profiles promote <set> --project <team/project> --model-config <identity> --version <n>');
|
|
4845
|
+
}
|
|
4846
|
+
await setPromptLabel({
|
|
4847
|
+
getArg,
|
|
4848
|
+
getPositionalArg,
|
|
4849
|
+
json: hasJsonFlag(),
|
|
4850
|
+
printJson,
|
|
4851
|
+
printLine,
|
|
4852
|
+
resolveProjectSlug,
|
|
4853
|
+
});
|
|
4868
4854
|
return;
|
|
4869
4855
|
}
|
|
4870
4856
|
if (command === 'prompts' && subcommand === 'scorers' && cliArgs[2] === 'set-headline') {
|
|
@@ -4905,25 +4891,20 @@ export async function main(rawArgs = process.argv.slice(2)) {
|
|
|
4905
4891
|
});
|
|
4906
4892
|
return;
|
|
4907
4893
|
}
|
|
4908
|
-
if (command === 'scorers'
|
|
4909
|
-
await
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
return;
|
|
4923
|
-
}
|
|
4924
|
-
if (command === 'scorers' && subcommand === 'exec') {
|
|
4925
|
-
await execScorer();
|
|
4926
|
-
return;
|
|
4894
|
+
if (command === 'scorers') {
|
|
4895
|
+
const scorersExit = await scorersCommand(cliArgs, {
|
|
4896
|
+
list: listScorers, register: registerScorer, detail: showScorerDetail,
|
|
4897
|
+
labelsSet: setScorerLabel, exec: execScorer,
|
|
4898
|
+
verifyParity: args => verifyScorerParityCommand(args, {
|
|
4899
|
+
json: hasJsonFlag(), print: printLine, printErr: printError,
|
|
4900
|
+
materializeRunnerVersion, readRunnerManifest, runnerSubprocessEnv,
|
|
4901
|
+
timeoutMs: RUNNER_TIMEOUT_MS, maxOutputBytes: RUNNER_OUTPUT_MAX_BYTES,
|
|
4902
|
+
}),
|
|
4903
|
+
});
|
|
4904
|
+
if (scorersExit !== null) {
|
|
4905
|
+
process.exitCode = scorersExit;
|
|
4906
|
+
return;
|
|
4907
|
+
}
|
|
4927
4908
|
}
|
|
4928
4909
|
if ((command === 'runners' || command === 'optimizers') && subcommand === 'push') {
|
|
4929
4910
|
await pushRunnerArtifact(command === 'runners' ? 'runner' : 'optimizer');
|
|
@@ -4975,6 +4956,12 @@ export async function main(rawArgs = process.argv.slice(2)) {
|
|
|
4975
4956
|
await listOptimizationRunsCommand(cliArgs.slice(2), { json: hasJsonFlag(), print: printLine, resolveProjectSlug });
|
|
4976
4957
|
return;
|
|
4977
4958
|
}
|
|
4959
|
+
if (command === 'optimizations' && subcommand === 'promote') {
|
|
4960
|
+
await promoteOptimizationCommand(cliArgs.slice(2), {
|
|
4961
|
+
json: hasJsonFlag(), print: printLine, resolveProjectSlug, fetcher: authedFetch,
|
|
4962
|
+
});
|
|
4963
|
+
return;
|
|
4964
|
+
}
|
|
4978
4965
|
if (command === 'optimizations' &&
|
|
4979
4966
|
(subcommand === 'pause' ||
|
|
4980
4967
|
subcommand === 'resume' ||
|
|
@@ -5141,9 +5128,12 @@ export async function main(rawArgs = process.argv.slice(2)) {
|
|
|
5141
5128
|
await runGithubLink(team, { print: printLine, fetcher: authedFetch, openUrl: openInBrowser, confirm: (org) => askYesNo(`Connect this team to GitHub org '${org}'?`, true) });
|
|
5142
5129
|
return;
|
|
5143
5130
|
}
|
|
5144
|
-
if (command === 'connectors' || command === 'manifests') {
|
|
5145
|
-
|
|
5146
|
-
|
|
5131
|
+
if (command === 'connectors' || command === 'manifests' || command === 'model-configs') {
|
|
5132
|
+
process.exitCode = await (command === 'connectors' ? connectorsCommand : command === 'manifests' ? manifestsCommand : modelConfigsCommand)(cliArgs.slice(1), { json: hasJsonFlag(), print: printLine, resolveProjectSlug });
|
|
5133
|
+
return;
|
|
5134
|
+
}
|
|
5135
|
+
if (command === 'instructions' || command === 'instruction-sets') {
|
|
5136
|
+
process.exitCode = await instructionSetsCommand(cliArgs.slice(1), { json: hasJsonFlag(), print: printLine, resolveProjectSlug });
|
|
5147
5137
|
return;
|
|
5148
5138
|
}
|
|
5149
5139
|
if (command === 'team' && (subcommand === 'kill-agents' || subcommand === 'release-agents')) {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Resolve the same production-or-default tuple served for a model identity. */
|
|
2
|
+
export declare function resolveGepaInstructionSetProfileVersion(instructionSetName: string, modelConfigIdentity: string, project: string): Promise<string>;
|
|
3
|
+
//# sourceMappingURL=instruction-set-gepa-launch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instruction-set-gepa-launch.d.ts","sourceRoot":"","sources":["../src/instruction-set-gepa-launch.ts"],"names":[],"mappings":"AAaA,gFAAgF;AAChF,wBAAsB,uCAAuC,CAC3D,kBAAkB,EAAE,MAAM,EAC1B,mBAAmB,EAAE,MAAM,EAC3B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CASjB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { authedFetch } from './http.js';
|
|
2
|
+
import { parseJsonResponse } from './json-response.js';
|
|
3
|
+
/** Resolve the same production-or-default tuple served for a model identity. */
|
|
4
|
+
export async function resolveGepaInstructionSetProfileVersion(instructionSetName, modelConfigIdentity, project) {
|
|
5
|
+
const response = await authedFetch(`/api/cli/instruction-sets/${encodeURIComponent(instructionSetName)}?project=${encodeURIComponent(project)}`);
|
|
6
|
+
if (!response.ok)
|
|
7
|
+
throw new Error(`Instruction set resolution failed: ${await response.text()}`);
|
|
8
|
+
const payload = await parseJsonResponse(response, 'Instruction set resolution');
|
|
9
|
+
const instructionSet = payload.instructionSet;
|
|
10
|
+
const profile = instructionSet?.profiles?.find(candidate => candidate.modelConfigIdentity === modelConfigIdentity);
|
|
11
|
+
const profileVersionId = profile?.production?.profileVersionId || instructionSet?.default?.profileVersionId;
|
|
12
|
+
if (!profileVersionId)
|
|
13
|
+
throw new Error('instruction_set_profile_version_unresolvable');
|
|
14
|
+
return profileVersionId;
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare class InstructionSetLoaderError extends Error {
|
|
2
|
+
readonly code: string;
|
|
3
|
+
constructor(code: string);
|
|
4
|
+
}
|
|
5
|
+
export declare function loadInstructionSet(directory: string, name: string, modelConfigIdentity: string): Record<string, string>;
|
|
6
|
+
//# sourceMappingURL=instruction-set-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instruction-set-loader.d.ts","sourceRoot":"","sources":["../src/instruction-set-loader.ts"],"names":[],"mappings":"AAGA,qBAAa,yBAA0B,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAClC;AAOD,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAwBvH"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { existsSync, realpathSync, readFileSync, statSync } from 'node:fs';
|
|
2
|
+
import { resolve, sep } from 'node:path';
|
|
3
|
+
export class InstructionSetLoaderError extends Error {
|
|
4
|
+
code;
|
|
5
|
+
constructor(code) {
|
|
6
|
+
super(code);
|
|
7
|
+
this.code = code;
|
|
8
|
+
this.name = 'InstructionSetLoaderError';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function inside(root, candidate) { return candidate === root || candidate.startsWith(`${root}${sep}`); }
|
|
12
|
+
export function loadInstructionSet(directory, name, modelConfigIdentity) {
|
|
13
|
+
const unresolvedRoot = resolve(directory, name);
|
|
14
|
+
if (!existsSync(unresolvedRoot) || !statSync(unresolvedRoot).isDirectory())
|
|
15
|
+
throw new InstructionSetLoaderError('instruction_set_not_synced');
|
|
16
|
+
const setRoot = realpathSync(unresolvedRoot);
|
|
17
|
+
const manifestPath = resolve(setRoot, 'manifest.json');
|
|
18
|
+
if (!existsSync(manifestPath))
|
|
19
|
+
throw new InstructionSetLoaderError('instruction_set_manifest_missing');
|
|
20
|
+
let manifest;
|
|
21
|
+
try {
|
|
22
|
+
manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
throw new InstructionSetLoaderError('instruction_set_manifest_missing');
|
|
26
|
+
}
|
|
27
|
+
if (manifest.manifestVersion !== 1)
|
|
28
|
+
throw new InstructionSetLoaderError('instruction_set_manifest_version_unsupported');
|
|
29
|
+
if (manifest.filteredTo && !manifest.filteredTo.includes(modelConfigIdentity))
|
|
30
|
+
throw new InstructionSetLoaderError('instruction_set_profile_not_synced');
|
|
31
|
+
const selected = manifest.profiles.find(profile => profile.modelConfigIdentity === modelConfigIdentity)?.production || manifest.default;
|
|
32
|
+
const result = {};
|
|
33
|
+
for (const key of manifest.shape) {
|
|
34
|
+
if (selected.pinnedComponents?.[key])
|
|
35
|
+
throw new InstructionSetLoaderError('instruction_set_component_unavailable');
|
|
36
|
+
const relativePath = selected.files?.[key];
|
|
37
|
+
if (!relativePath)
|
|
38
|
+
throw new InstructionSetLoaderError('instruction_set_profile_key_missing');
|
|
39
|
+
const unresolvedPath = resolve(setRoot, relativePath);
|
|
40
|
+
if (!inside(setRoot, unresolvedPath))
|
|
41
|
+
throw new InstructionSetLoaderError('instruction_set_path_unsafe');
|
|
42
|
+
let path;
|
|
43
|
+
try {
|
|
44
|
+
path = realpathSync(unresolvedPath);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
throw new InstructionSetLoaderError('instruction_set_component_unreadable');
|
|
48
|
+
}
|
|
49
|
+
if (!inside(setRoot, path))
|
|
50
|
+
throw new InstructionSetLoaderError('instruction_set_path_unsafe');
|
|
51
|
+
try {
|
|
52
|
+
result[key] = readFileSync(path, 'utf8');
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
throw new InstructionSetLoaderError('instruction_set_component_unreadable');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface InstructionSetComponent {
|
|
2
|
+
key: string;
|
|
3
|
+
modelConfig?: string;
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
6
|
+
export interface InstructionSetManifest {
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string | null;
|
|
9
|
+
shape: string[];
|
|
10
|
+
components: InstructionSetComponent[];
|
|
11
|
+
}
|
|
12
|
+
export declare const MAX_INSTRUCTION_SET_COMPONENT_BYTES: number;
|
|
13
|
+
export declare function loadInstructionSetManifest(path: string): InstructionSetManifest;
|
|
14
|
+
//# sourceMappingURL=instruction-set-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instruction-set-manifest.d.ts","sourceRoot":"","sources":["../src/instruction-set-manifest.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,uBAAuB;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AAC5F,MAAM,WAAW,sBAAsB;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,UAAU,EAAE,uBAAuB,EAAE,CAAA;CAAE;AAI7I,eAAO,MAAM,mCAAmC,QAAa,CAAA;AAW7D,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB,CAmG/E"}
|