@prismatic-io/lux 0.0.2-preview.3 → 0.0.2-preview.32
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/lib/answerers/claude-code/index.d.ts +15 -3
- package/lib/answerers/claude-code/index.d.ts.map +1 -1
- package/lib/answerers/claude-code/index.js +6 -5
- package/lib/answerers/claude-code/index.js.map +1 -1
- package/lib/answerers/persona/index.d.ts +44 -5
- package/lib/answerers/persona/index.d.ts.map +1 -1
- package/lib/answerers/persona/index.js +60 -34
- package/lib/answerers/persona/index.js.map +1 -1
- package/lib/answerers/terminal/index.d.ts +9 -3
- package/lib/answerers/terminal/index.d.ts.map +1 -1
- package/lib/answerers/terminal/index.js +7 -5
- package/lib/answerers/terminal/index.js.map +1 -1
- package/lib/assertions/authoring.d.ts +2 -2
- package/lib/assertions/authoring.d.ts.map +1 -1
- package/lib/assertions/authoring.js.map +1 -1
- package/lib/assertions/core/command-exits-zero.d.ts +4 -1
- package/lib/assertions/core/command-exits-zero.d.ts.map +1 -1
- package/lib/assertions/core/command-exits-zero.js +50 -7
- package/lib/assertions/core/command-exits-zero.js.map +1 -1
- package/lib/assertions/core/event-checks.d.ts +3 -0
- package/lib/assertions/core/event-checks.d.ts.map +1 -1
- package/lib/assertions/core/event-checks.js +49 -3
- package/lib/assertions/core/event-checks.js.map +1 -1
- package/lib/assertions/core/file-checks.d.ts +6 -0
- package/lib/assertions/core/file-checks.d.ts.map +1 -1
- package/lib/assertions/core/helpers.d.ts +2 -7
- package/lib/assertions/core/helpers.d.ts.map +1 -1
- package/lib/assertions/core/helpers.js +2 -6
- package/lib/assertions/core/helpers.js.map +1 -1
- package/lib/assertions/core/index.d.ts.map +1 -1
- package/lib/assertions/core/index.js +2 -1
- package/lib/assertions/core/index.js.map +1 -1
- package/lib/assertions/core/json-pointer-equals.d.ts +1 -0
- package/lib/assertions/core/json-pointer-equals.d.ts.map +1 -1
- package/lib/assertions/core/output-checks.d.ts +3 -0
- package/lib/assertions/core/output-checks.d.ts.map +1 -1
- package/lib/assertions/core/predicate.d.ts +1 -0
- package/lib/assertions/core/predicate.d.ts.map +1 -1
- package/lib/assertions/core/resource-checks.d.ts +25 -0
- package/lib/assertions/core/resource-checks.d.ts.map +1 -1
- package/lib/assertions/core/resource-checks.js +35 -5
- package/lib/assertions/core/resource-checks.js.map +1 -1
- package/lib/assertions/rubric/index.d.ts +28 -3
- package/lib/assertions/rubric/index.d.ts.map +1 -1
- package/lib/assertions/rubric/index.js +59 -13
- package/lib/assertions/rubric/index.js.map +1 -1
- package/lib/assertions/rubric/internal.d.ts +30 -5
- package/lib/assertions/rubric/internal.d.ts.map +1 -1
- package/lib/assertions/rubric/internal.js +181 -28
- package/lib/assertions/rubric/internal.js.map +1 -1
- package/lib/authoring.d.ts +36 -2
- package/lib/authoring.d.ts.map +1 -1
- package/lib/authoring.js +36 -1
- package/lib/authoring.js.map +1 -1
- package/lib/cli/bin.js +2 -13
- package/lib/cli/bin.js.map +1 -1
- package/lib/cli/command-runtime.d.ts +3 -3
- package/lib/cli/command-runtime.d.ts.map +1 -1
- package/lib/cli/command-runtime.js +17 -6
- package/lib/cli/command-runtime.js.map +1 -1
- package/lib/cli/doctor.d.ts +55 -0
- package/lib/cli/doctor.d.ts.map +1 -0
- package/lib/cli/doctor.js +14 -0
- package/lib/cli/doctor.js.map +1 -0
- package/lib/cli/harness-plan.d.ts +26 -0
- package/lib/cli/harness-plan.d.ts.map +1 -0
- package/lib/cli/harness-plan.js +75 -0
- package/lib/cli/harness-plan.js.map +1 -0
- package/lib/cli/init-templates.d.ts +11 -0
- package/lib/cli/init-templates.d.ts.map +1 -0
- package/lib/cli/init-templates.js +215 -0
- package/lib/cli/init-templates.js.map +1 -0
- package/lib/cli/init.d.ts +10 -0
- package/lib/cli/init.d.ts.map +1 -1
- package/lib/cli/init.js +34 -173
- package/lib/cli/init.js.map +1 -1
- package/lib/cli/output-schemas.d.ts +1408 -0
- package/lib/cli/output-schemas.d.ts.map +1 -0
- package/lib/cli/output-schemas.js +91 -0
- package/lib/cli/output-schemas.js.map +1 -0
- package/lib/cli/program.d.ts +140 -12
- package/lib/cli/program.d.ts.map +1 -1
- package/lib/cli/program.js +779 -646
- package/lib/cli/program.js.map +1 -1
- package/lib/cli/render/reporter.d.ts.map +1 -1
- package/lib/cli/render/reporter.js +48 -8
- package/lib/cli/render/reporter.js.map +1 -1
- package/lib/cli/run-options.d.ts +20 -4
- package/lib/cli/run-options.d.ts.map +1 -1
- package/lib/cli/run-options.js +100 -19
- package/lib/cli/run-options.js.map +1 -1
- package/lib/cli/view.d.ts +15 -0
- package/lib/cli/view.d.ts.map +1 -0
- package/lib/cli/view.js +168 -0
- package/lib/cli/view.js.map +1 -0
- package/lib/container/driver.d.ts +27 -0
- package/lib/container/driver.d.ts.map +1 -0
- package/lib/container/driver.js +197 -0
- package/lib/container/driver.js.map +1 -0
- package/lib/container/protocol.d.ts +12 -0
- package/lib/container/protocol.d.ts.map +1 -0
- package/lib/container/protocol.js +38 -0
- package/lib/container/protocol.js.map +1 -0
- package/lib/container/resources.d.ts +12 -0
- package/lib/container/resources.d.ts.map +1 -0
- package/lib/container/resources.js +133 -0
- package/lib/container/resources.js.map +1 -0
- package/lib/container/worker.d.ts +2 -0
- package/lib/container/worker.d.ts.map +1 -0
- package/lib/container/worker.js +85 -0
- package/lib/container/worker.js.map +1 -0
- package/lib/core/action-events.d.ts +29 -0
- package/lib/core/action-events.d.ts.map +1 -0
- package/lib/core/action-events.js +51 -0
- package/lib/core/action-events.js.map +1 -0
- package/lib/core/agent-activity.d.ts +49 -0
- package/lib/core/agent-activity.d.ts.map +1 -0
- package/lib/core/agent-activity.js +206 -0
- package/lib/core/agent-activity.js.map +1 -0
- package/lib/core/agent-environment.d.ts +5 -0
- package/lib/core/agent-environment.d.ts.map +1 -0
- package/lib/core/agent-environment.js +47 -0
- package/lib/core/agent-environment.js.map +1 -0
- package/lib/core/agent-events.d.ts +26 -0
- package/lib/core/agent-events.d.ts.map +1 -0
- package/lib/core/agent-events.js +13 -0
- package/lib/core/agent-events.js.map +1 -0
- package/lib/core/annotation.d.ts +6 -2
- package/lib/core/annotation.d.ts.map +1 -1
- package/lib/core/annotation.js +2 -1
- package/lib/core/annotation.js.map +1 -1
- package/lib/core/answerer.d.ts +12 -0
- package/lib/core/answerer.d.ts.map +1 -1
- package/lib/core/answerer.js +2 -0
- package/lib/core/answerer.js.map +1 -1
- package/lib/core/artifact-evidence.d.ts +8 -0
- package/lib/core/artifact-evidence.d.ts.map +1 -1
- package/lib/core/artifact-evidence.js +36 -4
- package/lib/core/artifact-evidence.js.map +1 -1
- package/lib/core/assertion.d.ts +20 -2
- package/lib/core/assertion.d.ts.map +1 -1
- package/lib/core/assertion.js +19 -1
- package/lib/core/assertion.js.map +1 -1
- package/lib/core/case.d.ts +111 -3
- package/lib/core/case.d.ts.map +1 -1
- package/lib/core/case.js +17 -2
- package/lib/core/case.js.map +1 -1
- package/lib/core/command-verification.d.ts +10 -0
- package/lib/core/command-verification.d.ts.map +1 -0
- package/lib/core/command-verification.js +66 -0
- package/lib/core/command-verification.js.map +1 -0
- package/lib/core/driver-execution.d.ts +83 -0
- package/lib/core/driver-execution.d.ts.map +1 -0
- package/lib/core/driver-execution.js +72 -0
- package/lib/core/driver-execution.js.map +1 -0
- package/lib/core/driver-metrics.d.ts +98 -0
- package/lib/core/driver-metrics.d.ts.map +1 -0
- package/lib/core/driver-metrics.js +36 -0
- package/lib/core/driver-metrics.js.map +1 -0
- package/lib/core/driver.d.ts +64 -0
- package/lib/core/driver.d.ts.map +1 -1
- package/lib/core/driver.js +28 -0
- package/lib/core/driver.js.map +1 -1
- package/lib/core/duration.d.ts +5 -0
- package/lib/core/duration.d.ts.map +1 -0
- package/lib/core/duration.js +49 -0
- package/lib/core/duration.js.map +1 -0
- package/lib/core/environment.d.ts +18 -0
- package/lib/core/environment.d.ts.map +1 -0
- package/lib/core/environment.js +21 -0
- package/lib/core/environment.js.map +1 -0
- package/lib/core/evaluation-clusters.d.ts +17 -0
- package/lib/core/evaluation-clusters.d.ts.map +1 -0
- package/lib/core/evaluation-clusters.js +23 -0
- package/lib/core/evaluation-clusters.js.map +1 -0
- package/lib/core/events.d.ts +36 -0
- package/lib/core/events.d.ts.map +1 -1
- package/lib/core/events.js +12 -2
- package/lib/core/events.js.map +1 -1
- package/lib/core/experiment.d.ts +32 -2
- package/lib/core/experiment.d.ts.map +1 -1
- package/lib/core/experiment.js +35 -18
- package/lib/core/experiment.js.map +1 -1
- package/lib/core/file-tree.d.ts +7 -0
- package/lib/core/file-tree.d.ts.map +1 -0
- package/lib/core/file-tree.js +35 -0
- package/lib/core/file-tree.js.map +1 -0
- package/lib/core/global-id.d.ts +6 -0
- package/lib/core/global-id.d.ts.map +1 -0
- package/lib/core/global-id.js +17 -0
- package/lib/core/global-id.js.map +1 -0
- package/lib/core/harness-catalog.d.ts +35 -0
- package/lib/core/harness-catalog.d.ts.map +1 -0
- package/lib/core/harness-catalog.js +45 -0
- package/lib/core/harness-catalog.js.map +1 -0
- package/lib/core/harness-catalogs/antigravity.d.ts +11 -0
- package/lib/core/harness-catalogs/antigravity.d.ts.map +1 -0
- package/lib/core/harness-catalogs/antigravity.js +23 -0
- package/lib/core/harness-catalogs/antigravity.js.map +1 -0
- package/lib/core/harness-catalogs/claude-code.d.ts +12 -0
- package/lib/core/harness-catalogs/claude-code.d.ts.map +1 -0
- package/lib/core/harness-catalogs/claude-code.js +24 -0
- package/lib/core/harness-catalogs/claude-code.js.map +1 -0
- package/lib/core/harness-catalogs/codex.d.ts +11 -0
- package/lib/core/harness-catalogs/codex.d.ts.map +1 -0
- package/lib/core/harness-catalogs/codex.js +26 -0
- package/lib/core/harness-catalogs/codex.js.map +1 -0
- package/lib/core/harness-catalogs/copilot.d.ts +29 -0
- package/lib/core/harness-catalogs/copilot.d.ts.map +1 -0
- package/lib/core/harness-catalogs/copilot.js +45 -0
- package/lib/core/harness-catalogs/copilot.js.map +1 -0
- package/lib/core/harness-catalogs/cursor.d.ts +2 -0
- package/lib/core/harness-catalogs/cursor.d.ts.map +1 -0
- package/lib/core/harness-catalogs/cursor.js +13 -0
- package/lib/core/harness-catalogs/cursor.js.map +1 -0
- package/lib/core/harness-catalogs/grok-build.d.ts +7 -0
- package/lib/core/harness-catalogs/grok-build.d.ts.map +1 -0
- package/lib/core/harness-catalogs/grok-build.js +18 -0
- package/lib/core/harness-catalogs/grok-build.js.map +1 -0
- package/lib/core/harness-catalogs/index.d.ts +73 -0
- package/lib/core/harness-catalogs/index.d.ts.map +1 -0
- package/lib/core/harness-catalogs/index.js +17 -0
- package/lib/core/harness-catalogs/index.js.map +1 -0
- package/lib/core/harness-matrix.d.ts +154 -0
- package/lib/core/harness-matrix.d.ts.map +1 -0
- package/lib/core/harness-matrix.js +204 -0
- package/lib/core/harness-matrix.js.map +1 -0
- package/lib/core/index.d.ts +12 -0
- package/lib/core/index.d.ts.map +1 -1
- package/lib/core/index.js +12 -0
- package/lib/core/index.js.map +1 -1
- package/lib/core/lifecycle-fixtures.d.ts.map +1 -1
- package/lib/core/lifecycle-fixtures.js +4 -2
- package/lib/core/lifecycle-fixtures.js.map +1 -1
- package/lib/core/model-cli.d.ts +9 -11
- package/lib/core/model-cli.d.ts.map +1 -1
- package/lib/core/model-cli.js +31 -19
- package/lib/core/model-cli.js.map +1 -1
- package/lib/core/platform-process.d.ts +6 -1
- package/lib/core/platform-process.d.ts.map +1 -1
- package/lib/core/platform-process.js +49 -11
- package/lib/core/platform-process.js.map +1 -1
- package/lib/core/rubric.d.ts +1 -0
- package/lib/core/rubric.d.ts.map +1 -1
- package/lib/core/run.d.ts +293 -1
- package/lib/core/run.d.ts.map +1 -1
- package/lib/core/run.js +27 -0
- package/lib/core/run.js.map +1 -1
- package/lib/core/secure-copy.d.ts.map +1 -0
- package/lib/core/secure-copy.js.map +1 -0
- package/lib/core/usage.d.ts +5 -0
- package/lib/core/usage.d.ts.map +1 -1
- package/lib/core/usage.js +3 -0
- package/lib/core/usage.js.map +1 -1
- package/lib/core/wire.d.ts +12 -0
- package/lib/core/wire.d.ts.map +1 -1
- package/lib/core/wire.js +5 -1
- package/lib/core/wire.js.map +1 -1
- package/lib/drivers/antigravity/artifacts.d.ts +2 -0
- package/lib/drivers/antigravity/artifacts.d.ts.map +1 -0
- package/lib/drivers/antigravity/artifacts.js +33 -0
- package/lib/drivers/antigravity/artifacts.js.map +1 -0
- package/lib/drivers/antigravity/config.d.ts +88 -0
- package/lib/drivers/antigravity/config.d.ts.map +1 -0
- package/lib/drivers/antigravity/config.js +87 -0
- package/lib/drivers/antigravity/config.js.map +1 -0
- package/lib/drivers/antigravity/events.d.ts +4 -0
- package/lib/drivers/antigravity/events.d.ts.map +1 -0
- package/lib/drivers/antigravity/events.js +241 -0
- package/lib/drivers/antigravity/events.js.map +1 -0
- package/lib/drivers/antigravity/index.d.ts +114 -0
- package/lib/drivers/antigravity/index.d.ts.map +1 -0
- package/lib/drivers/antigravity/index.js +113 -0
- package/lib/drivers/antigravity/index.js.map +1 -0
- package/lib/drivers/antigravity/runtime.d.ts +7 -0
- package/lib/drivers/antigravity/runtime.d.ts.map +1 -0
- package/lib/drivers/antigravity/runtime.js +83 -0
- package/lib/drivers/antigravity/runtime.js.map +1 -0
- package/lib/drivers/claude-code/deferred-process.d.ts +17 -0
- package/lib/drivers/claude-code/deferred-process.d.ts.map +1 -0
- package/lib/drivers/claude-code/deferred-process.js +108 -0
- package/lib/drivers/claude-code/deferred-process.js.map +1 -0
- package/lib/drivers/claude-code/index.d.ts +180 -10
- package/lib/drivers/claude-code/index.d.ts.map +1 -1
- package/lib/drivers/claude-code/index.js +186 -252
- package/lib/drivers/claude-code/index.js.map +1 -1
- package/lib/drivers/claude-code/isolation.d.ts +8 -0
- package/lib/drivers/claude-code/isolation.d.ts.map +1 -0
- package/lib/drivers/claude-code/isolation.js +199 -0
- package/lib/drivers/claude-code/isolation.js.map +1 -0
- package/lib/drivers/claude-code/parse-events.d.ts.map +1 -1
- package/lib/drivers/claude-code/parse-events.js +73 -8
- package/lib/drivers/claude-code/parse-events.js.map +1 -1
- package/lib/drivers/codex/app-events.d.ts +9 -2
- package/lib/drivers/codex/app-events.d.ts.map +1 -1
- package/lib/drivers/codex/app-events.js +104 -12
- package/lib/drivers/codex/app-events.js.map +1 -1
- package/lib/drivers/codex/config.d.ts +66 -5
- package/lib/drivers/codex/config.d.ts.map +1 -1
- package/lib/drivers/codex/config.js +39 -8
- package/lib/drivers/codex/config.js.map +1 -1
- package/lib/drivers/codex/exec-events.d.ts +4 -0
- package/lib/drivers/codex/exec-events.d.ts.map +1 -0
- package/lib/drivers/codex/exec-events.js +230 -0
- package/lib/drivers/codex/exec-events.js.map +1 -0
- package/lib/drivers/codex/index.d.ts +138 -4
- package/lib/drivers/codex/index.d.ts.map +1 -1
- package/lib/drivers/codex/index.js +112 -276
- package/lib/drivers/codex/index.js.map +1 -1
- package/lib/drivers/copilot/config.d.ts +84 -0
- package/lib/drivers/copilot/config.d.ts.map +1 -0
- package/lib/drivers/copilot/config.js +57 -0
- package/lib/drivers/copilot/config.js.map +1 -0
- package/lib/drivers/copilot/index.d.ts +107 -0
- package/lib/drivers/copilot/index.d.ts.map +1 -0
- package/lib/drivers/copilot/index.js +268 -0
- package/lib/drivers/copilot/index.js.map +1 -0
- package/lib/drivers/cursor/config.d.ts +28 -0
- package/lib/drivers/cursor/config.d.ts.map +1 -0
- package/lib/drivers/cursor/config.js +28 -0
- package/lib/drivers/cursor/config.js.map +1 -0
- package/lib/drivers/cursor/index.d.ts +44 -0
- package/lib/drivers/cursor/index.d.ts.map +1 -0
- package/lib/drivers/cursor/index.js +286 -0
- package/lib/drivers/cursor/index.js.map +1 -0
- package/lib/drivers/cursor/interaction.d.ts +6 -0
- package/lib/drivers/cursor/interaction.d.ts.map +1 -0
- package/lib/drivers/cursor/interaction.js +55 -0
- package/lib/drivers/cursor/interaction.js.map +1 -0
- package/lib/drivers/grok-build/config.d.ts +68 -0
- package/lib/drivers/grok-build/config.d.ts.map +1 -0
- package/lib/drivers/grok-build/config.js +40 -0
- package/lib/drivers/grok-build/config.js.map +1 -0
- package/lib/drivers/grok-build/index.d.ts +87 -0
- package/lib/drivers/grok-build/index.d.ts.map +1 -0
- package/lib/drivers/grok-build/index.js +293 -0
- package/lib/drivers/grok-build/index.js.map +1 -0
- package/lib/drivers/mcp/index.d.ts +37 -4
- package/lib/drivers/mcp/index.d.ts.map +1 -1
- package/lib/drivers/mcp/index.js +25 -11
- package/lib/drivers/mcp/index.js.map +1 -1
- package/lib/drivers/shared/acp-events.d.ts +15 -0
- package/lib/drivers/shared/acp-events.d.ts.map +1 -0
- package/lib/drivers/shared/acp-events.js +83 -0
- package/lib/drivers/shared/acp-events.js.map +1 -0
- package/lib/drivers/shared/acp-interaction.d.ts +7 -0
- package/lib/drivers/shared/acp-interaction.d.ts.map +1 -0
- package/lib/drivers/shared/acp-interaction.js +20 -0
- package/lib/drivers/shared/acp-interaction.js.map +1 -0
- package/lib/drivers/shared/acp-session.d.ts +4 -0
- package/lib/drivers/shared/acp-session.d.ts.map +1 -0
- package/lib/drivers/shared/acp-session.js +23 -0
- package/lib/drivers/shared/acp-session.js.map +1 -0
- package/lib/drivers/shared/acp-transport.d.ts +40 -0
- package/lib/drivers/shared/acp-transport.d.ts.map +1 -0
- package/lib/drivers/shared/acp-transport.js +152 -0
- package/lib/drivers/shared/acp-transport.js.map +1 -0
- package/lib/drivers/shared/artifacts.d.ts.map +1 -1
- package/lib/drivers/shared/artifacts.js +3 -2
- package/lib/drivers/shared/artifacts.js.map +1 -1
- package/lib/drivers/shared/experiment-behavior.d.ts +13 -0
- package/lib/drivers/shared/experiment-behavior.d.ts.map +1 -0
- package/lib/drivers/shared/experiment-behavior.js +197 -0
- package/lib/drivers/shared/experiment-behavior.js.map +1 -0
- package/lib/drivers/shared/experiment-policy.d.ts +4 -0
- package/lib/drivers/shared/experiment-policy.d.ts.map +1 -0
- package/lib/drivers/shared/experiment-policy.js +143 -0
- package/lib/drivers/shared/experiment-policy.js.map +1 -0
- package/lib/drivers/subprocess/index.d.ts +39 -4
- package/lib/drivers/subprocess/index.d.ts.map +1 -1
- package/lib/drivers/subprocess/index.js +56 -12
- package/lib/drivers/subprocess/index.js.map +1 -1
- package/lib/index.d.ts +22 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +20 -6
- package/lib/index.js.map +1 -1
- package/lib/optimization/reflective.d.ts +3 -1
- package/lib/optimization/reflective.d.ts.map +1 -1
- package/lib/optimization/reflective.js +3 -2
- package/lib/optimization/reflective.js.map +1 -1
- package/lib/orchestrator/annotation-loader.d.ts +6 -2
- package/lib/orchestrator/annotation-loader.d.ts.map +1 -1
- package/lib/orchestrator/annotation-loader.js +8 -0
- package/lib/orchestrator/annotation-loader.js.map +1 -1
- package/lib/orchestrator/annotation-store.d.ts.map +1 -1
- package/lib/orchestrator/annotation-store.js +16 -2
- package/lib/orchestrator/annotation-store.js.map +1 -1
- package/lib/orchestrator/artifact-origin.d.ts +3 -0
- package/lib/orchestrator/artifact-origin.d.ts.map +1 -0
- package/lib/orchestrator/artifact-origin.js +40 -0
- package/lib/orchestrator/artifact-origin.js.map +1 -0
- package/lib/orchestrator/campaign-lifecycle.d.ts +1 -0
- package/lib/orchestrator/campaign-lifecycle.d.ts.map +1 -1
- package/lib/orchestrator/campaign-lifecycle.js +4 -1
- package/lib/orchestrator/campaign-lifecycle.js.map +1 -1
- package/lib/orchestrator/candidates.d.ts.map +1 -1
- package/lib/orchestrator/candidates.js +3 -2
- package/lib/orchestrator/candidates.js.map +1 -1
- package/lib/orchestrator/compare.d.ts +19 -3
- package/lib/orchestrator/compare.d.ts.map +1 -1
- package/lib/orchestrator/compare.js +32 -6
- package/lib/orchestrator/compare.js.map +1 -1
- package/lib/orchestrator/comparison-identity.d.ts.map +1 -1
- package/lib/orchestrator/comparison-identity.js +2 -0
- package/lib/orchestrator/comparison-identity.js.map +1 -1
- package/lib/orchestrator/config.d.ts +179 -1
- package/lib/orchestrator/config.d.ts.map +1 -1
- package/lib/orchestrator/config.js +18 -4
- package/lib/orchestrator/config.js.map +1 -1
- package/lib/orchestrator/discover.d.ts +1 -0
- package/lib/orchestrator/discover.d.ts.map +1 -1
- package/lib/orchestrator/discover.js +7 -1
- package/lib/orchestrator/discover.js.map +1 -1
- package/lib/orchestrator/doctor.d.ts +1 -0
- package/lib/orchestrator/doctor.d.ts.map +1 -1
- package/lib/orchestrator/doctor.js +121 -33
- package/lib/orchestrator/doctor.js.map +1 -1
- package/lib/orchestrator/driver-capabilities.d.ts +4 -0
- package/lib/orchestrator/driver-capabilities.d.ts.map +1 -0
- package/lib/orchestrator/driver-capabilities.js +13 -0
- package/lib/orchestrator/driver-capabilities.js.map +1 -0
- package/lib/orchestrator/driver-identity.d.ts +5 -0
- package/lib/orchestrator/driver-identity.d.ts.map +1 -0
- package/lib/orchestrator/driver-identity.js +51 -0
- package/lib/orchestrator/driver-identity.js.map +1 -0
- package/lib/orchestrator/experiment-context.d.ts +51 -3
- package/lib/orchestrator/experiment-context.d.ts.map +1 -1
- package/lib/orchestrator/experiment-context.js.map +1 -1
- package/lib/orchestrator/experiment-contracts.d.ts +30 -1
- package/lib/orchestrator/experiment-contracts.d.ts.map +1 -1
- package/lib/orchestrator/experiment-corpus.d.ts +2 -1
- package/lib/orchestrator/experiment-corpus.d.ts.map +1 -1
- package/lib/orchestrator/experiment-corpus.js +28 -22
- package/lib/orchestrator/experiment-corpus.js.map +1 -1
- package/lib/orchestrator/experiment-effects.d.ts +33 -0
- package/lib/orchestrator/experiment-effects.d.ts.map +1 -0
- package/lib/orchestrator/experiment-effects.js +44 -0
- package/lib/orchestrator/experiment-effects.js.map +1 -0
- package/lib/orchestrator/experiment-evaluation.d.ts.map +1 -1
- package/lib/orchestrator/experiment-evaluation.js +56 -5
- package/lib/orchestrator/experiment-evaluation.js.map +1 -1
- package/lib/orchestrator/experiment-identity.d.ts +3 -0
- package/lib/orchestrator/experiment-identity.d.ts.map +1 -1
- package/lib/orchestrator/experiment-identity.js +22 -33
- package/lib/orchestrator/experiment-identity.js.map +1 -1
- package/lib/orchestrator/experiment-loader.d.ts +8 -3
- package/lib/orchestrator/experiment-loader.d.ts.map +1 -1
- package/lib/orchestrator/experiment-preflight.d.ts +3 -0
- package/lib/orchestrator/experiment-preflight.d.ts.map +1 -0
- package/lib/orchestrator/experiment-preflight.js +21 -0
- package/lib/orchestrator/experiment-preflight.js.map +1 -0
- package/lib/orchestrator/experiment-report.d.ts +90 -1
- package/lib/orchestrator/experiment-report.d.ts.map +1 -1
- package/lib/orchestrator/experiment-report.js +9 -1
- package/lib/orchestrator/experiment-report.js.map +1 -1
- package/lib/orchestrator/experiment-runs.d.ts +61 -2
- package/lib/orchestrator/experiment-runs.d.ts.map +1 -1
- package/lib/orchestrator/experiment-runs.js +13 -5
- package/lib/orchestrator/experiment-runs.js.map +1 -1
- package/lib/orchestrator/experiment-runtime-identity.d.ts +0 -16
- package/lib/orchestrator/experiment-runtime-identity.d.ts.map +1 -1
- package/lib/orchestrator/experiment-runtime-identity.js +5 -220
- package/lib/orchestrator/experiment-runtime-identity.js.map +1 -1
- package/lib/orchestrator/experiment-selection.d.ts.map +1 -1
- package/lib/orchestrator/experiment-selection.js +52 -0
- package/lib/orchestrator/experiment-selection.js.map +1 -1
- package/lib/orchestrator/experiment.d.ts +3 -3
- package/lib/orchestrator/experiment.d.ts.map +1 -1
- package/lib/orchestrator/experiment.js +26 -21
- package/lib/orchestrator/experiment.js.map +1 -1
- package/lib/orchestrator/fixture-identity.d.ts +1 -0
- package/lib/orchestrator/fixture-identity.d.ts.map +1 -1
- package/lib/orchestrator/fixture-identity.js +6 -1
- package/lib/orchestrator/fixture-identity.js.map +1 -1
- package/lib/orchestrator/fs-read.d.ts +1 -6
- package/lib/orchestrator/fs-read.d.ts.map +1 -1
- package/lib/orchestrator/fs-read.js +2 -32
- package/lib/orchestrator/fs-read.js.map +1 -1
- package/lib/orchestrator/grader-experiment.d.ts +33 -3
- package/lib/orchestrator/grader-experiment.d.ts.map +1 -1
- package/lib/orchestrator/grader-experiment.js +54 -9
- package/lib/orchestrator/grader-experiment.js.map +1 -1
- package/lib/orchestrator/grading.d.ts +2 -1
- package/lib/orchestrator/grading.d.ts.map +1 -1
- package/lib/orchestrator/grading.js +46 -31
- package/lib/orchestrator/grading.js.map +1 -1
- package/lib/orchestrator/harness-catalog-drift.d.ts +22 -0
- package/lib/orchestrator/harness-catalog-drift.d.ts.map +1 -0
- package/lib/orchestrator/harness-catalog-drift.js +90 -0
- package/lib/orchestrator/harness-catalog-drift.js.map +1 -0
- package/lib/orchestrator/harness-registry.d.ts +4 -0
- package/lib/orchestrator/harness-registry.d.ts.map +1 -0
- package/lib/orchestrator/harness-registry.js +5 -0
- package/lib/orchestrator/harness-registry.js.map +1 -0
- package/lib/orchestrator/index.d.ts +1 -1
- package/lib/orchestrator/index.d.ts.map +1 -1
- package/lib/orchestrator/index.js +1 -1
- package/lib/orchestrator/index.js.map +1 -1
- package/lib/orchestrator/list-runs.d.ts +8 -1
- package/lib/orchestrator/list-runs.d.ts.map +1 -1
- package/lib/orchestrator/list-runs.js +81 -14
- package/lib/orchestrator/list-runs.js.map +1 -1
- package/lib/orchestrator/optimization-lifecycle.d.ts.map +1 -1
- package/lib/orchestrator/optimization-lifecycle.js +3 -1
- package/lib/orchestrator/optimization-lifecycle.js.map +1 -1
- package/lib/orchestrator/orchestrator.d.ts +18 -2
- package/lib/orchestrator/orchestrator.d.ts.map +1 -1
- package/lib/orchestrator/orchestrator.js +50 -168
- package/lib/orchestrator/orchestrator.js.map +1 -1
- package/lib/orchestrator/paired-effects.d.ts +34 -0
- package/lib/orchestrator/paired-effects.d.ts.map +1 -0
- package/lib/orchestrator/paired-effects.js +158 -0
- package/lib/orchestrator/paired-effects.js.map +1 -0
- package/lib/orchestrator/provenance.d.ts +5 -1
- package/lib/orchestrator/provenance.d.ts.map +1 -1
- package/lib/orchestrator/provenance.js +16 -3
- package/lib/orchestrator/provenance.js.map +1 -1
- package/lib/orchestrator/regrade.d.ts +9 -1
- package/lib/orchestrator/regrade.d.ts.map +1 -1
- package/lib/orchestrator/rubric-loader.js +1 -1
- package/lib/orchestrator/rubric-loader.js.map +1 -1
- package/lib/orchestrator/run-dir.d.ts +2 -0
- package/lib/orchestrator/run-dir.d.ts.map +1 -1
- package/lib/orchestrator/run-dir.js +1 -1
- package/lib/orchestrator/run-dir.js.map +1 -1
- package/lib/orchestrator/run-execution.d.ts +3 -0
- package/lib/orchestrator/run-execution.d.ts.map +1 -1
- package/lib/orchestrator/run-execution.js +66 -12
- package/lib/orchestrator/run-execution.js.map +1 -1
- package/lib/orchestrator/run-lifecycle.d.ts +1 -0
- package/lib/orchestrator/run-lifecycle.d.ts.map +1 -1
- package/lib/orchestrator/run-lifecycle.js +3 -2
- package/lib/orchestrator/run-lifecycle.js.map +1 -1
- package/lib/orchestrator/run-workspace.d.ts +10 -0
- package/lib/orchestrator/run-workspace.d.ts.map +1 -0
- package/lib/orchestrator/run-workspace.js +58 -0
- package/lib/orchestrator/run-workspace.js.map +1 -0
- package/lib/orchestrator/suite-compare.d.ts +37 -0
- package/lib/orchestrator/suite-compare.d.ts.map +1 -1
- package/lib/orchestrator/suite-compare.js +27 -17
- package/lib/orchestrator/suite-compare.js.map +1 -1
- package/lib/orchestrator/suite-runs.d.ts +6 -1
- package/lib/orchestrator/suite-runs.d.ts.map +1 -1
- package/lib/orchestrator/suite-runs.js +14 -2
- package/lib/orchestrator/suite-runs.js.map +1 -1
- package/lib/orchestrator/suite-summary.d.ts +77 -0
- package/lib/orchestrator/suite-summary.d.ts.map +1 -1
- package/lib/orchestrator/suite-summary.js +61 -12
- package/lib/orchestrator/suite-summary.js.map +1 -1
- package/lib/previewer/artifacts.d.ts +25 -0
- package/lib/previewer/artifacts.d.ts.map +1 -0
- package/lib/previewer/artifacts.js +180 -0
- package/lib/previewer/artifacts.js.map +1 -0
- package/lib/previewer/server.d.ts +111 -0
- package/lib/previewer/server.d.ts.map +1 -0
- package/lib/previewer/server.js +558 -0
- package/lib/previewer/server.js.map +1 -0
- package/package.json +3 -3
- package/skills/lux-answerer/SKILL.md +2 -2
- package/src/answerers/claude-code/index.ts +6 -5
- package/src/answerers/persona/index.ts +75 -34
- package/src/answerers/terminal/index.ts +8 -12
- package/src/assertions/authoring.ts +2 -0
- package/src/assertions/core/command-exits-zero.ts +61 -7
- package/src/assertions/core/event-checks.ts +64 -3
- package/src/assertions/core/helpers.ts +3 -6
- package/src/assertions/core/index.ts +2 -0
- package/src/assertions/core/resource-checks.ts +38 -5
- package/src/assertions/rubric/index.ts +68 -13
- package/src/assertions/rubric/internal.ts +227 -27
- package/src/authoring.ts +345 -2
- package/src/cli/bin.ts +2 -12
- package/src/cli/command-runtime.ts +20 -9
- package/src/cli/doctor.ts +17 -0
- package/src/cli/harness-plan.ts +117 -0
- package/src/cli/init-templates.ts +238 -0
- package/src/cli/init.ts +53 -184
- package/src/cli/output-schemas.ts +106 -0
- package/src/cli/program.ts +691 -721
- package/src/cli/render/reporter.ts +50 -8
- package/src/cli/run-options.ts +132 -25
- package/src/cli/view.ts +129 -0
- package/src/container/driver.ts +211 -0
- package/src/container/protocol.ts +48 -0
- package/src/container/resources.ts +153 -0
- package/src/container/worker.ts +107 -0
- package/src/core/action-events.ts +59 -0
- package/src/core/agent-activity.ts +236 -0
- package/src/core/agent-environment.ts +64 -0
- package/src/core/agent-events.ts +17 -0
- package/src/core/annotation.ts +2 -1
- package/src/core/answerer.ts +9 -0
- package/src/core/artifact-evidence.ts +47 -4
- package/src/core/assertion.ts +21 -1
- package/src/core/case.ts +21 -3
- package/src/core/command-verification.ts +74 -0
- package/src/core/driver-execution.ts +84 -0
- package/src/core/driver-metrics.ts +51 -0
- package/src/core/driver.ts +76 -0
- package/src/core/duration.ts +52 -0
- package/src/core/environment.ts +22 -0
- package/src/core/evaluation-clusters.ts +35 -0
- package/src/core/events.ts +14 -2
- package/src/core/experiment.ts +64 -24
- package/src/core/file-tree.ts +35 -0
- package/src/core/global-id.ts +26 -0
- package/src/core/harness-catalog.ts +100 -0
- package/src/core/harness-catalogs/antigravity.ts +24 -0
- package/src/core/harness-catalogs/claude-code.ts +25 -0
- package/src/core/harness-catalogs/codex.ts +27 -0
- package/src/core/harness-catalogs/copilot.ts +46 -0
- package/src/core/harness-catalogs/cursor.ts +13 -0
- package/src/core/harness-catalogs/grok-build.ts +19 -0
- package/src/core/harness-catalogs/index.ts +31 -0
- package/src/core/harness-matrix.ts +316 -0
- package/src/core/index.ts +12 -0
- package/src/core/lifecycle-fixtures.ts +4 -2
- package/src/core/model-cli.ts +52 -23
- package/src/core/platform-process.ts +58 -10
- package/src/core/run.ts +31 -0
- package/src/core/usage.ts +8 -0
- package/src/core/wire.ts +5 -1
- package/src/drivers/antigravity/README.md +171 -0
- package/src/drivers/antigravity/artifacts.ts +37 -0
- package/src/drivers/antigravity/config.ts +92 -0
- package/src/drivers/antigravity/events.ts +290 -0
- package/src/drivers/antigravity/index.ts +132 -0
- package/src/drivers/antigravity/runtime.ts +94 -0
- package/src/drivers/claude-code/deferred-process.ts +118 -0
- package/src/drivers/claude-code/index.ts +216 -281
- package/src/drivers/claude-code/isolation.ts +228 -0
- package/src/drivers/claude-code/parse-events.ts +98 -12
- package/src/drivers/codex/app-events.ts +126 -16
- package/src/drivers/codex/config.ts +50 -8
- package/src/drivers/codex/exec-events.ts +258 -0
- package/src/drivers/codex/index.ts +144 -312
- package/src/drivers/copilot/README.md +60 -0
- package/src/drivers/copilot/config.ts +61 -0
- package/src/drivers/copilot/index.ts +310 -0
- package/src/drivers/cursor/README.md +66 -0
- package/src/drivers/cursor/config.ts +31 -0
- package/src/drivers/cursor/index.ts +326 -0
- package/src/drivers/cursor/interaction.ts +74 -0
- package/src/drivers/grok-build/README.md +112 -0
- package/src/drivers/grok-build/config.ts +43 -0
- package/src/drivers/grok-build/index.ts +331 -0
- package/src/drivers/mcp/index.ts +25 -11
- package/src/drivers/shared/acp-events.ts +94 -0
- package/src/drivers/shared/acp-interaction.ts +27 -0
- package/src/drivers/shared/acp-session.ts +40 -0
- package/src/drivers/shared/acp-transport.ts +187 -0
- package/src/drivers/shared/artifacts.ts +6 -2
- package/src/drivers/shared/experiment-behavior.ts +214 -0
- package/src/drivers/shared/experiment-policy.ts +195 -0
- package/src/drivers/subprocess/index.ts +55 -12
- package/src/index.ts +115 -10
- package/src/optimization/reflective.ts +3 -2
- package/src/orchestrator/annotation-loader.ts +10 -0
- package/src/orchestrator/annotation-store.ts +24 -3
- package/src/orchestrator/artifact-origin.ts +50 -0
- package/src/orchestrator/campaign-lifecycle.ts +5 -1
- package/src/orchestrator/candidates.ts +3 -2
- package/src/orchestrator/compare.ts +41 -6
- package/src/orchestrator/comparison-identity.ts +2 -0
- package/src/orchestrator/config.ts +20 -3
- package/src/orchestrator/discover.ts +8 -1
- package/src/orchestrator/doctor.ts +189 -28
- package/src/orchestrator/driver-capabilities.ts +21 -0
- package/src/orchestrator/driver-identity.ts +69 -0
- package/src/orchestrator/experiment-context.ts +3 -2
- package/src/orchestrator/experiment-corpus.ts +53 -37
- package/src/orchestrator/experiment-effects.ts +61 -0
- package/src/orchestrator/experiment-evaluation.ts +71 -10
- package/src/orchestrator/experiment-identity.ts +42 -48
- package/src/orchestrator/experiment-preflight.ts +27 -0
- package/src/orchestrator/experiment-report.ts +21 -1
- package/src/orchestrator/experiment-runs.ts +11 -4
- package/src/orchestrator/experiment-runtime-identity.ts +5 -243
- package/src/orchestrator/experiment-selection.ts +77 -0
- package/src/orchestrator/experiment.ts +29 -29
- package/src/orchestrator/fixture-identity.ts +9 -1
- package/src/orchestrator/fs-read.ts +2 -32
- package/src/orchestrator/grader-experiment.ts +74 -13
- package/src/orchestrator/grading.ts +67 -28
- package/src/orchestrator/harness-catalog-drift.ts +132 -0
- package/src/orchestrator/harness-registry.ts +12 -0
- package/src/orchestrator/index.ts +1 -0
- package/src/orchestrator/list-runs.ts +98 -13
- package/src/orchestrator/optimization-lifecycle.ts +4 -1
- package/src/orchestrator/orchestrator.ts +92 -216
- package/src/orchestrator/paired-effects.ts +209 -0
- package/src/orchestrator/provenance.ts +23 -3
- package/src/orchestrator/rubric-loader.ts +1 -1
- package/src/orchestrator/run-dir.ts +8 -1
- package/src/orchestrator/run-execution.ts +77 -11
- package/src/orchestrator/run-lifecycle.ts +4 -2
- package/src/orchestrator/run-workspace.ts +62 -0
- package/src/orchestrator/suite-compare.ts +29 -19
- package/src/orchestrator/suite-runs.ts +13 -2
- package/src/orchestrator/suite-summary.ts +122 -13
- package/src/previewer/artifacts.ts +221 -0
- package/src/previewer/server.ts +787 -0
- package/viewer/app.css +2079 -0
- package/viewer/app.js +627 -0
- package/viewer/artifact-view.js +48 -0
- package/viewer/charts.js +86 -0
- package/viewer/detail.js +1237 -0
- package/viewer/format.js +129 -0
- package/viewer/index.html +151 -0
- package/lib/answerers/scripted/index.d.ts +0 -8
- package/lib/answerers/scripted/index.d.ts.map +0 -1
- package/lib/answerers/scripted/index.js +0 -163
- package/lib/answerers/scripted/index.js.map +0 -1
- package/lib/cli/skills.d.ts +0 -38
- package/lib/cli/skills.d.ts.map +0 -1
- package/lib/cli/skills.js +0 -84
- package/lib/cli/skills.js.map +0 -1
- package/lib/drivers/shared/secure-copy.d.ts.map +0 -1
- package/lib/drivers/shared/secure-copy.js.map +0 -1
- package/skills/lux/SKILL.md +0 -85
- package/skills/lux/references/cli.md +0 -102
- package/skills/lux/references/eval-authoring.md +0 -105
- package/src/answerers/scripted/index.ts +0 -186
- package/src/cli/skills.ts +0 -129
- /package/lib/{drivers/shared → core}/secure-copy.d.ts +0 -0
- /package/lib/{drivers/shared → core}/secure-copy.js +0 -0
- /package/src/{drivers/shared → core}/secure-copy.ts +0 -0
package/lib/cli/program.js
CHANGED
|
@@ -1,118 +1,376 @@
|
|
|
1
|
+
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
2
|
+
if (value !== null && value !== void 0) {
|
|
3
|
+
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
4
|
+
var dispose, inner;
|
|
5
|
+
if (async) {
|
|
6
|
+
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
7
|
+
dispose = value[Symbol.asyncDispose];
|
|
8
|
+
}
|
|
9
|
+
if (dispose === void 0) {
|
|
10
|
+
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
11
|
+
dispose = value[Symbol.dispose];
|
|
12
|
+
if (async) inner = dispose;
|
|
13
|
+
}
|
|
14
|
+
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
15
|
+
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
16
|
+
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
17
|
+
}
|
|
18
|
+
else if (async) {
|
|
19
|
+
env.stack.push({ async: true });
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
};
|
|
23
|
+
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
24
|
+
return function (env) {
|
|
25
|
+
function fail(e) {
|
|
26
|
+
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
27
|
+
env.hasError = true;
|
|
28
|
+
}
|
|
29
|
+
var r, s = 0;
|
|
30
|
+
function next() {
|
|
31
|
+
while (r = env.stack.pop()) {
|
|
32
|
+
try {
|
|
33
|
+
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
34
|
+
if (r.dispose) {
|
|
35
|
+
var result = r.dispose.call(r.value);
|
|
36
|
+
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
37
|
+
}
|
|
38
|
+
else s |= 1;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
fail(e);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
45
|
+
if (env.hasError) throw env.error;
|
|
46
|
+
}
|
|
47
|
+
return next();
|
|
48
|
+
};
|
|
49
|
+
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
50
|
+
var e = new Error(message);
|
|
51
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
52
|
+
});
|
|
1
53
|
import { randomUUID } from "node:crypto";
|
|
2
54
|
import { existsSync } from "node:fs";
|
|
3
55
|
import { lstat, mkdir, realpath, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
4
56
|
import { createRequire } from "node:module";
|
|
5
|
-
import { basename, dirname,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { GraderAnnotationSchema, matchesAnyGlob, valueHash, } from "../core/index.js";
|
|
9
|
-
import {
|
|
57
|
+
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
58
|
+
import { fileURLToPath } from "node:url";
|
|
59
|
+
import { Cli, Errors, z } from "incur";
|
|
60
|
+
import { GraderAnnotationSchema, matchesAnyGlob, ReasoningEffortSchema, valueHash, } from "../core/index.js";
|
|
61
|
+
import { registryWithHarness } from "../orchestrator/harness-registry.js";
|
|
62
|
+
import { applyCandidate, buildRegistryFromConfig, compareRuns, compareSuiteRuns, DoctorReportSchema, discoverCases, ExperimentCampaignPlanSchema, ExperimentDecisionReportSchema, ExperimentRunSchema, experimentCampaignMode, formatComparisonText, formatExperimentDecisionMarkdown, formatSuiteComparisonText, GradingSnapshotSchema, hasRegression, hasSuiteRegression, loadEvalCase, loadExperimentCampaign, loadExperimentRun, loadFrozenRegradableRun, loadLuxConfig, loadRubricDefinition, loadSuiteRun, loadVerifiedExperimentDecisionSnapshot, Orchestrator, optimizeExperimentCampaign, planExperimentCampaign, regradeRun, releaseFrozenRegradableRun, resolveExperimentCampaignPath, runExperimentCampaign, upsertGraderAnnotation, verifyExperimentDecisionIntegrity, verifyExperimentRunIntegrity, } from "../orchestrator/index.js";
|
|
10
63
|
import { abortOnInterrupt, ensureDirectory, failWith, relativePathWithin, } from "./command-runtime.js";
|
|
11
|
-
import {
|
|
64
|
+
import { doctorCommand } from "./doctor.js";
|
|
65
|
+
import { initProject } from "./init.js";
|
|
66
|
+
import { CompareOutputSchema, ViewOutputSchema } from "./output-schemas.js";
|
|
12
67
|
import { ConsoleReporter } from "./render/reporter.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
68
|
+
import { expandLoop, parseAnnotationAssertion, partitionFilters, planSuiteItems, resolveAnswererOverride, resolveConcurrency, selectSuite, suiteTitle, } from "./run-options.js";
|
|
69
|
+
import { viewCommand, webViewCommand } from "./view.js";
|
|
15
70
|
const requireFromHere = createRequire(import.meta.url);
|
|
16
71
|
// From lib/cli/program.js (or src/cli/program.ts under test) to the package root.
|
|
17
72
|
const PKG_VERSION = requireFromHere("../../package.json").version;
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
73
|
+
const nonEmptyString = z.string().min(1);
|
|
74
|
+
const positiveInteger = z.coerce.number().int().positive();
|
|
75
|
+
const unitInterval = z.coerce.number().min(0).max(1);
|
|
76
|
+
const tagList = z
|
|
77
|
+
.array(nonEmptyString)
|
|
78
|
+
.default([])
|
|
79
|
+
.describe("Repeatable list; each value may be comma-separated");
|
|
80
|
+
const normalizeTags = (values) => values.flatMap((value) => value.split(",").map((tag) => tag.trim())).filter(Boolean);
|
|
81
|
+
const initOutput = z.object({
|
|
82
|
+
created: z.array(z.string()),
|
|
83
|
+
updated: z.array(z.string()),
|
|
84
|
+
skipped: z.array(z.object({ path: z.string(), reason: z.string() })),
|
|
85
|
+
experiment: z.boolean(),
|
|
86
|
+
});
|
|
87
|
+
const runOutput = z.union([
|
|
88
|
+
z.object({
|
|
89
|
+
caseCount: z.number().int(),
|
|
90
|
+
cases: z.array(z.object({
|
|
91
|
+
path: z.string(),
|
|
92
|
+
id: z.string(),
|
|
93
|
+
caseId: z.string().optional(),
|
|
94
|
+
permutationId: z.string().optional(),
|
|
95
|
+
})),
|
|
96
|
+
}),
|
|
97
|
+
z.object({
|
|
98
|
+
caseCount: z.number().int(),
|
|
99
|
+
tags: z.array(z.object({ tag: z.string(), count: z.number().int() })),
|
|
100
|
+
}),
|
|
101
|
+
z.object({
|
|
102
|
+
suiteDir: z.string(),
|
|
103
|
+
results: z.array(z.object({
|
|
104
|
+
caseId: z.string(),
|
|
105
|
+
runDir: z.string().nullable(),
|
|
106
|
+
exitReason: z.string(),
|
|
107
|
+
casePassed: z.boolean().nullable(),
|
|
108
|
+
caseScore: z.number().nullable(),
|
|
109
|
+
assertionsPassed: z.number().int(),
|
|
110
|
+
assertionsTotal: z.number().int(),
|
|
111
|
+
})),
|
|
112
|
+
}),
|
|
113
|
+
]);
|
|
114
|
+
const experimentOutput = z.union([
|
|
115
|
+
ExperimentCampaignPlanSchema,
|
|
116
|
+
ExperimentRunSchema.extend({ experimentDir: z.string() }),
|
|
117
|
+
]);
|
|
118
|
+
const gradingOutput = GradingSnapshotSchema.extend({ gradingPath: z.string() });
|
|
119
|
+
const reportOutput = z.union([
|
|
120
|
+
ExperimentDecisionReportSchema,
|
|
121
|
+
z.object({ path: z.string(), report: ExperimentDecisionReportSchema }),
|
|
122
|
+
]);
|
|
123
|
+
const campaignArgs = z.object({ campaign: nonEmptyString.describe("Experiment campaign path") });
|
|
124
|
+
const campaignOptions = z.object({
|
|
125
|
+
runsRoot: nonEmptyString.optional().describe("Run directory root overriding lux.config.ts"),
|
|
126
|
+
resume: nonEmptyString.optional().describe("Interrupted experiment directory to resume"),
|
|
127
|
+
plan: z.boolean().optional().describe("Validate and estimate without calling models"),
|
|
128
|
+
});
|
|
129
|
+
export const buildCli = () => Cli.create("lux", {
|
|
130
|
+
description: "Coding-agent evaluation and improvement with deterministic assertions and human-in-the-loop runs",
|
|
131
|
+
version: PKG_VERSION,
|
|
132
|
+
sync: {
|
|
133
|
+
include: [fileURLToPath(new URL("../../skills/*", import.meta.url))],
|
|
134
|
+
depth: 2,
|
|
135
|
+
suggestions: [
|
|
136
|
+
"Use Lux to inspect the eval cases in this project",
|
|
137
|
+
"Use Lux to diagnose the latest failed eval run",
|
|
138
|
+
"Use Lux to plan an evidence-based improvement experiment",
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
mcp: {
|
|
142
|
+
title: "Lux coding-agent evaluation",
|
|
143
|
+
instructions: "Inspect and plan before running model-spending commands. Apply only a verified promoted experiment champion.",
|
|
144
|
+
},
|
|
145
|
+
})
|
|
146
|
+
.command("init", {
|
|
147
|
+
description: "Scaffold a new eval project in the current directory",
|
|
148
|
+
options: z.object({
|
|
149
|
+
force: z.boolean().optional().describe("Overwrite existing files"),
|
|
150
|
+
experiment: z.boolean().optional().describe("Also scaffold an optimization campaign"),
|
|
151
|
+
driver: z
|
|
152
|
+
.enum([
|
|
153
|
+
"subprocess",
|
|
154
|
+
"claude-code",
|
|
155
|
+
"codex",
|
|
156
|
+
"cursor",
|
|
157
|
+
"copilot",
|
|
158
|
+
"antigravity",
|
|
159
|
+
"grok-build",
|
|
160
|
+
])
|
|
161
|
+
.optional()
|
|
162
|
+
.describe("Starter driver (default: deterministic subprocess)"),
|
|
163
|
+
model: nonEmptyString.optional().describe("Explicit subject model; required for Cursor"),
|
|
164
|
+
}),
|
|
165
|
+
output: initOutput,
|
|
166
|
+
destructive: true,
|
|
167
|
+
mcp: { annotations: { destructiveHint: true, openWorldHint: false } },
|
|
168
|
+
examples: [
|
|
169
|
+
{ description: "Scaffold a basic eval project" },
|
|
170
|
+
{ options: { experiment: true }, description: "Scaffold an optimization project" },
|
|
171
|
+
],
|
|
172
|
+
run: async (c) => c.ok(await initCommand(c.options), { cta: { commands: ["doctor", "run --list"] } }),
|
|
173
|
+
})
|
|
174
|
+
.command("doctor", {
|
|
175
|
+
description: "Preflight project configuration, CLIs, cases, campaigns, and budgets",
|
|
176
|
+
args: z.object({ campaigns: z.array(z.string()).default([]).describe("Campaign paths") }),
|
|
177
|
+
options: z.object({
|
|
178
|
+
static: z
|
|
179
|
+
.boolean()
|
|
180
|
+
.optional()
|
|
181
|
+
.describe("Validate project files without checking installed executables (for CI)"),
|
|
182
|
+
}),
|
|
183
|
+
output: DoctorReportSchema,
|
|
184
|
+
mcp: {
|
|
185
|
+
annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false },
|
|
186
|
+
},
|
|
187
|
+
run: async (c) => c.ok(await doctorCommand(c.args.campaigns, c.options), {
|
|
188
|
+
cta: { commands: ["run --list"] },
|
|
189
|
+
}),
|
|
190
|
+
})
|
|
191
|
+
.command("run", {
|
|
192
|
+
description: "Discover and run cases, filtered by name, path, or tag",
|
|
193
|
+
args: z.object({ filters: z.array(z.string()).default([]).describe("Case names or paths") }),
|
|
194
|
+
options: z.object({
|
|
195
|
+
tag: tagList.describe("Required case tag; repeatable and comma-separated"),
|
|
196
|
+
loop: positiveInteger.optional().describe("Run each matched eval this many times"),
|
|
197
|
+
concurrency: positiveInteger.optional().describe("Maximum cases running concurrently"),
|
|
198
|
+
list: z.boolean().optional().describe("List matching cases without running"),
|
|
199
|
+
listTags: z.boolean().optional().describe("List tags across matching cases"),
|
|
200
|
+
interactive: z.boolean().optional().describe("Answer agent questions in this terminal"),
|
|
201
|
+
claudeAnswerer: z.boolean().optional().describe("Use Claude Code as the answerer"),
|
|
202
|
+
skipJudge: z.boolean().optional().describe("Skip rubric LLM judge assertions"),
|
|
203
|
+
runsRoot: nonEmptyString.optional().describe("Run directory root"),
|
|
204
|
+
profile: nonEmptyString.optional().describe("Named driver and answerer profile"),
|
|
205
|
+
driver: nonEmptyString
|
|
206
|
+
.optional()
|
|
207
|
+
.describe("Focus on one harness driver, replacing the matrix"),
|
|
208
|
+
model: nonEmptyString.optional().describe("Focus on one subject model"),
|
|
209
|
+
effort: ReasoningEffortSchema.optional().describe("Focus on one reasoning effort"),
|
|
210
|
+
subjectRoot: nonEmptyString.optional().describe("Root bound into subjectPath values"),
|
|
211
|
+
verbose: z.boolean().optional().describe("Include phase timings and run directories"),
|
|
212
|
+
}),
|
|
213
|
+
alias: { tag: "t", concurrency: "j", interactive: "i", verbose: "v" },
|
|
214
|
+
output: runOutput,
|
|
215
|
+
outputPolicy: "agent-only",
|
|
216
|
+
mcp: { annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true } },
|
|
217
|
+
examples: [
|
|
218
|
+
{ options: { list: true, tag: [] }, description: "List all discovered cases" },
|
|
219
|
+
{
|
|
220
|
+
args: { filters: ["smoke"] },
|
|
221
|
+
options: { tag: [] },
|
|
222
|
+
description: "Run matching cases",
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
args: { filters: ["smoke"] },
|
|
226
|
+
options: { tag: [], driver: "codex", model: "gpt-5.6-luna", effort: "low" },
|
|
227
|
+
description: "Focus on one harness permutation",
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
run: async (c) => {
|
|
231
|
+
const result = await runCommand(c.args.filters, c.options, !c.agent);
|
|
232
|
+
const suiteDir = "suiteDir" in result ? result.suiteDir : undefined;
|
|
233
|
+
return c.ok(result, {
|
|
234
|
+
cta: {
|
|
235
|
+
description: "Inspect saved results:",
|
|
236
|
+
commands: suiteDir ? [{ command: "view", args: { runDir: suiteDir } }] : [],
|
|
237
|
+
},
|
|
30
238
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
.
|
|
98
|
-
.
|
|
99
|
-
.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
239
|
+
},
|
|
240
|
+
})
|
|
241
|
+
.command("experiment", {
|
|
242
|
+
description: "Evaluate controlled source variants across cases and model profiles",
|
|
243
|
+
args: campaignArgs,
|
|
244
|
+
options: campaignOptions,
|
|
245
|
+
output: experimentOutput,
|
|
246
|
+
mcp: { annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true } },
|
|
247
|
+
run: async (c) => experimentCommand("experiment", c.args.campaign, c.options),
|
|
248
|
+
})
|
|
249
|
+
.command("optimize", {
|
|
250
|
+
description: "Evolve candidates from grading feedback and promote on held-out cases",
|
|
251
|
+
args: campaignArgs,
|
|
252
|
+
options: campaignOptions,
|
|
253
|
+
output: experimentOutput,
|
|
254
|
+
destructive: true,
|
|
255
|
+
mcp: { annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: true } },
|
|
256
|
+
run: async (c) => experimentCommand("optimize", c.args.campaign, c.options),
|
|
257
|
+
})
|
|
258
|
+
.command("grade", {
|
|
259
|
+
description: "Re-run current graders against a persisted run",
|
|
260
|
+
args: z.object({ runDir: nonEmptyString.describe("Persisted run directory") }),
|
|
261
|
+
options: z.object({ case: nonEmptyString.optional().describe("Current case definition") }),
|
|
262
|
+
output: gradingOutput,
|
|
263
|
+
mcp: { annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: true } },
|
|
264
|
+
run: async (c) => gradeCommand(c.args.runDir, c.options),
|
|
265
|
+
})
|
|
266
|
+
.command("annotate", {
|
|
267
|
+
description: "Add or update a human grader-alignment label",
|
|
268
|
+
args: z.object({ runDir: nonEmptyString.describe("Persisted run directory") }),
|
|
269
|
+
options: z.object({
|
|
270
|
+
out: nonEmptyString.describe("JSON annotation dataset to create or update"),
|
|
271
|
+
rubric: nonEmptyString.describe("Candidate-relative declarative rubric path"),
|
|
272
|
+
id: nonEmptyString.optional().describe("Stable annotation ID"),
|
|
273
|
+
label: z.enum(["pass", "fail"]).optional().describe("Expected overall verdict"),
|
|
274
|
+
score: unitInterval.optional().describe("Expected score from zero to one"),
|
|
275
|
+
assertion: z
|
|
276
|
+
.array(nonEmptyString)
|
|
277
|
+
.default([])
|
|
278
|
+
.describe("Assertion label id=pass|fail[:score]"),
|
|
279
|
+
split: z.enum(["train", "validation", "test"]).optional().describe("Dataset split"),
|
|
280
|
+
tag: tagList.describe("Selection tag; repeatable and comma-separated"),
|
|
281
|
+
feedback: nonEmptyString.optional().describe("Human rationale for mismatches"),
|
|
282
|
+
annotator: nonEmptyString.optional().describe("Label author"),
|
|
283
|
+
reviewer: nonEmptyString.optional().describe("Independent reviewer"),
|
|
284
|
+
source: z.enum(["human", "synthetic"]).default("human").describe("Label provenance"),
|
|
285
|
+
}),
|
|
286
|
+
output: z.object({ id: z.string(), path: z.string(), labels: z.number().int() }),
|
|
287
|
+
destructive: true,
|
|
288
|
+
mcp: {
|
|
289
|
+
annotations: {
|
|
290
|
+
readOnlyHint: false,
|
|
291
|
+
destructiveHint: false,
|
|
292
|
+
idempotentHint: true,
|
|
293
|
+
openWorldHint: false,
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
run: async (c) => annotateCommand(c.args.runDir, c.options),
|
|
297
|
+
})
|
|
298
|
+
.command("apply", {
|
|
299
|
+
description: "Apply the verified promoted experiment champion",
|
|
300
|
+
args: z.object({
|
|
301
|
+
experimentDir: nonEmptyString.describe("Experiment directory"),
|
|
302
|
+
candidateId: nonEmptyString.optional().describe("Expected promoted candidate ID"),
|
|
303
|
+
}),
|
|
304
|
+
output: z.object({
|
|
305
|
+
candidateId: z.string(),
|
|
306
|
+
subjectRoot: z.string(),
|
|
307
|
+
sourceBytes: z.number(),
|
|
308
|
+
}),
|
|
309
|
+
destructive: true,
|
|
310
|
+
mcp: {
|
|
311
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
312
|
+
},
|
|
313
|
+
run: async (c) => applyCommand(c.args.experimentDir, c.args.candidateId),
|
|
314
|
+
})
|
|
315
|
+
.command("report", {
|
|
316
|
+
description: "Render a PR-ready report from a verified experiment record",
|
|
317
|
+
args: z.object({ experimentDir: nonEmptyString.describe("Experiment directory") }),
|
|
318
|
+
options: z.object({
|
|
319
|
+
out: nonEmptyString.optional().describe("Write Markdown to this path"),
|
|
320
|
+
force: z.boolean().optional().describe("Overwrite an existing output file"),
|
|
321
|
+
}),
|
|
322
|
+
output: reportOutput,
|
|
323
|
+
mcp: { annotations: { readOnlyHint: false, destructiveHint: false, openWorldHint: false } },
|
|
324
|
+
run: async (c) => reportCommand(c.args.experimentDir, c.options),
|
|
325
|
+
})
|
|
326
|
+
.command("view", {
|
|
327
|
+
description: "List past runs or show one run in detail",
|
|
328
|
+
args: z.object({ runDir: nonEmptyString.optional().describe("Run or suite directory") }),
|
|
329
|
+
options: z.object({
|
|
330
|
+
runsRoot: nonEmptyString.optional().describe("Run directory root"),
|
|
331
|
+
case: nonEmptyString.optional().describe("Filter lists to one case slug"),
|
|
332
|
+
suites: z.boolean().optional().describe("List logical suite runs"),
|
|
333
|
+
experiments: z.boolean().optional().describe("List experiment runs"),
|
|
334
|
+
web: z.boolean().optional().describe("Open the Lux Review web app"),
|
|
335
|
+
port: z.coerce.number().int().min(0).max(65535).optional().describe("Review server port"),
|
|
336
|
+
open: z.boolean().default(true).describe("Open a browser in web mode"),
|
|
337
|
+
}),
|
|
338
|
+
output: ViewOutputSchema,
|
|
339
|
+
mcp: { annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false } },
|
|
340
|
+
run: (c) => {
|
|
341
|
+
if (c.options.web) {
|
|
342
|
+
if (c.formatExplicit && c.format !== "jsonl") {
|
|
343
|
+
throw new Errors.ParseError({
|
|
344
|
+
message: "--web requires streaming output; omit --format or use --format jsonl",
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
return webViewCommand(c.args.runDir, c.options);
|
|
348
|
+
}
|
|
349
|
+
return viewCommand(c.args.runDir, c.options).then((result) => ViewOutputSchema.parse(result));
|
|
350
|
+
},
|
|
351
|
+
})
|
|
352
|
+
.command("compare", {
|
|
353
|
+
description: "Diff two run or suite directories and fail on regression",
|
|
354
|
+
args: z.object({
|
|
355
|
+
runA: nonEmptyString.describe("Baseline run"),
|
|
356
|
+
runB: nonEmptyString.describe("Current run"),
|
|
357
|
+
}),
|
|
358
|
+
options: z.object({
|
|
359
|
+
passRateTolerance: unitInterval.optional().describe("Allowed per-case pass-rate decrease"),
|
|
360
|
+
}),
|
|
361
|
+
output: CompareOutputSchema,
|
|
362
|
+
mcp: { annotations: { readOnlyHint: true, destructiveHint: false, openWorldHint: false } },
|
|
363
|
+
run: async (c) => CompareOutputSchema.parse(await compareCommand(c.args.runA, c.args.runB, c.options)),
|
|
364
|
+
});
|
|
365
|
+
const initCommand = async (options) => initProject({ cwd: process.cwd(), ...options });
|
|
366
|
+
const gradeCommand = async (runDir, options) => {
|
|
367
|
+
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
368
|
+
try {
|
|
111
369
|
const directory = resolve(runDir);
|
|
112
370
|
if (!(await ensureDirectory("grade", directory)))
|
|
113
|
-
|
|
371
|
+
failWith(1);
|
|
114
372
|
const config = await loadLuxConfig(process.cwd());
|
|
115
|
-
const controller = abortOnInterrupt();
|
|
373
|
+
const controller = __addDisposableResource(env_1, abortOnInterrupt(), false);
|
|
116
374
|
const result = await regradeRun({
|
|
117
375
|
runDir: directory,
|
|
118
376
|
registry: buildRegistryFromConfig(config),
|
|
@@ -120,333 +378,217 @@ const registerCandidateCommands = (program) => {
|
|
|
120
378
|
...(options.case ? { case: await loadEvalCase(resolve(options.case)) } : {}),
|
|
121
379
|
abortSignal: controller.signal,
|
|
122
380
|
});
|
|
123
|
-
const report = result.snapshot.report;
|
|
124
|
-
let gradingStatus = "ungraded";
|
|
125
|
-
if (report.casePassed === true)
|
|
126
|
-
gradingStatus = "PASS";
|
|
127
|
-
if (report.casePassed === false)
|
|
128
|
-
gradingStatus = "FAIL";
|
|
129
|
-
let output;
|
|
130
|
-
if (options.json) {
|
|
131
|
-
output = `${JSON.stringify({ gradingPath: result.path, ...result.snapshot }, null, 2)}\n`;
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
const score = report.caseScore === null ? "—" : `${(report.caseScore * 100).toFixed(0)}%`;
|
|
135
|
-
output = [
|
|
136
|
-
`grading: ${gradingStatus}`,
|
|
137
|
-
`score: ${score}`,
|
|
138
|
-
`checks: ${report.assertions.filter((assertion) => assertion.passed).length}/${report.assertions.length}`,
|
|
139
|
-
`saved: ${result.path}`,
|
|
140
|
-
"",
|
|
141
|
-
].join("\n");
|
|
142
|
-
}
|
|
143
|
-
process.stdout.write(output);
|
|
144
381
|
if (controller.signal.aborted)
|
|
145
382
|
failWith(SIGINT_EXIT_CODE);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
.description("add or update a human grader-alignment label for a persisted run")
|
|
152
|
-
.requiredOption("--out <path>", "JSON annotation dataset to create or update")
|
|
153
|
-
.requiredOption("--rubric <path>", "candidate-relative declarative .json rubric path")
|
|
154
|
-
.option("--id <id>", "stable annotation id")
|
|
155
|
-
.option("--label <pass|fail>", "expected overall case verdict")
|
|
156
|
-
.option("--score <n>", "expected overall case score from 0 to 1", parseUnitInterval)
|
|
157
|
-
.option("--assertion <id=pass|fail[:score]>", "expected stable assertion verdict and optional score (repeatable)", collectValues, [])
|
|
158
|
-
.option("--split <train|validation|test>", "dataset split, stored as a tag")
|
|
159
|
-
.option("--tag <tag>", "extra selection tag (repeatable, comma-separated)", collectTags, [])
|
|
160
|
-
.option("--feedback <text>", "human rationale shown to the rubric optimizer on mismatch")
|
|
161
|
-
.option("--annotator <id>", "person or system that authored the label")
|
|
162
|
-
.option("--reviewer <id>", "independent reviewer of the label")
|
|
163
|
-
.option("--source <human|synthetic>", "label provenance", "human")
|
|
164
|
-
.action(async (runDir, options) => {
|
|
165
|
-
const directory = resolve(runDir);
|
|
166
|
-
if (!(await ensureDirectory("annotate", directory)))
|
|
167
|
-
return;
|
|
168
|
-
if (options.label && options.label !== "pass" && options.label !== "fail") {
|
|
169
|
-
throw new InvalidArgumentError("--label must be pass or fail");
|
|
170
|
-
}
|
|
171
|
-
if (options.split && !["train", "validation", "test"].includes(options.split)) {
|
|
172
|
-
throw new InvalidArgumentError("--split must be train, validation, or test");
|
|
173
|
-
}
|
|
174
|
-
if (options.source !== "human" && options.source !== "synthetic") {
|
|
175
|
-
throw new InvalidArgumentError("--source must be human or synthetic");
|
|
176
|
-
}
|
|
177
|
-
const parsedAssertions = options.assertion.map(parseAnnotationAssertion);
|
|
178
|
-
const assertionIds = parsedAssertions.map(([id]) => id);
|
|
179
|
-
if (new Set(assertionIds).size !== assertionIds.length) {
|
|
180
|
-
throw new InvalidArgumentError("--assertion ids must not be repeated");
|
|
181
|
-
}
|
|
182
|
-
const assertions = Object.fromEntries(parsedAssertions);
|
|
183
|
-
if (options.label === undefined &&
|
|
184
|
-
options.score === undefined &&
|
|
185
|
-
Object.keys(assertions).length === 0) {
|
|
186
|
-
throw new Error("lux annotate: provide --label, --score, or at least one --assertion");
|
|
187
|
-
}
|
|
188
|
-
const out = resolve(options.out);
|
|
189
|
-
const run = await loadFrozenRegradableRun(directory);
|
|
190
|
-
try {
|
|
191
|
-
const rubric = await loadRubricDefinition(await resolveAuthoredFile(options.rubric, "rubric"));
|
|
192
|
-
if (rubric.id !== run.case.id) {
|
|
193
|
-
throw new Error(`lux annotate: rubric id '${rubric.id}' does not match persisted case '${run.case.id}'`);
|
|
194
|
-
}
|
|
195
|
-
const rubricIds = new Set(rubric.assertions.map((assertion) => assertion.id));
|
|
196
|
-
const unknownIds = assertionIds.filter((assertionId) => !rubricIds.has(assertionId));
|
|
197
|
-
if (unknownIds.length > 0) {
|
|
198
|
-
throw new Error(`lux annotate: unknown rubric assertion ids: ${unknownIds.join(", ")}`);
|
|
199
|
-
}
|
|
200
|
-
const tags = [...(options.split ? [options.split] : []), ...options.tag].filter((tag, index, all) => all.indexOf(tag) === index);
|
|
201
|
-
const caseId = run.case.id;
|
|
202
|
-
const portableRunDir = (relative(dirname(out), directory) || ".").split(sep).join("/");
|
|
203
|
-
const id = options.id ??
|
|
204
|
-
`${caseId}-${basename(directory)}-${valueHash(portableRunDir).slice(0, 10)}`.replace(/[^a-zA-Z0-9_-]+/g, "-");
|
|
205
|
-
const annotation = GraderAnnotationSchema.parse({
|
|
206
|
-
id,
|
|
207
|
-
runDir: portableRunDir,
|
|
208
|
-
rubricPath: options.rubric,
|
|
209
|
-
tags,
|
|
210
|
-
source: options.source,
|
|
211
|
-
...(options.annotator ? { annotator: options.annotator } : {}),
|
|
212
|
-
labeledAt: new Date().toISOString(),
|
|
213
|
-
...(options.reviewer ? { reviewer: options.reviewer } : {}),
|
|
214
|
-
expected: {
|
|
215
|
-
...(options.label ? { casePassed: options.label === "pass" } : {}),
|
|
216
|
-
...(options.score !== undefined ? { caseScore: options.score } : {}),
|
|
217
|
-
assertions,
|
|
218
|
-
},
|
|
219
|
-
...(options.feedback ? { feedback: options.feedback } : {}),
|
|
383
|
+
if (result.snapshot.report.casePassed !== true) {
|
|
384
|
+
throw new Errors.IncurError({
|
|
385
|
+
code: "GRADING_FAILED",
|
|
386
|
+
message: `The persisted run did not pass regrading. Grading saved to ${result.path}.`,
|
|
387
|
+
exitCode: 1,
|
|
220
388
|
});
|
|
221
|
-
const dataset = await upsertGraderAnnotation(out, annotation);
|
|
222
|
-
process.stdout.write(`annotated ${annotation.id} in ${out} (${dataset.annotations.length} labels)\n`);
|
|
223
|
-
}
|
|
224
|
-
finally {
|
|
225
|
-
await releaseFrozenRegradableRun(run);
|
|
226
389
|
}
|
|
227
|
-
|
|
390
|
+
return { gradingPath: result.path, ...result.snapshot };
|
|
391
|
+
}
|
|
392
|
+
catch (e_1) {
|
|
393
|
+
env_1.error = e_1;
|
|
394
|
+
env_1.hasError = true;
|
|
395
|
+
}
|
|
396
|
+
finally {
|
|
397
|
+
__disposeResources(env_1);
|
|
398
|
+
}
|
|
228
399
|
};
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
.
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
.
|
|
242
|
-
.
|
|
243
|
-
|
|
244
|
-
const directory = resolve(experimentDir);
|
|
245
|
-
const experiment = await loadExperimentRun(directory);
|
|
246
|
-
if (!experiment) {
|
|
247
|
-
process.stderr.write(`lux apply: experiment manifest not found at ${directory}\n`);
|
|
248
|
-
failWith(1);
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
if (experiment.status !== "passed") {
|
|
252
|
-
process.stderr.write(`lux apply: experiment status is '${experiment.status}', not 'passed'\n`);
|
|
253
|
-
failWith(1);
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
const championId = experiment.championCandidateId;
|
|
257
|
-
if (!championId) {
|
|
258
|
-
process.stderr.write("lux apply: passed experiment has no promoted champion\n");
|
|
259
|
-
failWith(1);
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
if (candidateId && candidateId !== championId) {
|
|
263
|
-
process.stderr.write(`lux apply: candidate '${candidateId}' is not the promoted champion '${championId}'\n`);
|
|
264
|
-
failWith(1);
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
let candidate;
|
|
268
|
-
try {
|
|
269
|
-
const candidates = await verifyExperimentRunIntegrity(directory, experiment);
|
|
270
|
-
verifyExperimentDecisionIntegrity(experiment);
|
|
271
|
-
candidate = candidates.find((entry) => entry.id === championId);
|
|
272
|
-
if (!candidate) {
|
|
273
|
-
throw new Error(`champion candidate '${championId}' not found`);
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
catch (error) {
|
|
277
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
278
|
-
process.stderr.write(`lux apply: experiment integrity check failed: ${message}\n`);
|
|
279
|
-
failWith(1);
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
await applyCandidate(experiment.subjectRoot, experiment.campaignSnapshot.subject, candidate);
|
|
283
|
-
process.stdout.write(`applied candidate ${candidate.id} to ${experiment.subjectRoot} (${candidate.sourceBytes} bytes)\n`);
|
|
284
|
-
});
|
|
285
|
-
program
|
|
286
|
-
.command("report <experimentDir>")
|
|
287
|
-
.description("render a PR-ready promotion report from a verified experiment record")
|
|
288
|
-
.option("--json", "emit the structured decision report as JSON")
|
|
289
|
-
.option("--out <path>", "write the report to a file instead of stdout")
|
|
290
|
-
.option("--force", "overwrite an existing output file")
|
|
291
|
-
.action(async (experimentDir, options) => {
|
|
292
|
-
const directory = resolve(experimentDir);
|
|
293
|
-
if (!(await ensureDirectory("report", directory)))
|
|
294
|
-
return;
|
|
295
|
-
const snapshot = await loadVerifiedExperimentDecisionSnapshot(directory);
|
|
296
|
-
const { experiment, report } = snapshot;
|
|
297
|
-
const rendered = options.json
|
|
298
|
-
? `${JSON.stringify(report, null, 2)}\n`
|
|
299
|
-
: `${formatExperimentDecisionMarkdown(report)}\n`;
|
|
300
|
-
if (!options.out) {
|
|
301
|
-
process.stdout.write(rendered);
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
const out = resolve(options.out);
|
|
305
|
-
const outputStats = await lstat(out).catch((error) => {
|
|
306
|
-
if (error.code === "ENOENT")
|
|
307
|
-
return null;
|
|
308
|
-
throw error;
|
|
400
|
+
const annotateCommand = async (runDir, options) => {
|
|
401
|
+
const directory = resolve(runDir);
|
|
402
|
+
if (!(await ensureDirectory("annotate", directory)))
|
|
403
|
+
failWith(1);
|
|
404
|
+
const parsedAssertions = options.assertion.map(parseAnnotationAssertion);
|
|
405
|
+
const assertionIds = parsedAssertions.map(([id]) => id);
|
|
406
|
+
if (new Set(assertionIds).size !== assertionIds.length) {
|
|
407
|
+
throw new Errors.ParseError({ message: "--assertion IDs must not be repeated" });
|
|
408
|
+
}
|
|
409
|
+
const assertions = Object.fromEntries(parsedAssertions);
|
|
410
|
+
if (options.label === undefined &&
|
|
411
|
+
options.score === undefined &&
|
|
412
|
+
Object.keys(assertions).length === 0) {
|
|
413
|
+
throw new Errors.ParseError({
|
|
414
|
+
message: "Provide --label, --score, or at least one --assertion",
|
|
309
415
|
});
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
const physicalParent = await realpath(dirname(out));
|
|
324
|
-
const finalPhysicalOut = resolve(physicalParent, basename(out));
|
|
325
|
-
assertReportDestination(finalPhysicalOut, physicalDirectory, physicalSubjectRoot, experiment.campaignSnapshot.subject.exclude);
|
|
326
|
-
await writeReportSafely(finalPhysicalOut, rendered, options.force ?? false);
|
|
327
|
-
process.stdout.write(`wrote experiment report to ${out}\n`);
|
|
328
|
-
});
|
|
329
|
-
program
|
|
330
|
-
.command("view [runDir]")
|
|
331
|
-
.description("list past runs, or show one run's detail when given a runDir")
|
|
332
|
-
.option("--runs-root <path>", "run-dir root (defaults to lux.config.ts)")
|
|
333
|
-
.option("--case <id>", "filter the run list to one case slug (list mode only)")
|
|
334
|
-
.option("--suites", "list logical suite runs instead of individual runs")
|
|
335
|
-
.option("--experiments", "list experiment runs instead of individual runs")
|
|
336
|
-
.option("--json", "emit machine-readable JSON")
|
|
337
|
-
.action(async (runDirArg, options) => {
|
|
338
|
-
if (runDirArg) {
|
|
339
|
-
const path = resolve(runDirArg);
|
|
340
|
-
if (!(await ensureDirectory("view", path)))
|
|
341
|
-
return;
|
|
342
|
-
if (isExperimentRun(path)) {
|
|
343
|
-
const experiment = await loadExperimentRun(path);
|
|
344
|
-
if (!experiment) {
|
|
345
|
-
process.stderr.write(`lux view: invalid experiment at ${path}\n`);
|
|
346
|
-
failWith(1);
|
|
347
|
-
return;
|
|
348
|
-
}
|
|
349
|
-
process.stdout.write(options.json
|
|
350
|
-
? `${JSON.stringify({ experimentDir: path, ...experiment }, null, 2)}\n`
|
|
351
|
-
: `${formatExperimentRun(path, experiment)}\n`);
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
const suite = await loadSuiteRun(path);
|
|
355
|
-
if (suite) {
|
|
356
|
-
process.stdout.write(options.json
|
|
357
|
-
? `${JSON.stringify({ suiteDir: path, ...suite }, null, 2)}\n`
|
|
358
|
-
: `${formatSuiteRunDetail(path, suite)}\n`);
|
|
359
|
-
return;
|
|
360
|
-
}
|
|
361
|
-
const detail = await loadRunDetail(path);
|
|
362
|
-
if (options.json) {
|
|
363
|
-
process.stdout.write(`${JSON.stringify(detail, null, 2)}\n`);
|
|
364
|
-
}
|
|
365
|
-
else {
|
|
366
|
-
process.stdout.write(`${formatRunDetail(detail)}\n`);
|
|
367
|
-
}
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
const cwd = process.cwd();
|
|
371
|
-
const config = await loadLuxConfig(cwd);
|
|
372
|
-
const runsRoot = options.runsRoot ? resolve(options.runsRoot) : config.runsRoot;
|
|
373
|
-
if (options.experiments) {
|
|
374
|
-
const experiments = await listExperimentRuns(runsRoot);
|
|
375
|
-
process.stdout.write(options.json
|
|
376
|
-
? `${JSON.stringify(experiments, null, 2)}\n`
|
|
377
|
-
: `experiments at ${runsRoot}:\n${formatExperimentRunsTable(experiments)}\n`);
|
|
378
|
-
return;
|
|
379
|
-
}
|
|
380
|
-
if (options.suites) {
|
|
381
|
-
const suites = await listSuiteRuns(runsRoot);
|
|
382
|
-
process.stdout.write(options.json
|
|
383
|
-
? `${JSON.stringify(suites, null, 2)}\n`
|
|
384
|
-
: `suite runs at ${runsRoot}:\n${formatSuiteRunsTable(suites)}\n`);
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
const all = await listRuns(runsRoot);
|
|
388
|
-
const runs = options.case ? all.filter((r) => r.caseSlug === options.case) : all;
|
|
389
|
-
if (options.json) {
|
|
390
|
-
process.stdout.write(`${JSON.stringify(runs, null, 2)}\n`);
|
|
391
|
-
}
|
|
392
|
-
else {
|
|
393
|
-
if (!options.case) {
|
|
394
|
-
process.stdout.write(`suite runs at ${runsRoot}:\n`);
|
|
395
|
-
process.stdout.write(`${formatSuiteRunsTable(await listSuiteRuns(runsRoot))}\n\n`);
|
|
396
|
-
}
|
|
397
|
-
process.stdout.write(`runs at ${runsRoot}:\n`);
|
|
398
|
-
process.stdout.write(`${formatRunsTable(runs)}\n`);
|
|
399
|
-
}
|
|
400
|
-
});
|
|
401
|
-
program
|
|
402
|
-
.command("compare <runA> <runB>")
|
|
403
|
-
.description("diff two run or suite directories")
|
|
404
|
-
.option("--pass-rate-tolerance <fraction>", "allowed per-case pass-rate decrease for suite comparison", parseUnitInterval)
|
|
405
|
-
.action(async (runA, runB, options) => {
|
|
406
|
-
const pathA = resolve(runA);
|
|
407
|
-
const pathB = resolve(runB);
|
|
408
|
-
// Validate both up front so one typo'd path in CI cannot read as
|
|
409
|
-
// "0 regressed"; report every bad path, not just the first.
|
|
410
|
-
const okA = await ensureDirectory("compare", pathA);
|
|
411
|
-
const okB = await ensureDirectory("compare", pathB);
|
|
412
|
-
if (!okA || !okB)
|
|
413
|
-
return;
|
|
414
|
-
const [suiteA, suiteB] = await Promise.all([loadSuiteRun(pathA), loadSuiteRun(pathB)]);
|
|
415
|
-
if (Boolean(suiteA) !== Boolean(suiteB)) {
|
|
416
|
-
process.stderr.write("lux compare: both paths must be runs or both must be suites\n");
|
|
417
|
-
failWith(1);
|
|
418
|
-
return;
|
|
419
|
-
}
|
|
420
|
-
if (suiteA && suiteB) {
|
|
421
|
-
const comparison = await compareSuiteRuns(pathA, pathB, {
|
|
422
|
-
...(options.passRateTolerance !== undefined
|
|
423
|
-
? { passRateTolerance: options.passRateTolerance }
|
|
424
|
-
: {}),
|
|
416
|
+
}
|
|
417
|
+
const out = resolve(options.out);
|
|
418
|
+
const run = await loadFrozenRegradableRun(directory);
|
|
419
|
+
try {
|
|
420
|
+
const rubric = await loadRubricDefinition(await resolveAuthoredFile(options.rubric, "rubric"));
|
|
421
|
+
if (rubric.id !== run.case.id) {
|
|
422
|
+
throw new Error(`Rubric ID '${rubric.id}' does not match persisted case '${run.case.id}'.`);
|
|
423
|
+
}
|
|
424
|
+
const rubricIds = new Set(rubric.assertions.map((assertion) => assertion.id));
|
|
425
|
+
const unknownIds = assertionIds.filter((assertionId) => !rubricIds.has(assertionId));
|
|
426
|
+
if (unknownIds.length > 0) {
|
|
427
|
+
throw new Errors.ParseError({
|
|
428
|
+
message: `Unknown rubric assertion IDs: ${unknownIds.join(", ")}`,
|
|
425
429
|
});
|
|
426
|
-
process.stdout.write(`${formatSuiteComparisonText(comparison)}\n`);
|
|
427
|
-
if (hasSuiteRegression(comparison))
|
|
428
|
-
failWith(1);
|
|
429
|
-
return;
|
|
430
430
|
}
|
|
431
|
-
const
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
431
|
+
const annotationTags = [
|
|
432
|
+
...(options.split ? [options.split] : []),
|
|
433
|
+
...normalizeTags(options.tag),
|
|
434
|
+
].filter((tag, index, all) => all.indexOf(tag) === index);
|
|
435
|
+
const portableRunDir = (relative(dirname(out), directory) || ".").split(sep).join("/");
|
|
436
|
+
const id = options.id ??
|
|
437
|
+
`${run.case.id}-${basename(directory)}-${valueHash(portableRunDir).slice(0, 10)}`.replace(/[^a-zA-Z0-9_-]+/g, "-");
|
|
438
|
+
const annotation = GraderAnnotationSchema.parse({
|
|
439
|
+
id,
|
|
440
|
+
runDir: portableRunDir,
|
|
441
|
+
rubricPath: options.rubric,
|
|
442
|
+
tags: annotationTags,
|
|
443
|
+
source: options.source,
|
|
444
|
+
...(options.annotator ? { annotator: options.annotator } : {}),
|
|
445
|
+
labeledAt: new Date().toISOString(),
|
|
446
|
+
...(options.reviewer ? { reviewer: options.reviewer } : {}),
|
|
447
|
+
expected: {
|
|
448
|
+
...(options.label ? { casePassed: options.label === "pass" } : {}),
|
|
449
|
+
...(options.score !== undefined ? { caseScore: options.score } : {}),
|
|
450
|
+
assertions,
|
|
451
|
+
},
|
|
452
|
+
...(options.feedback ? { feedback: options.feedback } : {}),
|
|
453
|
+
});
|
|
454
|
+
const dataset = await upsertGraderAnnotation(out, annotation);
|
|
455
|
+
return { id: annotation.id, path: out, labels: dataset.annotations.length };
|
|
456
|
+
}
|
|
457
|
+
finally {
|
|
458
|
+
await releaseFrozenRegradableRun(run);
|
|
459
|
+
}
|
|
460
|
+
};
|
|
461
|
+
const applyCommand = async (experimentDir, candidateId) => {
|
|
462
|
+
const directory = resolve(experimentDir);
|
|
463
|
+
const experiment = await loadExperimentRun(directory);
|
|
464
|
+
if (!experiment) {
|
|
465
|
+
throw new Errors.IncurError({
|
|
466
|
+
code: "EXPERIMENT_NOT_FOUND",
|
|
467
|
+
message: `Experiment manifest not found at ${directory}.`,
|
|
468
|
+
exitCode: 1,
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
if (experiment.status !== "passed") {
|
|
472
|
+
throw new Errors.IncurError({
|
|
473
|
+
code: "EXPERIMENT_NOT_PROMOTED",
|
|
474
|
+
message: `Experiment status is '${experiment.status}', not 'passed'.`,
|
|
475
|
+
exitCode: 1,
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
const championId = experiment.championCandidateId;
|
|
479
|
+
if (!championId) {
|
|
480
|
+
throw new Errors.IncurError({
|
|
481
|
+
code: "CHAMPION_NOT_FOUND",
|
|
482
|
+
message: "The passed experiment has no promoted champion.",
|
|
483
|
+
exitCode: 1,
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
if (candidateId && candidateId !== championId) {
|
|
487
|
+
throw new Errors.IncurError({
|
|
488
|
+
code: "CANDIDATE_NOT_PROMOTED",
|
|
489
|
+
message: `Candidate '${candidateId}' is not the promoted champion '${championId}'.`,
|
|
490
|
+
exitCode: 1,
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
let candidate;
|
|
494
|
+
try {
|
|
495
|
+
const candidates = await verifyExperimentRunIntegrity(directory, experiment);
|
|
496
|
+
verifyExperimentDecisionIntegrity(experiment);
|
|
497
|
+
candidate = candidates.find((entry) => entry.id === championId);
|
|
498
|
+
if (!candidate)
|
|
499
|
+
throw new Error(`Champion candidate '${championId}' not found.`);
|
|
500
|
+
}
|
|
501
|
+
catch (error) {
|
|
502
|
+
throw new Errors.IncurError({
|
|
503
|
+
code: "EXPERIMENT_INTEGRITY_FAILED",
|
|
504
|
+
message: error instanceof Error ? error.message : String(error),
|
|
505
|
+
exitCode: 1,
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
await applyCandidate(experiment.subjectRoot, experiment.campaignSnapshot.subject, candidate);
|
|
509
|
+
return {
|
|
510
|
+
candidateId: candidate.id,
|
|
511
|
+
subjectRoot: experiment.subjectRoot,
|
|
512
|
+
sourceBytes: candidate.sourceBytes,
|
|
513
|
+
};
|
|
514
|
+
};
|
|
515
|
+
const reportCommand = async (experimentDir, options) => {
|
|
516
|
+
const directory = resolve(experimentDir);
|
|
517
|
+
if (!(await ensureDirectory("report", directory)))
|
|
518
|
+
failWith(1);
|
|
519
|
+
const snapshot = await loadVerifiedExperimentDecisionSnapshot(directory);
|
|
520
|
+
const { experiment, report } = snapshot;
|
|
521
|
+
if (!options.out)
|
|
522
|
+
return report;
|
|
523
|
+
const out = resolve(options.out);
|
|
524
|
+
const outputStats = await lstat(out).catch((error) => {
|
|
525
|
+
if (error.code === "ENOENT")
|
|
526
|
+
return null;
|
|
527
|
+
throw error;
|
|
435
528
|
});
|
|
529
|
+
if (outputStats && (outputStats.isSymbolicLink() || !outputStats.isFile())) {
|
|
530
|
+
throw new Error("An existing --out must be a regular, non-symlink file.");
|
|
531
|
+
}
|
|
532
|
+
const [physicalDirectory, physicalSubjectRoot, physicalOut] = await Promise.all([
|
|
533
|
+
realpath(directory),
|
|
534
|
+
realpath(experiment.subjectRoot),
|
|
535
|
+
physicalDestinationPath(out),
|
|
536
|
+
]);
|
|
537
|
+
assertReportDestination(physicalOut, physicalDirectory, physicalSubjectRoot, experiment.campaignSnapshot.subject.exclude);
|
|
538
|
+
if (outputStats && !options.force) {
|
|
539
|
+
throw new Error(`Output already exists (use --force): ${out}`);
|
|
540
|
+
}
|
|
541
|
+
await mkdir(dirname(out), { recursive: true });
|
|
542
|
+
const physicalParent = await realpath(dirname(out));
|
|
543
|
+
const finalPhysicalOut = resolve(physicalParent, basename(out));
|
|
544
|
+
assertReportDestination(finalPhysicalOut, physicalDirectory, physicalSubjectRoot, experiment.campaignSnapshot.subject.exclude);
|
|
545
|
+
await writeReportSafely(finalPhysicalOut, `${formatExperimentDecisionMarkdown(report)}\n`, options.force ?? false);
|
|
546
|
+
return { path: out, report };
|
|
436
547
|
};
|
|
437
|
-
|
|
438
|
-
const
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
.
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
548
|
+
const compareCommand = async (runA, runB, options) => {
|
|
549
|
+
const pathA = resolve(runA);
|
|
550
|
+
const pathB = resolve(runB);
|
|
551
|
+
const invalid = (await Promise.all([pathA, pathB].map(async (path) => existsSync(path) && (await stat(path)).isDirectory() ? undefined : path))).filter((path) => path !== undefined);
|
|
552
|
+
if (invalid.length > 0) {
|
|
553
|
+
throw new Errors.IncurError({
|
|
554
|
+
code: "RUN_DIRECTORY_NOT_FOUND",
|
|
555
|
+
message: invalid.map((path) => `${path} is not a directory`).join("; "),
|
|
556
|
+
exitCode: 1,
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
const [suiteA, suiteB] = await Promise.all([loadSuiteRun(pathA), loadSuiteRun(pathB)]);
|
|
560
|
+
if (Boolean(suiteA) !== Boolean(suiteB)) {
|
|
561
|
+
throw new Errors.IncurError({
|
|
562
|
+
code: "INCOMPATIBLE_RUN_TYPES",
|
|
563
|
+
message: "Both paths must be runs or both must be suites.",
|
|
564
|
+
exitCode: 1,
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
if (suiteA && suiteB) {
|
|
568
|
+
const comparison = await compareSuiteRuns(pathA, pathB, {
|
|
569
|
+
...(options.passRateTolerance !== undefined
|
|
570
|
+
? { passRateTolerance: options.passRateTolerance }
|
|
571
|
+
: {}),
|
|
572
|
+
});
|
|
573
|
+
if (hasSuiteRegression(comparison)) {
|
|
574
|
+
throw new Errors.IncurError({
|
|
575
|
+
code: "REGRESSION_DETECTED",
|
|
576
|
+
message: formatSuiteComparisonText(comparison),
|
|
577
|
+
exitCode: 1,
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
return comparison;
|
|
581
|
+
}
|
|
582
|
+
const comparison = await compareRuns({ pathA, pathB });
|
|
583
|
+
if (hasRegression(comparison)) {
|
|
584
|
+
throw new Errors.IncurError({
|
|
585
|
+
code: "REGRESSION_DETECTED",
|
|
586
|
+
message: formatComparisonText(comparison),
|
|
587
|
+
exitCode: 1,
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
return comparison;
|
|
448
591
|
};
|
|
449
|
-
const caseIdOf = (casePath) => basename(casePath, extname(casePath));
|
|
450
592
|
const SIGINT_EXIT_CODE = 130;
|
|
451
593
|
const physicalDestinationPath = async (path) => {
|
|
452
594
|
const suffix = [];
|
|
@@ -509,249 +651,240 @@ const resolveAuthoredFile = async (value, label) => {
|
|
|
509
651
|
*/
|
|
510
652
|
const isFailure = (outcome) => outcome.exitReason !== "done" || outcome.casePassed !== true;
|
|
511
653
|
const firstLine = (message) => (message.split("\n")[0] ?? message).trim();
|
|
512
|
-
const
|
|
513
|
-
const
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
654
|
+
const experimentCommand = async (mode, campaignPath, options) => {
|
|
655
|
+
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
656
|
+
try {
|
|
657
|
+
const cwd = process.cwd();
|
|
658
|
+
const config = await loadLuxConfig(cwd);
|
|
659
|
+
const campaign = await resolveExperimentCampaignPath(config.rootDir, campaignPath);
|
|
660
|
+
const loaded = await loadExperimentCampaign(campaign);
|
|
661
|
+
experimentCampaignMode(campaign, loaded.campaign, mode);
|
|
662
|
+
const registry = buildRegistryFromConfig(config);
|
|
663
|
+
const controller = __addDisposableResource(env_2, abortOnInterrupt(), false);
|
|
664
|
+
const execution = {
|
|
665
|
+
config,
|
|
666
|
+
registry,
|
|
667
|
+
loaded,
|
|
668
|
+
...(options.runsRoot ? { runsRoot: resolve(options.runsRoot) } : {}),
|
|
669
|
+
...(options.resume ? { resumeFrom: resolve(options.resume) } : {}),
|
|
670
|
+
abortSignal: controller.signal,
|
|
671
|
+
};
|
|
672
|
+
if (options.plan) {
|
|
673
|
+
const plan = await planExperimentCampaign(execution, mode);
|
|
674
|
+
if (!plan.fitsProjectedCallBudgets) {
|
|
675
|
+
throw new Errors.IncurError({
|
|
676
|
+
code: "EXPERIMENT_BUDGET_EXCEEDED",
|
|
677
|
+
message: "The projected experiment work exceeds its configured call budgets.",
|
|
678
|
+
exitCode: 1,
|
|
679
|
+
});
|
|
533
680
|
}
|
|
534
|
-
|
|
681
|
+
return plan;
|
|
682
|
+
}
|
|
683
|
+
const result = mode === "optimize"
|
|
684
|
+
? await optimizeExperimentCampaign(execution)
|
|
685
|
+
: await runExperimentCampaign(execution);
|
|
686
|
+
if (controller.signal.aborted)
|
|
687
|
+
failWith(SIGINT_EXIT_CODE);
|
|
688
|
+
if (result.manifest.status !== "passed") {
|
|
689
|
+
throw new Errors.IncurError({
|
|
690
|
+
code: "EXPERIMENT_FAILED",
|
|
691
|
+
message: `Experiment ${result.manifest.experimentId} finished with status '${result.manifest.status}'.`,
|
|
692
|
+
exitCode: 1,
|
|
693
|
+
});
|
|
535
694
|
}
|
|
695
|
+
return { experimentDir: result.experimentDir, ...result.manifest };
|
|
696
|
+
}
|
|
697
|
+
catch (e_2) {
|
|
698
|
+
env_2.error = e_2;
|
|
699
|
+
env_2.hasError = true;
|
|
700
|
+
}
|
|
701
|
+
finally {
|
|
702
|
+
__disposeResources(env_2);
|
|
536
703
|
}
|
|
537
|
-
return { explicit, patterns };
|
|
538
704
|
};
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
byPath.set(c.path, c);
|
|
548
|
-
}
|
|
549
|
-
else {
|
|
550
|
-
if (patterns.length > 0 || tags.length > 0) {
|
|
551
|
-
for (const c of selectCases(cases, { patterns, tags }))
|
|
552
|
-
byPath.set(c.path, c);
|
|
705
|
+
/** A profile pins one driver, so callers pass the project matrix only without one. */
|
|
706
|
+
const runCommand = async (filters, options, human = false) => {
|
|
707
|
+
const env_3 = { stack: [], error: void 0, hasError: false };
|
|
708
|
+
try {
|
|
709
|
+
if (options.interactive && options.claudeAnswerer) {
|
|
710
|
+
throw new Errors.ParseError({
|
|
711
|
+
message: "--interactive and --claude-answerer are mutually exclusive",
|
|
712
|
+
});
|
|
553
713
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
714
|
+
const cwd = process.cwd();
|
|
715
|
+
const config = await loadLuxConfig(cwd);
|
|
716
|
+
const profile = options.profile ? config.profiles?.[options.profile] : undefined;
|
|
717
|
+
if (options.profile && !profile) {
|
|
718
|
+
const available = Object.keys(config.profiles ?? {}).sort();
|
|
719
|
+
throw new Errors.IncurError({
|
|
720
|
+
code: "PROFILE_NOT_FOUND",
|
|
721
|
+
message: `Unknown profile '${options.profile}'${available.length > 0 ? `; available: ${available.join(", ")}` : ""}.`,
|
|
722
|
+
exitCode: 1,
|
|
563
723
|
});
|
|
564
724
|
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
abortSignal: controller.signal,
|
|
593
|
-
};
|
|
594
|
-
if (options.plan) {
|
|
595
|
-
const plan = await planExperimentCampaign(execution, mode);
|
|
596
|
-
let output;
|
|
597
|
-
if (options.json) {
|
|
598
|
-
output = `${JSON.stringify(plan, null, 2)}\n`;
|
|
725
|
+
const harness = profile?.harness ?? config.harness;
|
|
726
|
+
const registry = registryWithHarness(buildRegistryFromConfig(config), config, harness);
|
|
727
|
+
const defaultDriver = profile?.driver ?? config.defaultDriver;
|
|
728
|
+
const orchestrator = new Orchestrator({
|
|
729
|
+
environment: profile?.environment ?? config.environment,
|
|
730
|
+
registry,
|
|
731
|
+
defaultAnswerer: profile?.answerer ?? config.defaultAnswerer,
|
|
732
|
+
...(defaultDriver ? { defaultDriver } : {}),
|
|
733
|
+
...(harness ? { harness } : {}),
|
|
734
|
+
lifecycleFixtures: config.lifecycleFixtures,
|
|
735
|
+
});
|
|
736
|
+
const runsRoot = options.runsRoot ? resolve(options.runsRoot) : config.runsRoot;
|
|
737
|
+
const subjectRoot = options.subjectRoot ? resolve(options.subjectRoot) : config.subjectRoot;
|
|
738
|
+
// A config file is the user's opt-in to tree-wide discovery. Without one,
|
|
739
|
+
// stay scoped to the `cases/` scaffold: discovery imports every .ts it
|
|
740
|
+
// visits, and running module-level side effects across an arbitrary cwd
|
|
741
|
+
// must never be the default.
|
|
742
|
+
const root = config.casesRoot ?? (config.configPath ? config.rootDir : join(cwd, "cases"));
|
|
743
|
+
// A configured casesRoot is a path the user declared; its absence is a
|
|
744
|
+
// broken config, not an empty suite — never mask it behind "no cases
|
|
745
|
+
// matched" or a lucky explicit-file run.
|
|
746
|
+
if (config.casesRoot && !existsSync(config.casesRoot)) {
|
|
747
|
+
throw new Errors.IncurError({
|
|
748
|
+
code: "CASES_ROOT_NOT_FOUND",
|
|
749
|
+
message: `casesRoot does not exist: ${config.casesRoot}`,
|
|
750
|
+
exitCode: 1,
|
|
751
|
+
});
|
|
599
752
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
`
|
|
609
|
-
`
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
`proposal calls:${plan.projected.proposalCalls}/${plan.budget.maxProposalCalls}`,
|
|
613
|
-
`unpriced calls: observed at runtime (cap ${plan.budget.maxUnpricedModelCalls})`,
|
|
614
|
-
`projected work within budget: ${projectedStatus}`,
|
|
615
|
-
...plan.warnings.map((warning) => `warning: ${warning}`),
|
|
616
|
-
"",
|
|
617
|
-
].join("\n");
|
|
753
|
+
const { explicit, patterns } = partitionFilters(filters, cwd);
|
|
754
|
+
const tags = normalizeTags(options.tag ?? []);
|
|
755
|
+
const hasFilter = explicit.length > 0 || patterns.length > 0 || tags.length > 0;
|
|
756
|
+
// Explicitly named files need no discovery, so they run even without a
|
|
757
|
+
// project; anything else would need a tree walk with nowhere safe to walk.
|
|
758
|
+
if (config.configPath === null && !existsSync(root) && explicit.length === 0) {
|
|
759
|
+
throw new Errors.IncurError({
|
|
760
|
+
code: "PROJECT_NOT_INITIALIZED",
|
|
761
|
+
message: `No lux.config.ts or cases/ directory in ${cwd}.`,
|
|
762
|
+
hint: "Run `lux init` or name a case file directly.",
|
|
763
|
+
exitCode: 1,
|
|
764
|
+
});
|
|
618
765
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
if (options.interactive && options.claudeAnswerer) {
|
|
637
|
-
throw new Error("lux run: --interactive and --claude-answerer are mutually exclusive");
|
|
638
|
-
}
|
|
639
|
-
const cwd = process.cwd();
|
|
640
|
-
const config = await loadLuxConfig(cwd);
|
|
641
|
-
const profile = options.profile ? config.profiles?.[options.profile] : undefined;
|
|
642
|
-
if (options.profile && !profile) {
|
|
643
|
-
const available = Object.keys(config.profiles ?? {}).sort();
|
|
644
|
-
process.stderr.write(`lux: unknown profile '${options.profile}'${available.length > 0 ? `; available: ${available.join(", ")}` : ""}\n`);
|
|
645
|
-
failWith(1);
|
|
646
|
-
return;
|
|
647
|
-
}
|
|
648
|
-
const harness = profile?.harness ?? config.harness;
|
|
649
|
-
const registry = buildRegistryFromConfig(config).withAssertion(createRubricAssertion(harness));
|
|
650
|
-
const defaultDriver = profile?.driver ?? config.defaultDriver;
|
|
651
|
-
const orchestrator = new Orchestrator({
|
|
652
|
-
registry,
|
|
653
|
-
defaultAnswerer: profile?.answerer ?? config.defaultAnswerer,
|
|
654
|
-
...(defaultDriver ? { defaultDriver } : {}),
|
|
655
|
-
...(harness ? { harness } : {}),
|
|
656
|
-
lifecycleFixtures: config.lifecycleFixtures,
|
|
657
|
-
});
|
|
658
|
-
const runsRoot = options.runsRoot ? resolve(options.runsRoot) : config.runsRoot;
|
|
659
|
-
const subjectRoot = options.subjectRoot ? resolve(options.subjectRoot) : config.subjectRoot;
|
|
660
|
-
// A config file is the user's opt-in to tree-wide discovery. Without one,
|
|
661
|
-
// stay scoped to the `cases/` scaffold: discovery imports every .ts it
|
|
662
|
-
// visits, and running module-level side effects across an arbitrary cwd
|
|
663
|
-
// must never be the default.
|
|
664
|
-
const root = config.casesRoot ?? (config.configPath ? config.rootDir : join(cwd, "cases"));
|
|
665
|
-
// A configured casesRoot is a path the user declared; its absence is a
|
|
666
|
-
// broken config, not an empty suite — never mask it behind "no cases
|
|
667
|
-
// matched" or a lucky explicit-file run.
|
|
668
|
-
if (config.casesRoot && !existsSync(config.casesRoot)) {
|
|
669
|
-
process.stderr.write(`lux: casesRoot does not exist: ${config.casesRoot}\n`);
|
|
670
|
-
failWith(1);
|
|
671
|
-
return;
|
|
672
|
-
}
|
|
673
|
-
const { explicit, patterns } = partitionFilters(filters, cwd);
|
|
674
|
-
const tags = options.tag ?? [];
|
|
675
|
-
const hasFilter = explicit.length > 0 || patterns.length > 0 || tags.length > 0;
|
|
676
|
-
// Explicitly named files need no discovery, so they run even without a
|
|
677
|
-
// project; anything else would need a tree walk with nowhere safe to walk.
|
|
678
|
-
if (config.configPath === null && !existsSync(root) && explicit.length === 0) {
|
|
679
|
-
process.stderr.write(`lux: no lux.config.ts or cases/ directory in ${cwd} — run \`lux init\` to scaffold a project, or name a case file directly\n`);
|
|
680
|
-
failWith(1);
|
|
681
|
-
return;
|
|
682
|
-
}
|
|
683
|
-
const { cases, problems } = existsSync(root)
|
|
684
|
-
? await discoverCases(root)
|
|
685
|
-
: { cases: [], problems: [] };
|
|
686
|
-
for (const problem of problems) {
|
|
687
|
-
process.stderr.write(`lux: skipped ${problem.path}: ${firstLine(problem.reason)}\n`);
|
|
688
|
-
}
|
|
689
|
-
const selected = selectSuite(cases, { explicit, patterns }, tags);
|
|
690
|
-
// An empty selection fails every mode the same way — running, `--list`, and
|
|
691
|
-
// `--list-tags` all exit 1, so a typo'd filter can never read as a clean pass.
|
|
692
|
-
if (selected.length === 0) {
|
|
693
|
-
process.stderr.write(hasFilter
|
|
694
|
-
? "lux: no cases matched the given filters\n"
|
|
695
|
-
: `lux: no cases discovered under ${root}\n`);
|
|
696
|
-
failWith(1);
|
|
697
|
-
return;
|
|
698
|
-
}
|
|
699
|
-
// List the tag vocabulary of the selected cases — "which --tag values exist?".
|
|
700
|
-
if (options.listTags) {
|
|
701
|
-
const counts = new Map();
|
|
702
|
-
for (const c of selected)
|
|
703
|
-
for (const t of c.tags)
|
|
704
|
-
counts.set(t, (counts.get(t) ?? 0) + 1);
|
|
705
|
-
for (const [tag, n] of [...counts].sort((a, b) => a[0].localeCompare(b[0]))) {
|
|
706
|
-
process.stdout.write(`${tag}\t${n}\n`);
|
|
766
|
+
const { cases, problems } = existsSync(root)
|
|
767
|
+
? await discoverCases(root)
|
|
768
|
+
: { cases: [], problems: [] };
|
|
769
|
+
for (const problem of problems) {
|
|
770
|
+
process.stderr.write(`lux: skipped ${problem.path}: ${firstLine(problem.reason)}\n`);
|
|
771
|
+
}
|
|
772
|
+
const selected = selectSuite(cases, { explicit, patterns }, tags);
|
|
773
|
+
// An empty selection fails every mode the same way — running, `--list`, and
|
|
774
|
+
// `--list-tags` all exit 1, so a typo'd filter can never read as a clean pass.
|
|
775
|
+
if (selected.length === 0) {
|
|
776
|
+
throw new Errors.IncurError({
|
|
777
|
+
code: "NO_CASES_MATCHED",
|
|
778
|
+
message: hasFilter
|
|
779
|
+
? "No cases matched the given filters."
|
|
780
|
+
: `No cases were discovered under ${root}.`,
|
|
781
|
+
exitCode: 1,
|
|
782
|
+
});
|
|
707
783
|
}
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
784
|
+
// List the tag vocabulary of the selected cases — "which --tag values exist?".
|
|
785
|
+
if (options.listTags) {
|
|
786
|
+
const counts = new Map();
|
|
787
|
+
for (const c of selected)
|
|
788
|
+
for (const t of c.tags)
|
|
789
|
+
counts.set(t, (counts.get(t) ?? 0) + 1);
|
|
790
|
+
const result = {
|
|
791
|
+
caseCount: selected.length,
|
|
792
|
+
tags: [...counts]
|
|
793
|
+
.sort((a, b) => a[0].localeCompare(b[0]))
|
|
794
|
+
.map(([tag, count]) => ({ tag, count })),
|
|
795
|
+
};
|
|
796
|
+
if (human)
|
|
797
|
+
process.stdout.write(`${result.caseCount} cases\n${result.tags.map(({ tag, count }) => ` ${tag}: ${count}`).join("\n")}\n`);
|
|
798
|
+
return result;
|
|
799
|
+
}
|
|
800
|
+
const focus = {
|
|
801
|
+
driver: options.driver,
|
|
802
|
+
model: options.model,
|
|
803
|
+
effort: options.effort,
|
|
804
|
+
};
|
|
805
|
+
const base = await planSuiteItems(selected, {
|
|
806
|
+
matrix: profile ? undefined : config.matrix,
|
|
807
|
+
defaultDriver,
|
|
808
|
+
registry,
|
|
809
|
+
focus,
|
|
810
|
+
});
|
|
811
|
+
// Collect-only: answer "what would run?" without spawning a single agent.
|
|
812
|
+
if (options.list) {
|
|
813
|
+
if (human)
|
|
814
|
+
process.stdout.write(`${base.length} cases\n${base.map(({ id, path }) => ` ${id} ${path}`).join("\n")}\n`);
|
|
815
|
+
return {
|
|
816
|
+
caseCount: base.length,
|
|
817
|
+
cases: base.map(({ path, id, caseId, permutationId }) => ({
|
|
818
|
+
path,
|
|
819
|
+
id,
|
|
820
|
+
...(caseId !== undefined ? { caseId } : {}),
|
|
821
|
+
...(permutationId !== undefined ? { permutationId } : {}),
|
|
822
|
+
})),
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
const loop = options.loop ?? 1;
|
|
826
|
+
const items = expandLoop(base, loop);
|
|
827
|
+
const { concurrency, note } = resolveConcurrency(options, config.concurrency);
|
|
828
|
+
if (note)
|
|
829
|
+
process.stderr.write(note);
|
|
830
|
+
const reporter = human ? new ConsoleReporter({ verbose: options.verbose ?? false }) : undefined;
|
|
831
|
+
const controller = __addDisposableResource(env_3, abortOnInterrupt(), false);
|
|
832
|
+
reporter?.begin({
|
|
833
|
+
title: suiteTitle(patterns, tags, explicit, loop, focus),
|
|
834
|
+
caseIds: items.map((i) => i.id),
|
|
735
835
|
runsRoot,
|
|
736
|
-
|
|
737
|
-
answererOverride: resolveAnswererOverride(options),
|
|
738
|
-
observer: reporter,
|
|
739
|
-
abortSignal: controller.signal,
|
|
740
|
-
concurrency,
|
|
741
|
-
subjectRoot,
|
|
742
|
-
profileId: options.profile,
|
|
836
|
+
loop,
|
|
743
837
|
});
|
|
744
|
-
results =
|
|
745
|
-
|
|
838
|
+
let results = [];
|
|
839
|
+
try {
|
|
840
|
+
const suite = await orchestrator.runSuite(items, {
|
|
841
|
+
runsRoot,
|
|
842
|
+
fixturesRoot: config.fixturesRoot,
|
|
843
|
+
answererOverride: resolveAnswererOverride(options),
|
|
844
|
+
skipJudge: options.skipJudge,
|
|
845
|
+
...(reporter ? { observer: reporter } : {}),
|
|
846
|
+
abortSignal: controller.signal,
|
|
847
|
+
concurrency,
|
|
848
|
+
subjectRoot,
|
|
849
|
+
profileId: options.profile,
|
|
850
|
+
});
|
|
851
|
+
results = suite.results;
|
|
852
|
+
reporter?.setSuiteDir(suite.suiteDir);
|
|
853
|
+
if (controller.signal.aborted)
|
|
854
|
+
failWith(SIGINT_EXIT_CODE);
|
|
855
|
+
if (results.some(isFailure)) {
|
|
856
|
+
throw new Errors.IncurError({
|
|
857
|
+
code: "SUITE_FAILED",
|
|
858
|
+
message: `${results.filter(isFailure).length} of ${results.length} case attempts failed. Suite: ${suite.suiteDir}`,
|
|
859
|
+
exitCode: 1,
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
return {
|
|
863
|
+
suiteDir: suite.suiteDir,
|
|
864
|
+
results: results.map((result) => ({
|
|
865
|
+
caseId: result.caseId,
|
|
866
|
+
runDir: result.runDir ?? null,
|
|
867
|
+
exitReason: result.exitReason,
|
|
868
|
+
casePassed: result.casePassed,
|
|
869
|
+
caseScore: result.result?.grading?.caseScore ?? null,
|
|
870
|
+
assertionsPassed: result.result?.grading?.assertions.filter((assertion) => assertion.passed).length ?? 0,
|
|
871
|
+
assertionsTotal: result.result?.grading?.assertions.filter((assertion) => assertion.passed !== null)
|
|
872
|
+
.length ?? 0,
|
|
873
|
+
})),
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
finally {
|
|
877
|
+
reporter?.finish();
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
catch (e_3) {
|
|
881
|
+
env_3.error = e_3;
|
|
882
|
+
env_3.hasError = true;
|
|
746
883
|
}
|
|
747
884
|
finally {
|
|
748
|
-
|
|
885
|
+
__disposeResources(env_3);
|
|
749
886
|
}
|
|
750
|
-
if (controller.signal.aborted)
|
|
751
|
-
failWith(SIGINT_EXIT_CODE);
|
|
752
|
-
else if (results.some(isFailure))
|
|
753
|
-
failWith(1);
|
|
754
887
|
};
|
|
755
888
|
// Internal exports for testing
|
|
756
|
-
export {
|
|
889
|
+
export { isFailure, resolveConcurrency };
|
|
757
890
|
//# sourceMappingURL=program.js.map
|