@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
package/src/core/hash.ts
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
|
|
3
|
+
type Traversal = {
|
|
4
|
+
active: Map<object, number>;
|
|
5
|
+
nextId: number;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const typedArrayConstructors = new Set<unknown>([
|
|
9
|
+
Int8Array,
|
|
10
|
+
Uint8Array,
|
|
11
|
+
Uint8ClampedArray,
|
|
12
|
+
Int16Array,
|
|
13
|
+
Uint16Array,
|
|
14
|
+
Int32Array,
|
|
15
|
+
Uint32Array,
|
|
16
|
+
Float32Array,
|
|
17
|
+
Float64Array,
|
|
18
|
+
BigInt64Array,
|
|
19
|
+
BigUint64Array,
|
|
20
|
+
Buffer,
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
const ownStateKeys = (value: object, allowed: ReadonlySet<string>): string[] =>
|
|
24
|
+
Reflect.ownKeys(value).flatMap((key) => {
|
|
25
|
+
if (typeof key === "symbol") {
|
|
26
|
+
throw new TypeError("valueHash does not support symbol-keyed state");
|
|
27
|
+
}
|
|
28
|
+
return allowed.has(key) ? [] : [key];
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const assertNoAttachedState = (value: object, allowed: ReadonlySet<string>): void => {
|
|
32
|
+
const keys = ownStateKeys(value, allowed);
|
|
33
|
+
if (keys.length > 0) {
|
|
34
|
+
throw new TypeError(
|
|
35
|
+
`valueHash does not support attached state on ${value.constructor?.name ?? "value"}: ${keys.join(", ")}`,
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const numberValue = (value: number): string | number => {
|
|
41
|
+
if (Number.isNaN(value)) return "NaN";
|
|
42
|
+
if (value === Number.POSITIVE_INFINITY) return "Infinity";
|
|
43
|
+
if (value === Number.NEGATIVE_INFINITY) return "-Infinity";
|
|
44
|
+
if (Object.is(value, -0)) return "-0";
|
|
45
|
+
return value;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const arrayIndex = (key: string, length: number): number | null => {
|
|
49
|
+
if (!/^(?:0|[1-9]\d*)$/.test(key)) return null;
|
|
50
|
+
const index = Number(key);
|
|
51
|
+
return Number.isSafeInteger(index) && index >= 0 && index < length ? index : null;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const canonicalizeObject = (value: object, traversal: Traversal): unknown => {
|
|
55
|
+
const reference = traversal.active.get(value);
|
|
56
|
+
if (reference !== undefined) return ["reference", reference];
|
|
57
|
+
|
|
58
|
+
const id = traversal.nextId++;
|
|
59
|
+
traversal.active.set(value, id);
|
|
60
|
+
try {
|
|
61
|
+
if (Array.isArray(value)) {
|
|
62
|
+
if (Object.getPrototypeOf(value) !== Array.prototype) {
|
|
63
|
+
throw new TypeError("valueHash does not support Array subclasses");
|
|
64
|
+
}
|
|
65
|
+
const ownKeys = ownStateKeys(value, new Set(["length"]));
|
|
66
|
+
for (const key of ownKeys) {
|
|
67
|
+
if (arrayIndex(key, value.length) === null) {
|
|
68
|
+
throw new TypeError(`valueHash does not support array property '${key}'`);
|
|
69
|
+
}
|
|
70
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
71
|
+
if (descriptor && !("value" in descriptor)) {
|
|
72
|
+
throw new TypeError(`valueHash does not support accessor property '${key}'`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return [
|
|
76
|
+
"array",
|
|
77
|
+
Array.from({ length: value.length }, (_, index) =>
|
|
78
|
+
Object.hasOwn(value, index)
|
|
79
|
+
? canonicalize(value[index], traversal)
|
|
80
|
+
: (["array-hole"] as const),
|
|
81
|
+
),
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (value instanceof Date) {
|
|
86
|
+
if (Object.getPrototypeOf(value) !== Date.prototype) {
|
|
87
|
+
throw new TypeError("valueHash does not support Date subclasses");
|
|
88
|
+
}
|
|
89
|
+
assertNoAttachedState(value, new Set());
|
|
90
|
+
return ["date", numberValue(value.getTime())];
|
|
91
|
+
}
|
|
92
|
+
if (value instanceof RegExp) {
|
|
93
|
+
if (Object.getPrototypeOf(value) !== RegExp.prototype) {
|
|
94
|
+
throw new TypeError("valueHash does not support RegExp subclasses");
|
|
95
|
+
}
|
|
96
|
+
assertNoAttachedState(value, new Set(["lastIndex"]));
|
|
97
|
+
return ["regexp", value.source, value.flags, value.lastIndex];
|
|
98
|
+
}
|
|
99
|
+
if (value instanceof Map) {
|
|
100
|
+
if (Object.getPrototypeOf(value) !== Map.prototype) {
|
|
101
|
+
throw new TypeError("valueHash does not support Map subclasses");
|
|
102
|
+
}
|
|
103
|
+
assertNoAttachedState(value, new Set());
|
|
104
|
+
return [
|
|
105
|
+
"map",
|
|
106
|
+
Array.from(value.entries(), ([key, item]) => [
|
|
107
|
+
canonicalize(key, traversal),
|
|
108
|
+
canonicalize(item, traversal),
|
|
109
|
+
]),
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
if (value instanceof Set) {
|
|
113
|
+
if (Object.getPrototypeOf(value) !== Set.prototype) {
|
|
114
|
+
throw new TypeError("valueHash does not support Set subclasses");
|
|
115
|
+
}
|
|
116
|
+
assertNoAttachedState(value, new Set());
|
|
117
|
+
return ["set", Array.from(value, (item) => canonicalize(item, traversal))];
|
|
118
|
+
}
|
|
119
|
+
if (value instanceof ArrayBuffer) {
|
|
120
|
+
if (Object.getPrototypeOf(value) !== ArrayBuffer.prototype) {
|
|
121
|
+
throw new TypeError("valueHash does not support ArrayBuffer subclasses");
|
|
122
|
+
}
|
|
123
|
+
assertNoAttachedState(value, new Set());
|
|
124
|
+
return ["array-buffer", Buffer.from(value).toString("base64")];
|
|
125
|
+
}
|
|
126
|
+
if (ArrayBuffer.isView(value)) {
|
|
127
|
+
if (typeof SharedArrayBuffer !== "undefined" && value.buffer instanceof SharedArrayBuffer) {
|
|
128
|
+
throw new TypeError("valueHash does not support shared mutable buffers");
|
|
129
|
+
}
|
|
130
|
+
if (value instanceof DataView) {
|
|
131
|
+
if (Object.getPrototypeOf(value) !== DataView.prototype) {
|
|
132
|
+
throw new TypeError("valueHash does not support DataView subclasses");
|
|
133
|
+
}
|
|
134
|
+
assertNoAttachedState(value, new Set());
|
|
135
|
+
return [
|
|
136
|
+
"data-view",
|
|
137
|
+
Buffer.from(value.buffer, value.byteOffset, value.byteLength).toString("base64"),
|
|
138
|
+
];
|
|
139
|
+
}
|
|
140
|
+
const viewConstructor = Object.getPrototypeOf(value)?.constructor as unknown;
|
|
141
|
+
if (typeof viewConstructor !== "function" || !typedArrayConstructors.has(viewConstructor)) {
|
|
142
|
+
throw new TypeError("valueHash does not support custom typed-array classes");
|
|
143
|
+
}
|
|
144
|
+
const indexedKeys = new Set(
|
|
145
|
+
Array.from({ length: (value as unknown as ArrayLike<unknown>).length }, (_, index) =>
|
|
146
|
+
String(index),
|
|
147
|
+
),
|
|
148
|
+
);
|
|
149
|
+
assertNoAttachedState(value, indexedKeys);
|
|
150
|
+
return [
|
|
151
|
+
"typed-array",
|
|
152
|
+
viewConstructor.name,
|
|
153
|
+
Array.from(value as unknown as ArrayLike<unknown>, (item) => canonicalize(item, traversal)),
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const prototype = Object.getPrototypeOf(value);
|
|
158
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
159
|
+
throw new TypeError(
|
|
160
|
+
`valueHash does not support class instance '${value.constructor?.name ?? "unknown"}'`,
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
const entries = ownStateKeys(value, new Set())
|
|
164
|
+
.sort((a, b) => a.localeCompare(b))
|
|
165
|
+
.map((key) => {
|
|
166
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
167
|
+
if (!descriptor?.enumerable) {
|
|
168
|
+
throw new TypeError(`valueHash does not support non-enumerable property '${key}'`);
|
|
169
|
+
}
|
|
170
|
+
if (!("value" in descriptor)) {
|
|
171
|
+
throw new TypeError(`valueHash does not support accessor property '${key}'`);
|
|
172
|
+
}
|
|
173
|
+
return [key, canonicalize(descriptor.value, traversal)];
|
|
174
|
+
});
|
|
175
|
+
return [prototype === null ? "null-object" : "object", entries];
|
|
176
|
+
} finally {
|
|
177
|
+
traversal.active.delete(value);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const canonicalize = (value: unknown, traversal: Traversal): unknown => {
|
|
182
|
+
if (value === null) return ["null"];
|
|
183
|
+
if (value === undefined) return ["undefined"];
|
|
184
|
+
if (typeof value === "string") return ["string", value];
|
|
185
|
+
if (typeof value === "boolean") return ["boolean", value];
|
|
186
|
+
if (typeof value === "number") return ["number", numberValue(value)];
|
|
187
|
+
if (typeof value === "bigint") return ["bigint", value.toString()];
|
|
188
|
+
if (typeof value === "symbol") {
|
|
189
|
+
throw new TypeError("valueHash does not support symbols");
|
|
190
|
+
}
|
|
191
|
+
if (typeof value === "function") {
|
|
192
|
+
const ownKeys = Reflect.ownKeys(value);
|
|
193
|
+
if (ownKeys.some((key) => typeof key === "symbol")) {
|
|
194
|
+
throw new TypeError("valueHash does not support symbol-keyed function state");
|
|
195
|
+
}
|
|
196
|
+
const standardKeys = new Set(["length", "name", "arguments", "caller", "prototype"]);
|
|
197
|
+
const attached = ownKeys.filter(
|
|
198
|
+
(key): key is string => typeof key === "string" && !standardKeys.has(key),
|
|
199
|
+
);
|
|
200
|
+
if (attached.length > 0) {
|
|
201
|
+
throw new TypeError(
|
|
202
|
+
`valueHash does not support attached function state: ${attached.join(", ")}`,
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
if (Object.hasOwn(value, "prototype")) {
|
|
206
|
+
const prototype = (value as { prototype?: unknown }).prototype;
|
|
207
|
+
if (
|
|
208
|
+
!prototype ||
|
|
209
|
+
typeof prototype !== "object" ||
|
|
210
|
+
Reflect.ownKeys(prototype).some((key) => key !== "constructor") ||
|
|
211
|
+
Object.getOwnPropertyDescriptor(prototype, "constructor")?.value !== value
|
|
212
|
+
) {
|
|
213
|
+
throw new TypeError("valueHash does not support modified function prototypes");
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
const source = Function.prototype.toString.call(value);
|
|
217
|
+
if (source.includes("[native code]")) {
|
|
218
|
+
throw new TypeError("valueHash does not support native or bound functions");
|
|
219
|
+
}
|
|
220
|
+
// JavaScript exposes source text but not captured closure values. Evaluator
|
|
221
|
+
// state that affects behavior must therefore live in source or explicit config.
|
|
222
|
+
return ["function-source", source];
|
|
223
|
+
}
|
|
224
|
+
return canonicalizeObject(value, traversal);
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Tagged structural encoding for ledger identity. Functions encode observable
|
|
229
|
+
* source text only; JavaScript provides no access to captured closure values.
|
|
230
|
+
*/
|
|
231
|
+
export const stableJson = (value: unknown): string =>
|
|
232
|
+
JSON.stringify(["lux-value", 2, canonicalize(value, { active: new Map(), nextId: 0 })]);
|
|
233
|
+
|
|
234
|
+
export const contentHash = (value: string | Uint8Array): string =>
|
|
235
|
+
createHash("sha256").update(value).digest("hex");
|
|
236
|
+
|
|
237
|
+
export const valueHash = (value: unknown): string => contentHash(stableJson(value));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export * from "./annotation.js";
|
|
2
|
+
export * from "./answerer.js";
|
|
3
|
+
export * from "./artifact-evidence.js";
|
|
4
|
+
export * from "./artifact-snapshot.js";
|
|
5
|
+
export * from "./assertion.js";
|
|
6
|
+
export * from "./case.js";
|
|
7
|
+
export * from "./conversation-turn.js";
|
|
8
|
+
export * from "./driver.js";
|
|
9
|
+
export * from "./emitter.js";
|
|
10
|
+
export * from "./events.js";
|
|
11
|
+
export * from "./exec.js";
|
|
12
|
+
export * from "./experiment.js";
|
|
13
|
+
export * from "./glob.js";
|
|
14
|
+
export * from "./hash.js";
|
|
15
|
+
export * from "./lifecycle-fixtures.js";
|
|
16
|
+
export * from "./lifecycle-hooks.js";
|
|
17
|
+
export * from "./mcp-events.js";
|
|
18
|
+
export * from "./model-cli.js";
|
|
19
|
+
export * from "./observer.js";
|
|
20
|
+
export * from "./registry.js";
|
|
21
|
+
export * from "./rubric.js";
|
|
22
|
+
export * from "./run.js";
|
|
23
|
+
export * from "./statistics.js";
|
|
24
|
+
export * from "./subject.js";
|
|
25
|
+
export * from "./tool-events.js";
|
|
26
|
+
export * from "./usage.js";
|
|
27
|
+
export * from "./wire.js";
|
|
28
|
+
export * from "./zod.js";
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { valueHash } from "./hash.js";
|
|
2
|
+
import {
|
|
3
|
+
type CaseLifecycleHookContext,
|
|
4
|
+
defineLifecycleHooks,
|
|
5
|
+
type LifecycleHookCleanup,
|
|
6
|
+
type LifecycleHooksPlugin,
|
|
7
|
+
type SuiteLifecycleHookContext,
|
|
8
|
+
} from "./lifecycle-hooks.js";
|
|
9
|
+
|
|
10
|
+
export type LifecycleFixtureUse = () => PromiseLike<void>;
|
|
11
|
+
|
|
12
|
+
export type LifecycleFixture<Context extends SuiteLifecycleHookContext> = (
|
|
13
|
+
context: Context,
|
|
14
|
+
use: LifecycleFixtureUse,
|
|
15
|
+
) => void | Promise<void>;
|
|
16
|
+
|
|
17
|
+
export type LifecycleFixturesDefinition = {
|
|
18
|
+
name: string;
|
|
19
|
+
pluginVersion: string;
|
|
20
|
+
/**
|
|
21
|
+
* Public, non-secret values captured by the fixture callbacks and relevant
|
|
22
|
+
* to execution identity.
|
|
23
|
+
*/
|
|
24
|
+
identity?: unknown;
|
|
25
|
+
suite?: LifecycleFixture<SuiteLifecycleHookContext>;
|
|
26
|
+
case?: LifecycleFixture<CaseLifecycleHookContext>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const errorMessage = (error: unknown): string =>
|
|
30
|
+
error instanceof Error ? error.message : String(error);
|
|
31
|
+
|
|
32
|
+
const activateFixture = async <Context extends SuiteLifecycleHookContext>(
|
|
33
|
+
fixture: LifecycleFixture<Context>,
|
|
34
|
+
context: Context,
|
|
35
|
+
label: string,
|
|
36
|
+
): Promise<LifecycleHookCleanup> => {
|
|
37
|
+
let releaseUse: (() => void) | undefined;
|
|
38
|
+
const useLifetime = new Promise<void>((resolve) => {
|
|
39
|
+
releaseUse = resolve;
|
|
40
|
+
});
|
|
41
|
+
let acceptSetup: (() => void) | undefined;
|
|
42
|
+
let rejectSetup: ((error: unknown) => void) | undefined;
|
|
43
|
+
const setup = new Promise<void>((resolve, reject) => {
|
|
44
|
+
acceptSetup = resolve;
|
|
45
|
+
rejectSetup = reject;
|
|
46
|
+
});
|
|
47
|
+
let useCalls = 0;
|
|
48
|
+
let useObservations = 0;
|
|
49
|
+
let settled = false;
|
|
50
|
+
let completionError: unknown;
|
|
51
|
+
const completion = (async () => {
|
|
52
|
+
try {
|
|
53
|
+
await fixture(context, () => {
|
|
54
|
+
useCalls += 1;
|
|
55
|
+
if (useCalls > 1) {
|
|
56
|
+
throw new TypeError(`${label} called use() more than once`);
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
// biome-ignore lint/suspicious/noThenProperty: a custom thenable lets us detect a discarded use() lifetime.
|
|
60
|
+
then: (onfulfilled, onrejected) => {
|
|
61
|
+
useObservations += 1;
|
|
62
|
+
if (useObservations > 1) {
|
|
63
|
+
return Promise.reject(
|
|
64
|
+
new TypeError(`${label} awaited one use() more than once`),
|
|
65
|
+
).then(onfulfilled, onrejected);
|
|
66
|
+
}
|
|
67
|
+
acceptSetup?.();
|
|
68
|
+
return useLifetime.then(onfulfilled, onrejected);
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
if (useCalls === 0) {
|
|
73
|
+
throw new TypeError(`${label} must call and await use() exactly once`);
|
|
74
|
+
}
|
|
75
|
+
if (useObservations === 0) {
|
|
76
|
+
throw new TypeError(`${label} must await use()`);
|
|
77
|
+
}
|
|
78
|
+
} catch (error) {
|
|
79
|
+
completionError = error;
|
|
80
|
+
if (useObservations === 0) rejectSetup?.(error);
|
|
81
|
+
} finally {
|
|
82
|
+
settled = true;
|
|
83
|
+
}
|
|
84
|
+
})();
|
|
85
|
+
|
|
86
|
+
await setup;
|
|
87
|
+
await Promise.resolve();
|
|
88
|
+
if (settled) {
|
|
89
|
+
throw new TypeError(
|
|
90
|
+
completionError
|
|
91
|
+
? `${label} failed before its lifetime began: ${errorMessage(completionError)}`
|
|
92
|
+
: `${label} must await use()`,
|
|
93
|
+
{ cause: completionError },
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
let cleaned = false;
|
|
98
|
+
return async () => {
|
|
99
|
+
if (cleaned) return;
|
|
100
|
+
cleaned = true;
|
|
101
|
+
releaseUse?.();
|
|
102
|
+
await completion;
|
|
103
|
+
if (completionError) throw completionError;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Define suite and case lifetimes with Vitest-style `await use()` fixtures.
|
|
109
|
+
* Setup belongs before `use`; teardown belongs after it.
|
|
110
|
+
*/
|
|
111
|
+
export const defineFixtures = (definition: LifecycleFixturesDefinition): LifecycleHooksPlugin => {
|
|
112
|
+
if (!definition.suite && !definition.case) {
|
|
113
|
+
throw new TypeError("fixtures plugin must define suite or case");
|
|
114
|
+
}
|
|
115
|
+
if (definition.suite !== undefined && typeof definition.suite !== "function") {
|
|
116
|
+
throw new TypeError("fixtures plugin suite must be a function");
|
|
117
|
+
}
|
|
118
|
+
if (definition.case !== undefined && typeof definition.case !== "function") {
|
|
119
|
+
throw new TypeError("fixtures plugin case must be a function");
|
|
120
|
+
}
|
|
121
|
+
const suiteFixture = definition.suite;
|
|
122
|
+
const caseFixture = definition.case;
|
|
123
|
+
return defineLifecycleHooks({
|
|
124
|
+
name: definition.name,
|
|
125
|
+
pluginVersion: definition.pluginVersion,
|
|
126
|
+
...(definition.identity === undefined ? {} : { identity: definition.identity }),
|
|
127
|
+
implementationHash: valueHash({
|
|
128
|
+
identity: definition.identity,
|
|
129
|
+
suite: definition.suite,
|
|
130
|
+
case: definition.case,
|
|
131
|
+
}),
|
|
132
|
+
...(suiteFixture
|
|
133
|
+
? {
|
|
134
|
+
setupSuite: (context) =>
|
|
135
|
+
activateFixture(suiteFixture, context, `suite fixture '${definition.name}'`),
|
|
136
|
+
}
|
|
137
|
+
: {}),
|
|
138
|
+
...(caseFixture
|
|
139
|
+
? {
|
|
140
|
+
setupCase: (context) =>
|
|
141
|
+
activateFixture(caseFixture, context, `case fixture '${definition.name}'`),
|
|
142
|
+
}
|
|
143
|
+
: {}),
|
|
144
|
+
});
|
|
145
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { valueHash } from "./hash.js";
|
|
2
|
+
|
|
3
|
+
export type LifecycleHookCleanup = () => void | Promise<void>;
|
|
4
|
+
export type LifecycleHookSetupResult = LifecycleHookCleanup | undefined;
|
|
5
|
+
|
|
6
|
+
export type SuiteLifecycleHookItem = {
|
|
7
|
+
id: string;
|
|
8
|
+
caseId: string;
|
|
9
|
+
path: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type SuiteLifecycleHookContext = {
|
|
13
|
+
suiteId: string;
|
|
14
|
+
suiteDir: string;
|
|
15
|
+
runsRoot: string;
|
|
16
|
+
concurrency: number;
|
|
17
|
+
items: readonly SuiteLifecycleHookItem[];
|
|
18
|
+
abortSignal?: AbortSignal;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type CaseLifecycleHookContext = SuiteLifecycleHookContext & {
|
|
22
|
+
index: number;
|
|
23
|
+
item: SuiteLifecycleHookItem;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type LifecycleHooksPlugin = {
|
|
27
|
+
name: string;
|
|
28
|
+
/** Author-maintained identity for setup and teardown behavior. */
|
|
29
|
+
pluginVersion: string;
|
|
30
|
+
/**
|
|
31
|
+
* Public, non-secret values captured by hook closures and relevant to
|
|
32
|
+
* execution identity. Included in the implementation hash.
|
|
33
|
+
*/
|
|
34
|
+
identity?: unknown;
|
|
35
|
+
/**
|
|
36
|
+
* Hash of the authored callbacks when an adapter wraps them in closures.
|
|
37
|
+
* `defineLifecycleHooks` and `defineFixtures` populate this automatically.
|
|
38
|
+
*/
|
|
39
|
+
implementationHash?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Prepare resources shared by the selected suite. A returned cleanup runs
|
|
42
|
+
* exactly once after all cases settle, including abort and failure paths.
|
|
43
|
+
*/
|
|
44
|
+
setupSuite?(
|
|
45
|
+
context: SuiteLifecycleHookContext,
|
|
46
|
+
): LifecycleHookSetupResult | Promise<LifecycleHookSetupResult>;
|
|
47
|
+
/**
|
|
48
|
+
* Prepare resources private to one case attempt. A returned cleanup runs
|
|
49
|
+
* exactly once after that attempt settles. Concurrent cases may invoke this
|
|
50
|
+
* hook concurrently.
|
|
51
|
+
*/
|
|
52
|
+
setupCase?(
|
|
53
|
+
context: CaseLifecycleHookContext,
|
|
54
|
+
): LifecycleHookSetupResult | Promise<LifecycleHookSetupResult>;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const lifecycleHooksPluginIssue = (
|
|
58
|
+
definition: Partial<LifecycleHooksPlugin>,
|
|
59
|
+
): string | undefined => {
|
|
60
|
+
if (typeof definition.name !== "string" || !definition.name.trim()) {
|
|
61
|
+
return "lifecycle hooks plugin name must not be empty";
|
|
62
|
+
}
|
|
63
|
+
if (typeof definition.pluginVersion !== "string" || !definition.pluginVersion.trim()) {
|
|
64
|
+
return "lifecycle hooks plugin pluginVersion must not be empty";
|
|
65
|
+
}
|
|
66
|
+
if (
|
|
67
|
+
definition.implementationHash !== undefined &&
|
|
68
|
+
!/^[0-9a-f]{64}$/.test(definition.implementationHash)
|
|
69
|
+
) {
|
|
70
|
+
return "lifecycle hooks plugin implementationHash must be a SHA-256 hex digest";
|
|
71
|
+
}
|
|
72
|
+
if (definition.setupSuite !== undefined && typeof definition.setupSuite !== "function") {
|
|
73
|
+
return "lifecycle hooks plugin setupSuite must be a function";
|
|
74
|
+
}
|
|
75
|
+
if (definition.setupCase !== undefined && typeof definition.setupCase !== "function") {
|
|
76
|
+
return "lifecycle hooks plugin setupCase must be a function";
|
|
77
|
+
}
|
|
78
|
+
if (!definition.setupSuite && !definition.setupCase) {
|
|
79
|
+
return "lifecycle hooks plugin must define setupSuite or setupCase";
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Define versioned suite/case resource hooks for registration in
|
|
86
|
+
* the `lifecycleFixtures` list in `lux.config.ts`.
|
|
87
|
+
*/
|
|
88
|
+
export const defineLifecycleHooks = (definition: LifecycleHooksPlugin): LifecycleHooksPlugin => {
|
|
89
|
+
const issue = lifecycleHooksPluginIssue(definition);
|
|
90
|
+
if (issue) throw new TypeError(issue);
|
|
91
|
+
return {
|
|
92
|
+
...definition,
|
|
93
|
+
implementationHash:
|
|
94
|
+
definition.implementationHash ??
|
|
95
|
+
valueHash({
|
|
96
|
+
identity: definition.identity,
|
|
97
|
+
setupSuite: definition.setupSuite,
|
|
98
|
+
setupCase: definition.setupCase,
|
|
99
|
+
}),
|
|
100
|
+
};
|
|
101
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { RunEvent } from "./events.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* MCP-specific `progress` event kinds. Generic tool calls and results live in
|
|
5
|
+
* `tool-events`; MCP discovery metadata rides the same open progress stream.
|
|
6
|
+
*/
|
|
7
|
+
export const MCP_INIT_KIND = "mcp-init" as const;
|
|
8
|
+
export const MCP_TOOLS_LIST_KIND = "mcp-tools-list" as const;
|
|
9
|
+
|
|
10
|
+
/** A tool as reported by `tools/list`. */
|
|
11
|
+
export type ListedTool = {
|
|
12
|
+
name: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
inputSchema?: unknown;
|
|
16
|
+
outputSchema?: unknown;
|
|
17
|
+
annotations?: Record<string, unknown>;
|
|
18
|
+
execution?: Record<string, unknown>;
|
|
19
|
+
icons?: unknown[];
|
|
20
|
+
_meta?: Record<string, unknown>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** `initialize` result metadata, captured once when the server connects. */
|
|
24
|
+
export type McpInitPayload = {
|
|
25
|
+
serverInfo?: { name?: string; version?: string };
|
|
26
|
+
capabilities?: Record<string, unknown>;
|
|
27
|
+
instructions?: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type McpToolsListPayload = { tools: ListedTool[] };
|
|
31
|
+
|
|
32
|
+
type ProgressEvent = Extract<RunEvent, { type: "progress" }>;
|
|
33
|
+
|
|
34
|
+
const isProgressKind = (e: RunEvent, kind: string): e is ProgressEvent =>
|
|
35
|
+
e.type === "progress" && e.kind === kind;
|
|
36
|
+
|
|
37
|
+
export const isMcpInitEvent = (e: RunEvent): e is ProgressEvent => isProgressKind(e, MCP_INIT_KIND);
|
|
38
|
+
|
|
39
|
+
export const isMcpToolsListEvent = (e: RunEvent): e is ProgressEvent =>
|
|
40
|
+
isProgressKind(e, MCP_TOOLS_LIST_KIND);
|
|
41
|
+
|
|
42
|
+
/** The `initialize` metadata (the last `mcp-init` event wins), or undefined. */
|
|
43
|
+
export const mcpInit = (events: RunEvent[]): McpInitPayload | undefined => {
|
|
44
|
+
const hit = events.filter(isMcpInitEvent).at(-1);
|
|
45
|
+
return hit ? (hit.payload as McpInitPayload) : undefined;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** Tools from the last `tools/list` capture in the run. */
|
|
49
|
+
export const listedTools = (events: RunEvent[]): ListedTool[] => {
|
|
50
|
+
const hit = events.filter(isMcpToolsListEvent).at(-1);
|
|
51
|
+
const payload = hit?.payload as McpToolsListPayload | undefined;
|
|
52
|
+
return Array.isArray(payload?.tools) ? payload.tools : [];
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const hasMcpInit = (events: RunEvent[]): boolean => events.some(isMcpInitEvent);
|
|
56
|
+
|
|
57
|
+
export const hasMcpToolsList = (events: RunEvent[]): boolean => events.some(isMcpToolsListEvent);
|