@prismatic-io/lux 0.0.1
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/LICENSE +21 -0
- package/lib/answerers/claude-code/index.d.ts +17 -0
- package/lib/answerers/claude-code/index.d.ts.map +1 -0
- package/lib/answerers/claude-code/index.js +280 -0
- package/lib/answerers/claude-code/index.js.map +1 -0
- package/lib/answerers/persona/index.d.ts +40 -0
- package/lib/answerers/persona/index.d.ts.map +1 -0
- package/lib/answerers/persona/index.js +265 -0
- package/lib/answerers/persona/index.js.map +1 -0
- package/lib/answerers/scripted/index.d.ts +8 -0
- package/lib/answerers/scripted/index.d.ts.map +1 -0
- package/lib/answerers/scripted/index.js +163 -0
- package/lib/answerers/scripted/index.js.map +1 -0
- package/lib/answerers/shared.d.ts +13 -0
- package/lib/answerers/shared.d.ts.map +1 -0
- package/lib/answerers/shared.js +17 -0
- package/lib/answerers/shared.js.map +1 -0
- package/lib/answerers/terminal/index.d.ts +9 -0
- package/lib/answerers/terminal/index.d.ts.map +1 -0
- package/lib/answerers/terminal/index.js +97 -0
- package/lib/answerers/terminal/index.js.map +1 -0
- package/lib/assertions/core/command-exits-zero.d.ts +21 -0
- package/lib/assertions/core/command-exits-zero.d.ts.map +1 -0
- package/lib/assertions/core/command-exits-zero.js +87 -0
- package/lib/assertions/core/command-exits-zero.js.map +1 -0
- package/lib/assertions/core/event-checks.d.ts +57 -0
- package/lib/assertions/core/event-checks.d.ts.map +1 -0
- package/lib/assertions/core/event-checks.js +123 -0
- package/lib/assertions/core/event-checks.js.map +1 -0
- package/lib/assertions/core/file-checks.d.ts +103 -0
- package/lib/assertions/core/file-checks.d.ts.map +1 -0
- package/lib/assertions/core/file-checks.js +288 -0
- package/lib/assertions/core/file-checks.js.map +1 -0
- package/lib/assertions/core/helpers.d.ts +66 -0
- package/lib/assertions/core/helpers.d.ts.map +1 -0
- package/lib/assertions/core/helpers.js +170 -0
- package/lib/assertions/core/helpers.js.map +1 -0
- package/lib/assertions/core/index.d.ts +15 -0
- package/lib/assertions/core/index.d.ts.map +1 -0
- package/lib/assertions/core/index.js +56 -0
- package/lib/assertions/core/index.js.map +1 -0
- package/lib/assertions/core/json-pointer-equals.d.ts +19 -0
- package/lib/assertions/core/json-pointer-equals.d.ts.map +1 -0
- package/lib/assertions/core/json-pointer-equals.js +71 -0
- package/lib/assertions/core/json-pointer-equals.js.map +1 -0
- package/lib/assertions/core/output-checks.d.ts +46 -0
- package/lib/assertions/core/output-checks.d.ts.map +1 -0
- package/lib/assertions/core/output-checks.js +121 -0
- package/lib/assertions/core/output-checks.js.map +1 -0
- package/lib/assertions/core/predicate.d.ts +14 -0
- package/lib/assertions/core/predicate.d.ts.map +1 -0
- package/lib/assertions/core/predicate.js +55 -0
- package/lib/assertions/core/predicate.js.map +1 -0
- package/lib/assertions/core/resource-checks.d.ts +71 -0
- package/lib/assertions/core/resource-checks.d.ts.map +1 -0
- package/lib/assertions/core/resource-checks.js +159 -0
- package/lib/assertions/core/resource-checks.js.map +1 -0
- package/lib/assertions/core/safe-regex.d.ts +23 -0
- package/lib/assertions/core/safe-regex.d.ts.map +1 -0
- package/lib/assertions/core/safe-regex.js +102 -0
- package/lib/assertions/core/safe-regex.js.map +1 -0
- package/lib/assertions/core/tool-called-with.d.ts +21 -0
- package/lib/assertions/core/tool-called-with.d.ts.map +1 -0
- package/lib/assertions/core/tool-called-with.js +69 -0
- package/lib/assertions/core/tool-called-with.js.map +1 -0
- package/lib/assertions/core/tool-calls.d.ts +22 -0
- package/lib/assertions/core/tool-calls.d.ts.map +1 -0
- package/lib/assertions/core/tool-calls.js +17 -0
- package/lib/assertions/core/tool-calls.js.map +1 -0
- package/lib/assertions/core/tool-invocation.d.ts +36 -0
- package/lib/assertions/core/tool-invocation.d.ts.map +1 -0
- package/lib/assertions/core/tool-invocation.js +170 -0
- package/lib/assertions/core/tool-invocation.js.map +1 -0
- package/lib/assertions/core/tool-result-checks.d.ts +59 -0
- package/lib/assertions/core/tool-result-checks.d.ts.map +1 -0
- package/lib/assertions/core/tool-result-checks.js +193 -0
- package/lib/assertions/core/tool-result-checks.js.map +1 -0
- package/lib/assertions/mcp/discovery-checks.d.ts +36 -0
- package/lib/assertions/mcp/discovery-checks.d.ts.map +1 -0
- package/lib/assertions/mcp/discovery-checks.js +122 -0
- package/lib/assertions/mcp/discovery-checks.js.map +1 -0
- package/lib/assertions/mcp/index.d.ts +10 -0
- package/lib/assertions/mcp/index.d.ts.map +1 -0
- package/lib/assertions/mcp/index.js +25 -0
- package/lib/assertions/mcp/index.js.map +1 -0
- package/lib/assertions/rubric/index.d.ts +104 -0
- package/lib/assertions/rubric/index.d.ts.map +1 -0
- package/lib/assertions/rubric/index.js +191 -0
- package/lib/assertions/rubric/index.js.map +1 -0
- package/lib/assertions/rubric/internal.d.ts +14 -0
- package/lib/assertions/rubric/internal.d.ts.map +1 -0
- package/lib/assertions/rubric/internal.js +335 -0
- package/lib/assertions/rubric/internal.js.map +1 -0
- package/lib/authoring.d.ts +3 -0
- package/lib/authoring.d.ts.map +1 -0
- package/lib/authoring.js +3 -0
- package/lib/authoring.js.map +1 -0
- package/lib/cli/bin.d.ts +3 -0
- package/lib/cli/bin.d.ts.map +1 -0
- package/lib/cli/bin.js +15 -0
- package/lib/cli/bin.js.map +1 -0
- package/lib/cli/command-runtime.d.ts +5 -0
- package/lib/cli/command-runtime.d.ts.map +1 -0
- package/lib/cli/command-runtime.js +30 -0
- package/lib/cli/command-runtime.js.map +1 -0
- package/lib/cli/init.d.ts +21 -0
- package/lib/cli/init.d.ts.map +1 -0
- package/lib/cli/init.js +340 -0
- package/lib/cli/init.js.map +1 -0
- package/lib/cli/program.d.ts +22 -0
- package/lib/cli/program.d.ts.map +1 -0
- package/lib/cli/program.js +757 -0
- package/lib/cli/program.js.map +1 -0
- package/lib/cli/render/format.d.ts +14 -0
- package/lib/cli/render/format.d.ts.map +1 -0
- package/lib/cli/render/format.js +71 -0
- package/lib/cli/render/format.js.map +1 -0
- package/lib/cli/render/reporter.d.ts +73 -0
- package/lib/cli/render/reporter.d.ts.map +1 -0
- package/lib/cli/render/reporter.js +519 -0
- package/lib/cli/render/reporter.js.map +1 -0
- package/lib/cli/render/tty.d.ts +77 -0
- package/lib/cli/render/tty.d.ts.map +1 -0
- package/lib/cli/render/tty.js +283 -0
- package/lib/cli/render/tty.js.map +1 -0
- package/lib/cli/run-options.d.ts +27 -0
- package/lib/cli/run-options.d.ts.map +1 -0
- package/lib/cli/run-options.js +58 -0
- package/lib/cli/run-options.js.map +1 -0
- package/lib/cli/skills.d.ts +38 -0
- package/lib/cli/skills.d.ts.map +1 -0
- package/lib/cli/skills.js +84 -0
- package/lib/cli/skills.js.map +1 -0
- package/lib/core/annotation.d.ts +56 -0
- package/lib/core/annotation.d.ts.map +1 -0
- package/lib/core/annotation.js +92 -0
- package/lib/core/annotation.js.map +1 -0
- package/lib/core/answerer.d.ts +68 -0
- package/lib/core/answerer.d.ts.map +1 -0
- package/lib/core/answerer.js +17 -0
- package/lib/core/answerer.js.map +1 -0
- package/lib/core/artifact-evidence.d.ts +50 -0
- package/lib/core/artifact-evidence.d.ts.map +1 -0
- package/lib/core/artifact-evidence.js +185 -0
- package/lib/core/artifact-evidence.js.map +1 -0
- package/lib/core/artifact-snapshot.d.ts +37 -0
- package/lib/core/artifact-snapshot.d.ts.map +1 -0
- package/lib/core/artifact-snapshot.js +339 -0
- package/lib/core/artifact-snapshot.js.map +1 -0
- package/lib/core/assertion.d.ts +129 -0
- package/lib/core/assertion.d.ts.map +1 -0
- package/lib/core/assertion.js +75 -0
- package/lib/core/assertion.js.map +1 -0
- package/lib/core/case.d.ts +79 -0
- package/lib/core/case.d.ts.map +1 -0
- package/lib/core/case.js +90 -0
- package/lib/core/case.js.map +1 -0
- package/lib/core/conversation-turn.d.ts +23 -0
- package/lib/core/conversation-turn.d.ts.map +1 -0
- package/lib/core/conversation-turn.js +31 -0
- package/lib/core/conversation-turn.js.map +1 -0
- package/lib/core/driver.d.ts +64 -0
- package/lib/core/driver.d.ts.map +1 -0
- package/lib/core/driver.js +18 -0
- package/lib/core/driver.js.map +1 -0
- package/lib/core/emitter.d.ts +20 -0
- package/lib/core/emitter.d.ts.map +1 -0
- package/lib/core/emitter.js +34 -0
- package/lib/core/emitter.js.map +1 -0
- package/lib/core/events.d.ts +202 -0
- package/lib/core/events.d.ts.map +1 -0
- package/lib/core/events.js +107 -0
- package/lib/core/events.js.map +1 -0
- package/lib/core/exec.d.ts +82 -0
- package/lib/core/exec.d.ts.map +1 -0
- package/lib/core/exec.js +168 -0
- package/lib/core/exec.js.map +1 -0
- package/lib/core/experiment.d.ts +285 -0
- package/lib/core/experiment.d.ts.map +1 -0
- package/lib/core/experiment.js +389 -0
- package/lib/core/experiment.js.map +1 -0
- package/lib/core/glob.d.ts +3 -0
- package/lib/core/glob.d.ts.map +1 -0
- package/lib/core/glob.js +32 -0
- package/lib/core/glob.js.map +1 -0
- package/lib/core/hash.d.ts +8 -0
- package/lib/core/hash.d.ts.map +1 -0
- package/lib/core/hash.js +214 -0
- package/lib/core/hash.js.map +1 -0
- package/lib/core/index.d.ts +29 -0
- package/lib/core/index.d.ts.map +1 -0
- package/lib/core/index.js +29 -0
- package/lib/core/index.js.map +1 -0
- package/lib/core/lifecycle-fixtures.d.ts +20 -0
- package/lib/core/lifecycle-fixtures.d.ts.map +1 -0
- package/lib/core/lifecycle-fixtures.js +109 -0
- package/lib/core/lifecycle-fixtures.js.map +1 -0
- package/lib/core/lifecycle-hooks.d.ts +52 -0
- package/lib/core/lifecycle-hooks.d.ts.map +1 -0
- package/lib/core/lifecycle-hooks.js +42 -0
- package/lib/core/lifecycle-hooks.js.map +1 -0
- package/lib/core/mcp-events.d.ts +44 -0
- package/lib/core/mcp-events.d.ts.map +1 -0
- package/lib/core/mcp-events.js +23 -0
- package/lib/core/mcp-events.js.map +1 -0
- package/lib/core/model-cli.d.ts +57 -0
- package/lib/core/model-cli.d.ts.map +1 -0
- package/lib/core/model-cli.js +237 -0
- package/lib/core/model-cli.js.map +1 -0
- package/lib/core/observer.d.ts +31 -0
- package/lib/core/observer.d.ts.map +1 -0
- package/lib/core/observer.js +25 -0
- package/lib/core/observer.js.map +1 -0
- package/lib/core/platform-process.d.ts +33 -0
- package/lib/core/platform-process.d.ts.map +1 -0
- package/lib/core/platform-process.js +214 -0
- package/lib/core/platform-process.js.map +1 -0
- package/lib/core/registry.d.ts +22 -0
- package/lib/core/registry.d.ts.map +1 -0
- package/lib/core/registry.js +45 -0
- package/lib/core/registry.js.map +1 -0
- package/lib/core/rubric.d.ts +18 -0
- package/lib/core/rubric.d.ts.map +1 -0
- package/lib/core/rubric.js +49 -0
- package/lib/core/rubric.js.map +1 -0
- package/lib/core/run.d.ts +419 -0
- package/lib/core/run.d.ts.map +1 -0
- package/lib/core/run.js +126 -0
- package/lib/core/run.js.map +1 -0
- package/lib/core/statistics.d.ts +39 -0
- package/lib/core/statistics.d.ts.map +1 -0
- package/lib/core/statistics.js +163 -0
- package/lib/core/statistics.js.map +1 -0
- package/lib/core/subject.d.ts +4 -0
- package/lib/core/subject.d.ts.map +1 -0
- package/lib/core/subject.js +46 -0
- package/lib/core/subject.js.map +1 -0
- package/lib/core/tool-events.d.ts +69 -0
- package/lib/core/tool-events.d.ts.map +1 -0
- package/lib/core/tool-events.js +242 -0
- package/lib/core/tool-events.js.map +1 -0
- package/lib/core/usage.d.ts +78 -0
- package/lib/core/usage.d.ts.map +1 -0
- package/lib/core/usage.js +104 -0
- package/lib/core/usage.js.map +1 -0
- package/lib/core/wire.d.ts +83 -0
- package/lib/core/wire.d.ts.map +1 -0
- package/lib/core/wire.js +101 -0
- package/lib/core/wire.js.map +1 -0
- package/lib/core/zod.d.ts +10 -0
- package/lib/core/zod.d.ts.map +1 -0
- package/lib/core/zod.js +18 -0
- package/lib/core/zod.js.map +1 -0
- package/lib/drivers/claude-code/index.d.ts +55 -0
- package/lib/drivers/claude-code/index.d.ts.map +1 -0
- package/lib/drivers/claude-code/index.js +779 -0
- package/lib/drivers/claude-code/index.js.map +1 -0
- package/lib/drivers/claude-code/parse-events.d.ts +46 -0
- package/lib/drivers/claude-code/parse-events.d.ts.map +1 -0
- package/lib/drivers/claude-code/parse-events.js +387 -0
- package/lib/drivers/claude-code/parse-events.js.map +1 -0
- package/lib/drivers/codex/app-events.d.ts +16 -0
- package/lib/drivers/codex/app-events.d.ts.map +1 -0
- package/lib/drivers/codex/app-events.js +184 -0
- package/lib/drivers/codex/app-events.js.map +1 -0
- package/lib/drivers/codex/config.d.ts +55 -0
- package/lib/drivers/codex/config.d.ts.map +1 -0
- package/lib/drivers/codex/config.js +125 -0
- package/lib/drivers/codex/config.js.map +1 -0
- package/lib/drivers/codex/index.d.ts +8 -0
- package/lib/drivers/codex/index.d.ts.map +1 -0
- package/lib/drivers/codex/index.js +904 -0
- package/lib/drivers/codex/index.js.map +1 -0
- package/lib/drivers/mcp/index.d.ts +52 -0
- package/lib/drivers/mcp/index.d.ts.map +1 -0
- package/lib/drivers/mcp/index.js +282 -0
- package/lib/drivers/mcp/index.js.map +1 -0
- package/lib/drivers/mcp/transport.d.ts +50 -0
- package/lib/drivers/mcp/transport.d.ts.map +1 -0
- package/lib/drivers/mcp/transport.js +190 -0
- package/lib/drivers/mcp/transport.js.map +1 -0
- package/lib/drivers/shared/artifacts.d.ts +4 -0
- package/lib/drivers/shared/artifacts.d.ts.map +1 -0
- package/lib/drivers/shared/artifacts.js +81 -0
- package/lib/drivers/shared/artifacts.js.map +1 -0
- package/lib/drivers/shared/secure-copy.d.ts +2 -0
- package/lib/drivers/shared/secure-copy.d.ts.map +1 -0
- package/lib/drivers/shared/secure-copy.js +35 -0
- package/lib/drivers/shared/secure-copy.js.map +1 -0
- package/lib/drivers/subprocess/index.d.ts +24 -0
- package/lib/drivers/subprocess/index.d.ts.map +1 -0
- package/lib/drivers/subprocess/index.js +451 -0
- package/lib/drivers/subprocess/index.js.map +1 -0
- package/lib/index.d.ts +40 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +48 -0
- package/lib/index.js.map +1 -0
- package/lib/optimization/reflective.d.ts +27 -0
- package/lib/optimization/reflective.d.ts.map +1 -0
- package/lib/optimization/reflective.js +257 -0
- package/lib/optimization/reflective.js.map +1 -0
- package/lib/orchestrator/annotation-loader.d.ts +65 -0
- package/lib/orchestrator/annotation-loader.d.ts.map +1 -0
- package/lib/orchestrator/annotation-loader.js +73 -0
- package/lib/orchestrator/annotation-loader.js.map +1 -0
- package/lib/orchestrator/annotation-store.d.ts +3 -0
- package/lib/orchestrator/annotation-store.d.ts.map +1 -0
- package/lib/orchestrator/annotation-store.js +100 -0
- package/lib/orchestrator/annotation-store.js.map +1 -0
- package/lib/orchestrator/authored-dependencies.d.ts +3 -0
- package/lib/orchestrator/authored-dependencies.d.ts.map +1 -0
- package/lib/orchestrator/authored-dependencies.js +146 -0
- package/lib/orchestrator/authored-dependencies.js.map +1 -0
- package/lib/orchestrator/campaign-lifecycle.d.ts +105 -0
- package/lib/orchestrator/campaign-lifecycle.d.ts.map +1 -0
- package/lib/orchestrator/campaign-lifecycle.js +141 -0
- package/lib/orchestrator/campaign-lifecycle.js.map +1 -0
- package/lib/orchestrator/candidate-integrity.d.ts +4 -0
- package/lib/orchestrator/candidate-integrity.d.ts.map +1 -0
- package/lib/orchestrator/candidate-integrity.js +14 -0
- package/lib/orchestrator/candidate-integrity.js.map +1 -0
- package/lib/orchestrator/candidates.d.ts +13 -0
- package/lib/orchestrator/candidates.d.ts.map +1 -0
- package/lib/orchestrator/candidates.js +577 -0
- package/lib/orchestrator/candidates.js.map +1 -0
- package/lib/orchestrator/compare.d.ts +80 -0
- package/lib/orchestrator/compare.d.ts.map +1 -0
- package/lib/orchestrator/compare.js +270 -0
- package/lib/orchestrator/compare.js.map +1 -0
- package/lib/orchestrator/comparison-identity.d.ts +10 -0
- package/lib/orchestrator/comparison-identity.d.ts.map +1 -0
- package/lib/orchestrator/comparison-identity.js +39 -0
- package/lib/orchestrator/comparison-identity.js.map +1 -0
- package/lib/orchestrator/config.d.ts +121 -0
- package/lib/orchestrator/config.d.ts.map +1 -0
- package/lib/orchestrator/config.js +176 -0
- package/lib/orchestrator/config.js.map +1 -0
- package/lib/orchestrator/content-bound-json.d.ts +5 -0
- package/lib/orchestrator/content-bound-json.d.ts.map +1 -0
- package/lib/orchestrator/content-bound-json.js +59 -0
- package/lib/orchestrator/content-bound-json.js.map +1 -0
- package/lib/orchestrator/discover.d.ts +45 -0
- package/lib/orchestrator/discover.d.ts.map +1 -0
- package/lib/orchestrator/discover.js +98 -0
- package/lib/orchestrator/discover.js.map +1 -0
- package/lib/orchestrator/doctor.d.ts +141 -0
- package/lib/orchestrator/doctor.d.ts.map +1 -0
- package/lib/orchestrator/doctor.js +525 -0
- package/lib/orchestrator/doctor.js.map +1 -0
- package/lib/orchestrator/driver-session.d.ts +177 -0
- package/lib/orchestrator/driver-session.d.ts.map +1 -0
- package/lib/orchestrator/driver-session.js +396 -0
- package/lib/orchestrator/driver-session.js.map +1 -0
- package/lib/orchestrator/evaluator-identity.d.ts +7 -0
- package/lib/orchestrator/evaluator-identity.d.ts.map +1 -0
- package/lib/orchestrator/evaluator-identity.js +42 -0
- package/lib/orchestrator/evaluator-identity.js.map +1 -0
- package/lib/orchestrator/experiment-budget.d.ts +11 -0
- package/lib/orchestrator/experiment-budget.d.ts.map +1 -0
- package/lib/orchestrator/experiment-budget.js +51 -0
- package/lib/orchestrator/experiment-budget.js.map +1 -0
- package/lib/orchestrator/experiment-context.d.ts +43 -0
- package/lib/orchestrator/experiment-context.d.ts.map +1 -0
- package/lib/orchestrator/experiment-context.js +9 -0
- package/lib/orchestrator/experiment-context.js.map +1 -0
- package/lib/orchestrator/experiment-contracts.d.ts +290 -0
- package/lib/orchestrator/experiment-contracts.d.ts.map +1 -0
- package/lib/orchestrator/experiment-contracts.js +38 -0
- package/lib/orchestrator/experiment-contracts.js.map +1 -0
- package/lib/orchestrator/experiment-corpus.d.ts +21 -0
- package/lib/orchestrator/experiment-corpus.d.ts.map +1 -0
- package/lib/orchestrator/experiment-corpus.js +276 -0
- package/lib/orchestrator/experiment-corpus.js.map +1 -0
- package/lib/orchestrator/experiment-evaluation.d.ts +44 -0
- package/lib/orchestrator/experiment-evaluation.d.ts.map +1 -0
- package/lib/orchestrator/experiment-evaluation.js +542 -0
- package/lib/orchestrator/experiment-evaluation.js.map +1 -0
- package/lib/orchestrator/experiment-finish.d.ts +6 -0
- package/lib/orchestrator/experiment-finish.d.ts.map +1 -0
- package/lib/orchestrator/experiment-finish.js +19 -0
- package/lib/orchestrator/experiment-finish.js.map +1 -0
- package/lib/orchestrator/experiment-identity.d.ts +6 -0
- package/lib/orchestrator/experiment-identity.d.ts.map +1 -0
- package/lib/orchestrator/experiment-identity.js +257 -0
- package/lib/orchestrator/experiment-identity.js.map +1 -0
- package/lib/orchestrator/experiment-loader.d.ts +175 -0
- package/lib/orchestrator/experiment-loader.d.ts.map +1 -0
- package/lib/orchestrator/experiment-loader.js +77 -0
- package/lib/orchestrator/experiment-loader.js.map +1 -0
- package/lib/orchestrator/experiment-report.d.ts +450 -0
- package/lib/orchestrator/experiment-report.d.ts.map +1 -0
- package/lib/orchestrator/experiment-report.js +570 -0
- package/lib/orchestrator/experiment-report.js.map +1 -0
- package/lib/orchestrator/experiment-runs.d.ts +379 -0
- package/lib/orchestrator/experiment-runs.d.ts.map +1 -0
- package/lib/orchestrator/experiment-runs.js +796 -0
- package/lib/orchestrator/experiment-runs.js.map +1 -0
- package/lib/orchestrator/experiment-runtime-identity.d.ts +41 -0
- package/lib/orchestrator/experiment-runtime-identity.d.ts.map +1 -0
- package/lib/orchestrator/experiment-runtime-identity.js +411 -0
- package/lib/orchestrator/experiment-runtime-identity.js.map +1 -0
- package/lib/orchestrator/experiment-selection.d.ts +25 -0
- package/lib/orchestrator/experiment-selection.d.ts.map +1 -0
- package/lib/orchestrator/experiment-selection.js +286 -0
- package/lib/orchestrator/experiment-selection.js.map +1 -0
- package/lib/orchestrator/experiment.d.ts +11 -0
- package/lib/orchestrator/experiment.d.ts.map +1 -0
- package/lib/orchestrator/experiment.js +639 -0
- package/lib/orchestrator/experiment.js.map +1 -0
- package/lib/orchestrator/fixture-identity.d.ts +7 -0
- package/lib/orchestrator/fixture-identity.d.ts.map +1 -0
- package/lib/orchestrator/fixture-identity.js +55 -0
- package/lib/orchestrator/fixture-identity.js.map +1 -0
- package/lib/orchestrator/fs-read.d.ts +19 -0
- package/lib/orchestrator/fs-read.d.ts.map +1 -0
- package/lib/orchestrator/fs-read.js +113 -0
- package/lib/orchestrator/fs-read.js.map +1 -0
- package/lib/orchestrator/grader-experiment.d.ts +190 -0
- package/lib/orchestrator/grader-experiment.d.ts.map +1 -0
- package/lib/orchestrator/grader-experiment.js +579 -0
- package/lib/orchestrator/grader-experiment.js.map +1 -0
- package/lib/orchestrator/grading.d.ts +31 -0
- package/lib/orchestrator/grading.d.ts.map +1 -0
- package/lib/orchestrator/grading.js +186 -0
- package/lib/orchestrator/grading.js.map +1 -0
- package/lib/orchestrator/index.d.ts +22 -0
- package/lib/orchestrator/index.d.ts.map +1 -0
- package/lib/orchestrator/index.js +30 -0
- package/lib/orchestrator/index.js.map +1 -0
- package/lib/orchestrator/lifecycle-hook-execution.d.ts +4 -0
- package/lib/orchestrator/lifecycle-hook-execution.d.ts.map +1 -0
- package/lib/orchestrator/lifecycle-hook-execution.js +67 -0
- package/lib/orchestrator/lifecycle-hook-execution.js.map +1 -0
- package/lib/orchestrator/list-runs.d.ts +33 -0
- package/lib/orchestrator/list-runs.d.ts.map +1 -0
- package/lib/orchestrator/list-runs.js +308 -0
- package/lib/orchestrator/list-runs.js.map +1 -0
- package/lib/orchestrator/loader.d.ts +3 -0
- package/lib/orchestrator/loader.d.ts.map +1 -0
- package/lib/orchestrator/loader.js +17 -0
- package/lib/orchestrator/loader.js.map +1 -0
- package/lib/orchestrator/optimization-lifecycle.d.ts +12 -0
- package/lib/orchestrator/optimization-lifecycle.d.ts.map +1 -0
- package/lib/orchestrator/optimization-lifecycle.js +92 -0
- package/lib/orchestrator/optimization-lifecycle.js.map +1 -0
- package/lib/orchestrator/orchestrator.d.ts +144 -0
- package/lib/orchestrator/orchestrator.d.ts.map +1 -0
- package/lib/orchestrator/orchestrator.js +632 -0
- package/lib/orchestrator/orchestrator.js.map +1 -0
- package/lib/orchestrator/owned-lock.d.ts +17 -0
- package/lib/orchestrator/owned-lock.d.ts.map +1 -0
- package/lib/orchestrator/owned-lock.js +149 -0
- package/lib/orchestrator/owned-lock.js.map +1 -0
- package/lib/orchestrator/package-version.d.ts +2 -0
- package/lib/orchestrator/package-version.d.ts.map +1 -0
- package/lib/orchestrator/package-version.js +4 -0
- package/lib/orchestrator/package-version.js.map +1 -0
- package/lib/orchestrator/provenance.d.ts +5 -0
- package/lib/orchestrator/provenance.d.ts.map +1 -0
- package/lib/orchestrator/provenance.js +137 -0
- package/lib/orchestrator/provenance.js.map +1 -0
- package/lib/orchestrator/regrade.d.ts +80 -0
- package/lib/orchestrator/regrade.d.ts.map +1 -0
- package/lib/orchestrator/regrade.js +433 -0
- package/lib/orchestrator/regrade.js.map +1 -0
- package/lib/orchestrator/rubric-loader.d.ts +7 -0
- package/lib/orchestrator/rubric-loader.d.ts.map +1 -0
- package/lib/orchestrator/rubric-loader.js +65 -0
- package/lib/orchestrator/rubric-loader.js.map +1 -0
- package/lib/orchestrator/run-dir.d.ts +40 -0
- package/lib/orchestrator/run-dir.d.ts.map +1 -0
- package/lib/orchestrator/run-dir.js +161 -0
- package/lib/orchestrator/run-dir.js.map +1 -0
- package/lib/orchestrator/run-execution.d.ts +30 -0
- package/lib/orchestrator/run-execution.d.ts.map +1 -0
- package/lib/orchestrator/run-execution.js +531 -0
- package/lib/orchestrator/run-execution.js.map +1 -0
- package/lib/orchestrator/run-lifecycle.d.ts +115 -0
- package/lib/orchestrator/run-lifecycle.d.ts.map +1 -0
- package/lib/orchestrator/run-lifecycle.js +136 -0
- package/lib/orchestrator/run-lifecycle.js.map +1 -0
- package/lib/orchestrator/suite-compare.d.ts +76 -0
- package/lib/orchestrator/suite-compare.d.ts.map +1 -0
- package/lib/orchestrator/suite-compare.js +159 -0
- package/lib/orchestrator/suite-compare.js.map +1 -0
- package/lib/orchestrator/suite-lifecycle.d.ts +157 -0
- package/lib/orchestrator/suite-lifecycle.d.ts.map +1 -0
- package/lib/orchestrator/suite-lifecycle.js +253 -0
- package/lib/orchestrator/suite-lifecycle.js.map +1 -0
- package/lib/orchestrator/suite-runs.d.ts +91 -0
- package/lib/orchestrator/suite-runs.d.ts.map +1 -0
- package/lib/orchestrator/suite-runs.js +157 -0
- package/lib/orchestrator/suite-runs.js.map +1 -0
- package/lib/orchestrator/suite-summary.d.ts +109 -0
- package/lib/orchestrator/suite-summary.d.ts.map +1 -0
- package/lib/orchestrator/suite-summary.js +213 -0
- package/lib/orchestrator/suite-summary.js.map +1 -0
- package/lib/orchestrator/trace-limits.d.ts +20 -0
- package/lib/orchestrator/trace-limits.d.ts.map +1 -0
- package/lib/orchestrator/trace-limits.js +28 -0
- package/lib/orchestrator/trace-limits.js.map +1 -0
- package/lib/orchestrator/validate-plugin-config.d.ts +10 -0
- package/lib/orchestrator/validate-plugin-config.d.ts.map +1 -0
- package/lib/orchestrator/validate-plugin-config.js +26 -0
- package/lib/orchestrator/validate-plugin-config.js.map +1 -0
- package/package.json +84 -0
- package/skills/lux/SKILL.md +85 -0
- package/skills/lux/references/cli.md +102 -0
- package/skills/lux/references/eval-authoring.md +105 -0
- package/skills/lux-answerer/SKILL.md +169 -0
- package/src/answerers/claude-code/index.ts +342 -0
- package/src/answerers/persona/index.ts +327 -0
- package/src/answerers/scripted/index.ts +186 -0
- package/src/answerers/shared.ts +23 -0
- package/src/answerers/terminal/index.ts +117 -0
- package/src/assertions/core/command-exits-zero.ts +94 -0
- package/src/assertions/core/event-checks.ts +138 -0
- package/src/assertions/core/file-checks.ts +336 -0
- package/src/assertions/core/helpers.ts +203 -0
- package/src/assertions/core/index.ts +80 -0
- package/src/assertions/core/json-pointer-equals.ts +84 -0
- package/src/assertions/core/output-checks.ts +134 -0
- package/src/assertions/core/predicate.ts +67 -0
- package/src/assertions/core/resource-checks.ts +180 -0
- package/src/assertions/core/safe-regex.ts +196 -0
- package/src/assertions/core/tool-called-with.ts +68 -0
- package/src/assertions/core/tool-calls.ts +28 -0
- package/src/assertions/core/tool-invocation.ts +198 -0
- package/src/assertions/core/tool-result-checks.ts +211 -0
- package/src/assertions/mcp/discovery-checks.ts +139 -0
- package/src/assertions/mcp/index.ts +37 -0
- package/src/assertions/rubric/index.ts +258 -0
- package/src/assertions/rubric/internal.ts +367 -0
- package/src/authoring.ts +2 -0
- package/src/cli/bin.ts +14 -0
- package/src/cli/command-runtime.ts +34 -0
- package/src/cli/init.ts +410 -0
- package/src/cli/program.ts +992 -0
- package/src/cli/render/format.ts +69 -0
- package/src/cli/render/reporter.ts +643 -0
- package/src/cli/render/tty.ts +314 -0
- package/src/cli/run-options.ts +82 -0
- package/src/cli/skills.ts +129 -0
- package/src/core/annotation.ts +104 -0
- package/src/core/answerer.ts +75 -0
- package/src/core/artifact-evidence.ts +249 -0
- package/src/core/artifact-snapshot.ts +429 -0
- package/src/core/assertion.ts +156 -0
- package/src/core/case.ts +103 -0
- package/src/core/conversation-turn.ts +47 -0
- package/src/core/driver.ts +75 -0
- package/src/core/emitter.ts +38 -0
- package/src/core/events.ts +135 -0
- package/src/core/exec.ts +263 -0
- package/src/core/experiment.ts +467 -0
- package/src/core/glob.ts +31 -0
- package/src/core/hash.ts +237 -0
- package/src/core/index.ts +28 -0
- package/src/core/lifecycle-fixtures.ts +145 -0
- package/src/core/lifecycle-hooks.ts +101 -0
- package/src/core/mcp-events.ts +57 -0
- package/src/core/model-cli.ts +271 -0
- package/src/core/observer.ts +50 -0
- package/src/core/platform-process.ts +284 -0
- package/src/core/registry.ts +57 -0
- package/src/core/rubric.ts +52 -0
- package/src/core/run.ts +144 -0
- package/src/core/statistics.ts +194 -0
- package/src/core/subject.ts +50 -0
- package/src/core/tool-events.ts +292 -0
- package/src/core/usage.ts +123 -0
- package/src/core/wire.ts +135 -0
- package/src/core/zod.ts +20 -0
- package/src/drivers/claude-code/index.ts +866 -0
- package/src/drivers/claude-code/parse-events.ts +464 -0
- package/src/drivers/codex/app-events.ts +218 -0
- package/src/drivers/codex/config.ts +128 -0
- package/src/drivers/codex/index.ts +995 -0
- package/src/drivers/mcp/index.ts +351 -0
- package/src/drivers/mcp/transport.ts +222 -0
- package/src/drivers/shared/artifacts.ts +86 -0
- package/src/drivers/shared/secure-copy.ts +40 -0
- package/src/drivers/subprocess/index.ts +490 -0
- package/src/index.ts +594 -0
- package/src/optimization/reflective.ts +319 -0
- package/src/orchestrator/annotation-loader.ts +97 -0
- package/src/orchestrator/annotation-store.ts +112 -0
- package/src/orchestrator/authored-dependencies.ts +193 -0
- package/src/orchestrator/campaign-lifecycle.ts +181 -0
- package/src/orchestrator/candidate-integrity.ts +18 -0
- package/src/orchestrator/candidates.ts +683 -0
- package/src/orchestrator/compare.ts +358 -0
- package/src/orchestrator/comparison-identity.ts +45 -0
- package/src/orchestrator/config.ts +205 -0
- package/src/orchestrator/content-bound-json.ts +71 -0
- package/src/orchestrator/discover.ts +132 -0
- package/src/orchestrator/doctor.ts +781 -0
- package/src/orchestrator/driver-session.ts +507 -0
- package/src/orchestrator/evaluator-identity.ts +45 -0
- package/src/orchestrator/experiment-budget.ts +61 -0
- package/src/orchestrator/experiment-context.ts +41 -0
- package/src/orchestrator/experiment-contracts.ts +43 -0
- package/src/orchestrator/experiment-corpus.ts +416 -0
- package/src/orchestrator/experiment-evaluation.ts +749 -0
- package/src/orchestrator/experiment-finish.ts +33 -0
- package/src/orchestrator/experiment-identity.ts +356 -0
- package/src/orchestrator/experiment-loader.ts +105 -0
- package/src/orchestrator/experiment-report.ts +788 -0
- package/src/orchestrator/experiment-runs.ts +960 -0
- package/src/orchestrator/experiment-runtime-identity.ts +465 -0
- package/src/orchestrator/experiment-selection.ts +467 -0
- package/src/orchestrator/experiment.ts +991 -0
- package/src/orchestrator/fixture-identity.ts +67 -0
- package/src/orchestrator/fs-read.ts +126 -0
- package/src/orchestrator/grader-experiment.ts +856 -0
- package/src/orchestrator/grading.ts +260 -0
- package/src/orchestrator/index.ts +186 -0
- package/src/orchestrator/lifecycle-hook-execution.ts +90 -0
- package/src/orchestrator/list-runs.ts +384 -0
- package/src/orchestrator/loader.ts +19 -0
- package/src/orchestrator/optimization-lifecycle.ts +126 -0
- package/src/orchestrator/orchestrator.ts +919 -0
- package/src/orchestrator/owned-lock.ts +147 -0
- package/src/orchestrator/package-version.ts +5 -0
- package/src/orchestrator/provenance.ts +140 -0
- package/src/orchestrator/regrade.ts +580 -0
- package/src/orchestrator/rubric-loader.ts +74 -0
- package/src/orchestrator/run-dir.ts +209 -0
- package/src/orchestrator/run-execution.ts +694 -0
- package/src/orchestrator/run-lifecycle.ts +174 -0
- package/src/orchestrator/suite-compare.ts +195 -0
- package/src/orchestrator/suite-lifecycle.ts +335 -0
- package/src/orchestrator/suite-runs.ts +202 -0
- package/src/orchestrator/suite-summary.ts +276 -0
- package/src/orchestrator/trace-limits.ts +65 -0
- package/src/orchestrator/validate-plugin-config.ts +34 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { mkdir, readdir, rename, writeFile } from "node:fs/promises";
|
|
3
|
+
import { basename, join, relative, resolve } from "node:path";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { safeReadJson } from "./fs-read.js";
|
|
6
|
+
|
|
7
|
+
const SUITES_DIR = ".suites";
|
|
8
|
+
const SUITE_FILE = "suite.json";
|
|
9
|
+
|
|
10
|
+
const SuiteItemSchema = z.object({
|
|
11
|
+
caseId: z.string(),
|
|
12
|
+
canonicalCaseId: z.string(),
|
|
13
|
+
status: z.enum(["pending", "running", "completed"]),
|
|
14
|
+
runDir: z.string().nullable(),
|
|
15
|
+
exitReason: z.union([z.literal("done"), z.string()]).nullable(),
|
|
16
|
+
casePassed: z.boolean().nullable(),
|
|
17
|
+
errorMessage: z.exactOptional(z.string()),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export const SuiteRunSchema = z.object({
|
|
21
|
+
schemaVersion: z.literal(1),
|
|
22
|
+
suiteId: z.string(),
|
|
23
|
+
startedAt: z.string(),
|
|
24
|
+
endedAt: z.string().nullable(),
|
|
25
|
+
status: z.enum(["running", "passed", "failed", "aborted"]),
|
|
26
|
+
aborted: z.boolean(),
|
|
27
|
+
concurrency: z.number().int().positive(),
|
|
28
|
+
profileId: z.exactOptional(z.string()),
|
|
29
|
+
experimentId: z.exactOptional(z.string()),
|
|
30
|
+
experimentUnitId: z.exactOptional(z.string()),
|
|
31
|
+
experimentAttemptId: z.exactOptional(z.string()),
|
|
32
|
+
variantId: z.exactOptional(z.string()),
|
|
33
|
+
candidateId: z.exactOptional(z.string()),
|
|
34
|
+
subjectHash: z.exactOptional(z.string()),
|
|
35
|
+
errorMessage: z.exactOptional(z.string()),
|
|
36
|
+
fixtures: z
|
|
37
|
+
.array(
|
|
38
|
+
z.object({
|
|
39
|
+
name: z.string(),
|
|
40
|
+
pluginVersion: z.string(),
|
|
41
|
+
}),
|
|
42
|
+
)
|
|
43
|
+
.optional(),
|
|
44
|
+
items: z.array(SuiteItemSchema),
|
|
45
|
+
});
|
|
46
|
+
export type SuiteRun = z.infer<typeof SuiteRunSchema>;
|
|
47
|
+
export type SuiteRunItem = z.infer<typeof SuiteItemSchema>;
|
|
48
|
+
|
|
49
|
+
const timestampId = (date: Date): string => date.toISOString().replace(/[:.]/g, "-");
|
|
50
|
+
|
|
51
|
+
const writeJsonAtomic = async (path: string, value: unknown): Promise<void> => {
|
|
52
|
+
const temporary = `${path}.${process.pid}.tmp`;
|
|
53
|
+
await writeFile(temporary, `${JSON.stringify(value, null, 2)}\n`);
|
|
54
|
+
await rename(temporary, path);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export type OpenedSuiteRun = {
|
|
58
|
+
path: string;
|
|
59
|
+
manifest: SuiteRun;
|
|
60
|
+
write: () => Promise<void>;
|
|
61
|
+
relativeRunDir: (runDir: string) => string;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const openSuiteRun = async (options: {
|
|
65
|
+
runsRoot: string;
|
|
66
|
+
concurrency: number;
|
|
67
|
+
items: { id: string; caseId?: string | undefined }[];
|
|
68
|
+
startedAt?: Date | undefined;
|
|
69
|
+
profileId?: string | undefined;
|
|
70
|
+
experimentId?: string | undefined;
|
|
71
|
+
experimentUnitId?: string | undefined;
|
|
72
|
+
experimentAttemptId?: string | undefined;
|
|
73
|
+
variantId?: string | undefined;
|
|
74
|
+
candidateId?: string | undefined;
|
|
75
|
+
subjectHash?: string | undefined;
|
|
76
|
+
fixtures?: Array<{ name: string; pluginVersion: string }> | undefined;
|
|
77
|
+
}): Promise<OpenedSuiteRun> => {
|
|
78
|
+
const startedAt = options.startedAt ?? new Date();
|
|
79
|
+
const suitesRoot = join(resolve(options.runsRoot), SUITES_DIR);
|
|
80
|
+
await mkdir(suitesRoot, { recursive: true });
|
|
81
|
+
const baseId = timestampId(startedAt);
|
|
82
|
+
let suiteId = baseId;
|
|
83
|
+
let path = join(suitesRoot, suiteId);
|
|
84
|
+
for (let n = 2; ; n++) {
|
|
85
|
+
try {
|
|
86
|
+
await mkdir(path);
|
|
87
|
+
break;
|
|
88
|
+
} catch (err) {
|
|
89
|
+
if ((err as NodeJS.ErrnoException).code !== "EEXIST") throw err;
|
|
90
|
+
suiteId = `${baseId}-${n}`;
|
|
91
|
+
path = join(suitesRoot, suiteId);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const manifest: SuiteRun = {
|
|
95
|
+
schemaVersion: 1,
|
|
96
|
+
suiteId,
|
|
97
|
+
startedAt: startedAt.toISOString(),
|
|
98
|
+
endedAt: null,
|
|
99
|
+
status: "running",
|
|
100
|
+
aborted: false,
|
|
101
|
+
concurrency: options.concurrency,
|
|
102
|
+
...(options.profileId ? { profileId: options.profileId } : {}),
|
|
103
|
+
...(options.experimentId ? { experimentId: options.experimentId } : {}),
|
|
104
|
+
...(options.experimentUnitId ? { experimentUnitId: options.experimentUnitId } : {}),
|
|
105
|
+
...(options.experimentAttemptId ? { experimentAttemptId: options.experimentAttemptId } : {}),
|
|
106
|
+
...(options.variantId ? { variantId: options.variantId } : {}),
|
|
107
|
+
...(options.candidateId ? { candidateId: options.candidateId } : {}),
|
|
108
|
+
...(options.subjectHash ? { subjectHash: options.subjectHash } : {}),
|
|
109
|
+
...(options.fixtures && options.fixtures.length > 0 ? { fixtures: options.fixtures } : {}),
|
|
110
|
+
items: options.items.map((item) => ({
|
|
111
|
+
caseId: item.id,
|
|
112
|
+
canonicalCaseId: item.caseId ?? item.id,
|
|
113
|
+
status: "pending",
|
|
114
|
+
runDir: null,
|
|
115
|
+
exitReason: null,
|
|
116
|
+
casePassed: null,
|
|
117
|
+
})),
|
|
118
|
+
};
|
|
119
|
+
const write = (): Promise<void> => writeJsonAtomic(join(path, SUITE_FILE), manifest);
|
|
120
|
+
await write();
|
|
121
|
+
return { path, manifest, write, relativeRunDir: (runDir) => relative(path, runDir) };
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export const loadSuiteRun = async (path: string): Promise<SuiteRun | null> =>
|
|
125
|
+
safeReadJson(join(path, SUITE_FILE), SuiteRunSchema);
|
|
126
|
+
|
|
127
|
+
export const listSuiteRuns = async (
|
|
128
|
+
runsRoot: string,
|
|
129
|
+
): Promise<Array<SuiteRun & { suiteDir: string }>> => {
|
|
130
|
+
const root = join(runsRoot, SUITES_DIR);
|
|
131
|
+
if (!existsSync(root)) return [];
|
|
132
|
+
const dirs = (await readdir(root, { withFileTypes: true }))
|
|
133
|
+
.filter((entry) => entry.isDirectory())
|
|
134
|
+
.map((entry) => join(root, entry.name));
|
|
135
|
+
const manifests = await Promise.all(
|
|
136
|
+
dirs.map(async (suiteDir) => ({ suiteDir, suite: await loadSuiteRun(suiteDir) })),
|
|
137
|
+
);
|
|
138
|
+
return manifests
|
|
139
|
+
.flatMap(({ suiteDir, suite }) => (suite ? [{ ...suite, suiteDir }] : []))
|
|
140
|
+
.sort((a, b) => b.suiteId.localeCompare(a.suiteId));
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const resolveSuiteRunDir = (suiteDir: string, runDir: string): string => resolve(suiteDir, runDir);
|
|
144
|
+
|
|
145
|
+
export const formatSuiteRunsTable = (suites: Array<SuiteRun & { suiteDir: string }>): string => {
|
|
146
|
+
if (suites.length === 0) return "(no suite runs found)";
|
|
147
|
+
const rows = [
|
|
148
|
+
["status", "suite", "cases", "passed", "failed", "ungraded", "pending"],
|
|
149
|
+
...suites.map((suite) => [
|
|
150
|
+
suite.status.toUpperCase(),
|
|
151
|
+
basename(suite.suiteDir),
|
|
152
|
+
String(suite.items.length),
|
|
153
|
+
String(suite.items.filter((item) => item.casePassed === true).length),
|
|
154
|
+
String(
|
|
155
|
+
suite.items.filter(
|
|
156
|
+
(item) =>
|
|
157
|
+
item.status === "completed" &&
|
|
158
|
+
(item.exitReason !== "done" || item.casePassed === false),
|
|
159
|
+
).length,
|
|
160
|
+
),
|
|
161
|
+
String(
|
|
162
|
+
suite.items.filter(
|
|
163
|
+
(item) =>
|
|
164
|
+
item.status === "completed" && item.exitReason === "done" && item.casePassed === null,
|
|
165
|
+
).length,
|
|
166
|
+
),
|
|
167
|
+
String(suite.items.filter((item) => item.status !== "completed").length),
|
|
168
|
+
]),
|
|
169
|
+
];
|
|
170
|
+
const widths = (rows[0] ?? []).map((_, column) =>
|
|
171
|
+
Math.max(...rows.map((row) => row[column]?.length ?? 0)),
|
|
172
|
+
);
|
|
173
|
+
return rows
|
|
174
|
+
.map((row) => row.map((cell, column) => cell.padEnd(widths[column] ?? 0)).join(" "))
|
|
175
|
+
.join("\n");
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export const formatSuiteRunDetail = (suiteDir: string, suite: SuiteRun): string => {
|
|
179
|
+
const lines = [
|
|
180
|
+
`suiteDir: ${suiteDir}`,
|
|
181
|
+
`suite: ${suite.suiteId}`,
|
|
182
|
+
`status: ${suite.status}`,
|
|
183
|
+
`started: ${suite.startedAt}`,
|
|
184
|
+
`ended: ${suite.endedAt ?? "—"}`,
|
|
185
|
+
`cases: ${suite.items.length}`,
|
|
186
|
+
...(suite.errorMessage ? [`error: ${suite.errorMessage}`] : []),
|
|
187
|
+
"",
|
|
188
|
+
];
|
|
189
|
+
for (const item of suite.items) {
|
|
190
|
+
const status = (() => {
|
|
191
|
+
if (item.status !== "completed") return item.status.toUpperCase();
|
|
192
|
+
if (item.exitReason !== "done" || item.casePassed === false) return "FAIL";
|
|
193
|
+
if (item.casePassed === true) return "PASS";
|
|
194
|
+
return "UNGRADED";
|
|
195
|
+
})();
|
|
196
|
+
lines.push(
|
|
197
|
+
`${status.padEnd(8)} ${item.caseId}${item.runDir ? ` ${resolveSuiteRunDir(suiteDir, item.runDir)}` : ""}`,
|
|
198
|
+
);
|
|
199
|
+
if (item.errorMessage) lines.push(` ${item.errorMessage}`);
|
|
200
|
+
}
|
|
201
|
+
return lines.join("\n");
|
|
202
|
+
};
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { rename, writeFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { harnessUsage, isUsageEmpty, type RunMetadata } from "../core/index.js";
|
|
5
|
+
import { runComparisonIdentity } from "./comparison-identity.js";
|
|
6
|
+
import { safeReadJson } from "./fs-read.js";
|
|
7
|
+
import type { SuiteCaseResult } from "./orchestrator.js";
|
|
8
|
+
import type { SuiteRun } from "./suite-runs.js";
|
|
9
|
+
|
|
10
|
+
const SUMMARY_FILE = "suite-summary.json";
|
|
11
|
+
|
|
12
|
+
export const MetricSummarySchema = z.object({
|
|
13
|
+
n: z.number().int().nonnegative(),
|
|
14
|
+
min: z.number(),
|
|
15
|
+
max: z.number(),
|
|
16
|
+
mean: z.number(),
|
|
17
|
+
median: z.number(),
|
|
18
|
+
p90: z.number(),
|
|
19
|
+
});
|
|
20
|
+
export type MetricSummary = z.infer<typeof MetricSummarySchema>;
|
|
21
|
+
|
|
22
|
+
const OutcomeSummarySchema = z.object({
|
|
23
|
+
attempts: z.number().int().nonnegative(),
|
|
24
|
+
completed: z.number().int().nonnegative(),
|
|
25
|
+
passed: z.number().int().nonnegative(),
|
|
26
|
+
failed: z.number().int().nonnegative(),
|
|
27
|
+
ungraded: z.number().int().nonnegative(),
|
|
28
|
+
pending: z.number().int().nonnegative(),
|
|
29
|
+
passRate: z.number().min(0).max(1),
|
|
30
|
+
});
|
|
31
|
+
export type OutcomeSummary = z.infer<typeof OutcomeSummarySchema>;
|
|
32
|
+
|
|
33
|
+
const CaseSummarySchema = OutcomeSummarySchema.extend({
|
|
34
|
+
canonicalCaseId: z.string(),
|
|
35
|
+
metrics: z.record(z.string(), MetricSummarySchema),
|
|
36
|
+
});
|
|
37
|
+
export type CaseSummary = z.infer<typeof CaseSummarySchema>;
|
|
38
|
+
|
|
39
|
+
export const SuiteSampleSchema = z.object({
|
|
40
|
+
index: z.number().int().nonnegative(),
|
|
41
|
+
caseId: z.string(),
|
|
42
|
+
canonicalCaseId: z.string(),
|
|
43
|
+
exitReason: z.string().nullable(),
|
|
44
|
+
passed: z.boolean().nullable(),
|
|
45
|
+
identityHash: z.string().nullable(),
|
|
46
|
+
score: z.exactOptional(z.number()),
|
|
47
|
+
metrics: z.record(z.string(), z.number()),
|
|
48
|
+
});
|
|
49
|
+
export type SuiteSample = z.infer<typeof SuiteSampleSchema>;
|
|
50
|
+
|
|
51
|
+
export const SuiteSummarySchema = z.object({
|
|
52
|
+
schemaVersion: z.literal(1),
|
|
53
|
+
suiteId: z.string(),
|
|
54
|
+
generatedAt: z.string(),
|
|
55
|
+
totals: OutcomeSummarySchema,
|
|
56
|
+
metrics: z.record(z.string(), MetricSummarySchema),
|
|
57
|
+
cases: z.array(CaseSummarySchema),
|
|
58
|
+
samples: z.array(SuiteSampleSchema),
|
|
59
|
+
});
|
|
60
|
+
export type SuiteSummary = z.infer<typeof SuiteSummarySchema>;
|
|
61
|
+
|
|
62
|
+
type MetricSamples = Map<string, number[]>;
|
|
63
|
+
|
|
64
|
+
const add = (samples: MetricSamples, name: string, value: number | undefined): void => {
|
|
65
|
+
if (value === undefined || !Number.isFinite(value)) return;
|
|
66
|
+
const values = samples.get(name) ?? [];
|
|
67
|
+
values.push(value);
|
|
68
|
+
samples.set(name, values);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const cacheHitRate = (usage: {
|
|
72
|
+
input: number;
|
|
73
|
+
cacheRead: number;
|
|
74
|
+
cacheCreation: number;
|
|
75
|
+
}): number | undefined => {
|
|
76
|
+
const promptTokens = usage.input + usage.cacheRead + usage.cacheCreation;
|
|
77
|
+
return promptTokens > 0 ? usage.cacheRead / promptTokens : undefined;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const collectMetadata = (samples: MetricSamples, metadata: RunMetadata): void => {
|
|
81
|
+
const started = Date.parse(metadata.startedAt);
|
|
82
|
+
const ended = Date.parse(metadata.endedAt);
|
|
83
|
+
if (!Number.isNaN(started) && !Number.isNaN(ended)) {
|
|
84
|
+
add(samples, "durationMs", Math.max(0, ended - started));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (!isUsageEmpty(metadata.usage.agent)) {
|
|
88
|
+
add(samples, "agent.input", metadata.usage.agent.input);
|
|
89
|
+
add(samples, "agent.output", metadata.usage.agent.output);
|
|
90
|
+
add(samples, "agent.cacheRead", metadata.usage.agent.cacheRead);
|
|
91
|
+
add(samples, "agent.cacheCreation", metadata.usage.agent.cacheCreation);
|
|
92
|
+
add(samples, "agent.cacheHitRate", cacheHitRate(metadata.usage.agent));
|
|
93
|
+
add(
|
|
94
|
+
samples,
|
|
95
|
+
"agent.total",
|
|
96
|
+
metadata.usage.agent.input +
|
|
97
|
+
metadata.usage.agent.output +
|
|
98
|
+
metadata.usage.agent.cacheRead +
|
|
99
|
+
metadata.usage.agent.cacheCreation,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
const harness = harnessUsage(metadata.usage);
|
|
103
|
+
if (!isUsageEmpty(harness)) {
|
|
104
|
+
add(samples, "harness.input", harness.input);
|
|
105
|
+
add(samples, "harness.output", harness.output);
|
|
106
|
+
add(samples, "harness.cacheRead", harness.cacheRead);
|
|
107
|
+
add(samples, "harness.cacheCreation", harness.cacheCreation);
|
|
108
|
+
add(samples, "harness.cacheHitRate", cacheHitRate(harness));
|
|
109
|
+
add(
|
|
110
|
+
samples,
|
|
111
|
+
"harness.total",
|
|
112
|
+
harness.input + harness.output + harness.cacheRead + harness.cacheCreation,
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
add(samples, "interrupts.ask", metadata.interruptCounts.ask);
|
|
116
|
+
add(samples, "interrupts.approve", metadata.interruptCounts.approve);
|
|
117
|
+
add(samples, "interrupts.custom", metadata.interruptCounts.custom);
|
|
118
|
+
add(samples, "toolCalls", metadata.toolOutcomes?.total ?? metadata.toolCallCount);
|
|
119
|
+
add(
|
|
120
|
+
samples,
|
|
121
|
+
"toolCalls.reported",
|
|
122
|
+
metadata.toolOutcomes?.reportedCalls ?? metadata.toolCallCount,
|
|
123
|
+
);
|
|
124
|
+
add(samples, "toolCalls.succeeded", metadata.toolOutcomes?.succeeded);
|
|
125
|
+
add(samples, "toolCalls.failed", metadata.toolOutcomes?.failed);
|
|
126
|
+
add(samples, "toolCalls.unresolved", metadata.toolOutcomes?.unresolved);
|
|
127
|
+
add(samples, "toolCalls.unmatchedResults", metadata.toolOutcomes?.unmatchedResults);
|
|
128
|
+
add(samples, "toolCalls.malformedEvents", metadata.toolOutcomes?.malformedEvents);
|
|
129
|
+
const settledToolCalls =
|
|
130
|
+
(metadata.toolOutcomes?.succeeded ?? 0) + (metadata.toolOutcomes?.failed ?? 0);
|
|
131
|
+
if (settledToolCalls > 0 && metadata.toolOutcomes) {
|
|
132
|
+
add(samples, "toolCalls.failureRate", metadata.toolOutcomes.failed / settledToolCalls);
|
|
133
|
+
}
|
|
134
|
+
add(samples, "artifacts.count", metadata.artifacts?.count);
|
|
135
|
+
add(samples, "artifacts.bytes", metadata.artifacts?.bytes);
|
|
136
|
+
add(samples, "cost.usd", metadata.cost?.usd);
|
|
137
|
+
add(samples, "phase.agentMs", metadata.phaseDurationMs?.agent);
|
|
138
|
+
add(samples, "phase.collectMs", metadata.phaseDurationMs?.collect);
|
|
139
|
+
add(samples, "phase.gradingMs", metadata.phaseDurationMs?.grading);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const percentile = (sorted: readonly number[], fraction: number): number => {
|
|
143
|
+
const index = Math.max(0, Math.ceil(sorted.length * fraction) - 1);
|
|
144
|
+
return sorted[index] ?? 0;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export const summarizeNumbers = (values: readonly number[]): MetricSummary => {
|
|
148
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
149
|
+
const middle = Math.floor(sorted.length / 2);
|
|
150
|
+
const median =
|
|
151
|
+
sorted.length % 2 === 0
|
|
152
|
+
? ((sorted[middle - 1] ?? 0) + (sorted[middle] ?? 0)) / 2
|
|
153
|
+
: (sorted[middle] ?? 0);
|
|
154
|
+
return {
|
|
155
|
+
n: sorted.length,
|
|
156
|
+
min: sorted[0] ?? 0,
|
|
157
|
+
max: sorted.at(-1) ?? 0,
|
|
158
|
+
mean: sorted.reduce((sum, value) => sum + value, 0) / Math.max(sorted.length, 1),
|
|
159
|
+
median,
|
|
160
|
+
p90: percentile(sorted, 0.9),
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const summarizeMetrics = (samples: MetricSamples): Record<string, MetricSummary> =>
|
|
165
|
+
Object.fromEntries(
|
|
166
|
+
[...samples.entries()]
|
|
167
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
168
|
+
.map(([name, values]) => [name, summarizeNumbers(values)]),
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
const summarizeOutcomes = (
|
|
172
|
+
entries: Array<{
|
|
173
|
+
item: SuiteRun["items"][number];
|
|
174
|
+
result: SuiteCaseResult | undefined;
|
|
175
|
+
}>,
|
|
176
|
+
): OutcomeSummary => {
|
|
177
|
+
const completed = entries.filter((entry) => entry.item.status === "completed").length;
|
|
178
|
+
const passed = entries.filter((entry) => entry.result?.casePassed === true).length;
|
|
179
|
+
const failed = entries.filter(
|
|
180
|
+
(entry) =>
|
|
181
|
+
entry.item.status === "completed" &&
|
|
182
|
+
(entry.result?.exitReason !== "done" || entry.result.casePassed === false),
|
|
183
|
+
).length;
|
|
184
|
+
const ungraded = entries.filter(
|
|
185
|
+
(entry) =>
|
|
186
|
+
entry.item.status === "completed" &&
|
|
187
|
+
entry.result?.exitReason === "done" &&
|
|
188
|
+
entry.result.casePassed === null,
|
|
189
|
+
).length;
|
|
190
|
+
return {
|
|
191
|
+
attempts: entries.length,
|
|
192
|
+
completed,
|
|
193
|
+
passed,
|
|
194
|
+
failed,
|
|
195
|
+
ungraded,
|
|
196
|
+
pending: entries.length - completed,
|
|
197
|
+
passRate: entries.length === 0 ? 0 : passed / entries.length,
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export const buildSuiteSummary = (
|
|
202
|
+
suite: SuiteRun,
|
|
203
|
+
results: readonly (SuiteCaseResult | undefined)[],
|
|
204
|
+
generatedAt: Date = new Date(),
|
|
205
|
+
): SuiteSummary => {
|
|
206
|
+
const entries = suite.items.map((item, index) => ({ item, result: results[index] }));
|
|
207
|
+
const allMetrics: MetricSamples = new Map();
|
|
208
|
+
for (const entry of entries) {
|
|
209
|
+
const result = entry.result?.result;
|
|
210
|
+
if (!result) continue;
|
|
211
|
+
add(allMetrics, "score", result.grading.caseScore ?? undefined);
|
|
212
|
+
collectMetadata(allMetrics, result.metadata);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const byCase = new Map<string, typeof entries>();
|
|
216
|
+
for (const entry of entries) {
|
|
217
|
+
const group = byCase.get(entry.item.canonicalCaseId) ?? [];
|
|
218
|
+
group.push(entry);
|
|
219
|
+
byCase.set(entry.item.canonicalCaseId, group);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const cases = [...byCase.entries()]
|
|
223
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
224
|
+
.map(([canonicalCaseId, caseEntries]) => {
|
|
225
|
+
const metrics: MetricSamples = new Map();
|
|
226
|
+
for (const entry of caseEntries) {
|
|
227
|
+
const result = entry.result?.result;
|
|
228
|
+
if (!result) continue;
|
|
229
|
+
add(metrics, "score", result.grading.caseScore ?? undefined);
|
|
230
|
+
collectMetadata(metrics, result.metadata);
|
|
231
|
+
}
|
|
232
|
+
return {
|
|
233
|
+
canonicalCaseId,
|
|
234
|
+
...summarizeOutcomes(caseEntries),
|
|
235
|
+
metrics: summarizeMetrics(metrics),
|
|
236
|
+
};
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
return {
|
|
240
|
+
schemaVersion: 1,
|
|
241
|
+
suiteId: suite.suiteId,
|
|
242
|
+
generatedAt: generatedAt.toISOString(),
|
|
243
|
+
totals: summarizeOutcomes(entries),
|
|
244
|
+
metrics: summarizeMetrics(allMetrics),
|
|
245
|
+
cases,
|
|
246
|
+
samples: entries.map((entry, index) => {
|
|
247
|
+
const samples: MetricSamples = new Map();
|
|
248
|
+
const result = entry.result?.result;
|
|
249
|
+
if (result) collectMetadata(samples, result.metadata);
|
|
250
|
+
return {
|
|
251
|
+
index,
|
|
252
|
+
caseId: entry.item.caseId,
|
|
253
|
+
canonicalCaseId: entry.item.canonicalCaseId,
|
|
254
|
+
exitReason: entry.result?.exitReason ?? null,
|
|
255
|
+
passed: entry.result?.casePassed ?? null,
|
|
256
|
+
identityHash: result ? runComparisonIdentity(result.metadata) : null,
|
|
257
|
+
...(result?.grading.caseScore !== null && result?.grading.caseScore !== undefined
|
|
258
|
+
? { score: result.grading.caseScore }
|
|
259
|
+
: {}),
|
|
260
|
+
metrics: Object.fromEntries(
|
|
261
|
+
[...samples.entries()].map(([name, values]) => [name, values[0] ?? 0]),
|
|
262
|
+
),
|
|
263
|
+
};
|
|
264
|
+
}),
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
export const writeSuiteSummary = async (suiteDir: string, summary: SuiteSummary): Promise<void> => {
|
|
269
|
+
const path = join(suiteDir, SUMMARY_FILE);
|
|
270
|
+
const temporary = `${path}.${process.pid}.tmp`;
|
|
271
|
+
await writeFile(temporary, `${JSON.stringify(summary, null, 2)}\n`);
|
|
272
|
+
await rename(temporary, path);
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
export const loadSuiteSummary = async (suiteDir: string): Promise<SuiteSummary | null> =>
|
|
276
|
+
safeReadJson(join(suiteDir, SUMMARY_FILE), SuiteSummarySchema);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { RunEvent } from "../core/index.js";
|
|
2
|
+
|
|
3
|
+
export const MAX_RUN_TRACE_BYTES = 10 * 1024 * 1024;
|
|
4
|
+
export const MAX_RUN_TRACE_EVENTS = 50_000;
|
|
5
|
+
|
|
6
|
+
export type RunTraceLimits = {
|
|
7
|
+
maxBytes: number;
|
|
8
|
+
maxEvents: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type RunTraceLimitFailure = {
|
|
12
|
+
code: "run-trace-limit";
|
|
13
|
+
limit: "bytes" | "events";
|
|
14
|
+
maxBytes: number;
|
|
15
|
+
maxEvents: number;
|
|
16
|
+
reason: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const isRunTraceLimit = (value: unknown): value is Pick<RunTraceLimitFailure, "code"> =>
|
|
20
|
+
typeof value === "object" &&
|
|
21
|
+
value !== null &&
|
|
22
|
+
"code" in value &&
|
|
23
|
+
value.code === "run-trace-limit";
|
|
24
|
+
|
|
25
|
+
export const DEFAULT_RUN_TRACE_LIMITS: RunTraceLimits = {
|
|
26
|
+
maxBytes: MAX_RUN_TRACE_BYTES,
|
|
27
|
+
maxEvents: MAX_RUN_TRACE_EVENTS,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const runTraceLimitFailure = (
|
|
31
|
+
limit: RunTraceLimitFailure["limit"],
|
|
32
|
+
limits: RunTraceLimits,
|
|
33
|
+
): RunTraceLimitFailure => ({
|
|
34
|
+
code: "run-trace-limit",
|
|
35
|
+
limit,
|
|
36
|
+
maxBytes: limits.maxBytes,
|
|
37
|
+
maxEvents: limits.maxEvents,
|
|
38
|
+
reason:
|
|
39
|
+
limit === "events"
|
|
40
|
+
? `run trace exceeded the ${limits.maxEvents}-event limit`
|
|
41
|
+
: `run trace exceeded the ${limits.maxBytes}-byte limit`,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const runTraceLimitDiagnostic = (
|
|
45
|
+
failure: RunTraceLimitFailure,
|
|
46
|
+
ts: number = Date.now(),
|
|
47
|
+
): RunEvent => ({
|
|
48
|
+
type: "error",
|
|
49
|
+
exitReason: "error",
|
|
50
|
+
reason: failure.reason,
|
|
51
|
+
ts,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const serializedEventBytes = (event: RunEvent): number =>
|
|
55
|
+
Buffer.byteLength(`${JSON.stringify(event)}\n`);
|
|
56
|
+
|
|
57
|
+
export const terminalDiagnosticReserveBytes = (limits: RunTraceLimits): number =>
|
|
58
|
+
Math.max(
|
|
59
|
+
serializedEventBytes(
|
|
60
|
+
runTraceLimitDiagnostic(runTraceLimitFailure("bytes", limits), Number.MAX_SAFE_INTEGER),
|
|
61
|
+
),
|
|
62
|
+
serializedEventBytes(
|
|
63
|
+
runTraceLimitDiagnostic(runTraceLimitFailure("events", limits), Number.MAX_SAFE_INTEGER),
|
|
64
|
+
),
|
|
65
|
+
);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
import { formatZodIssues } from "../core/index.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Centralized plugin/assertion config validation. Both the orchestrator
|
|
6
|
+
* (driver/answerer config) and the grader (assertion config) need to
|
|
7
|
+
* validate untrusted config blobs against a plugin-supplied Zod schema
|
|
8
|
+
* with consistent error formatting; this is the one place that does it.
|
|
9
|
+
*/
|
|
10
|
+
export const validatePluginConfig = (
|
|
11
|
+
schema: z.ZodTypeAny | undefined,
|
|
12
|
+
config: unknown,
|
|
13
|
+
contextLabel: string,
|
|
14
|
+
): unknown => {
|
|
15
|
+
if (!schema) return config;
|
|
16
|
+
const parsed = schema.safeParse(config ?? {});
|
|
17
|
+
if (!parsed.success) {
|
|
18
|
+
throw new Error(`invalid config for ${contextLabel}: ${formatZodIssues(parsed.error)}`);
|
|
19
|
+
}
|
|
20
|
+
return parsed.data;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const validatePluginConfigAsync = async (
|
|
24
|
+
schema: z.ZodTypeAny | undefined,
|
|
25
|
+
config: unknown,
|
|
26
|
+
contextLabel: string,
|
|
27
|
+
): Promise<unknown> => {
|
|
28
|
+
if (!schema) return config;
|
|
29
|
+
const parsed = await schema.safeParseAsync(config ?? {});
|
|
30
|
+
if (!parsed.success) {
|
|
31
|
+
throw new Error(`invalid config for ${contextLabel}: ${formatZodIssues(parsed.error)}`);
|
|
32
|
+
}
|
|
33
|
+
return parsed.data;
|
|
34
|
+
};
|