niceeval 0.13.1 → 0.13.2
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/INDEX.md +25 -2
- package/README.md +9 -10
- package/README.zh.md +9 -10
- package/dist/agents/ai-sdk.cjs.map +1 -1
- package/dist/agents/ai-sdk.d.cts +1 -1
- package/dist/agents/ai-sdk.d.mts +1 -1
- package/dist/agents/ai-sdk.d.ts +1 -1
- package/dist/agents/bub-install-spec.cjs +19 -5
- package/dist/agents/bub-install-spec.cjs.map +1 -1
- package/dist/agents/bub-install-spec.d.cts +9 -2
- package/dist/agents/bub-install-spec.d.mts +9 -2
- package/dist/agents/bub-install-spec.d.ts +9 -2
- package/dist/agents/bub-install-spec.js +14 -12
- package/dist/agents/bub.cjs +10 -6
- package/dist/agents/bub.cjs.map +1 -1
- package/dist/agents/bub.d.cts +2 -2
- package/dist/agents/bub.d.mts +2 -2
- package/dist/agents/bub.d.ts +2 -2
- package/dist/agents/claude-code.cjs.map +1 -1
- package/dist/agents/claude-code.d.cts +2 -2
- package/dist/agents/claude-code.d.mts +2 -2
- package/dist/agents/claude-code.d.ts +2 -2
- package/dist/agents/codex.cjs +4 -4
- package/dist/agents/codex.cjs.map +1 -1
- package/dist/agents/codex.d.cts +3 -3
- package/dist/agents/codex.d.mts +3 -3
- package/dist/agents/codex.d.ts +3 -3
- package/dist/agents/coding-cli-versions.cjs +10 -1
- package/dist/agents/coding-cli-versions.cjs.map +1 -1
- package/dist/agents/coding-cli-versions.d.cts +8 -3
- package/dist/agents/coding-cli-versions.d.mts +8 -3
- package/dist/agents/coding-cli-versions.d.ts +8 -3
- package/dist/agents/coding-cli-versions.js +18 -12
- package/dist/agents/deepseek-harness.cjs +151 -0
- package/dist/agents/deepseek-harness.cjs.map +1 -0
- package/dist/agents/deepseek-harness.d.cts +14 -0
- package/dist/agents/deepseek-harness.d.mts +14 -0
- package/dist/agents/deepseek-harness.d.ts +14 -0
- package/dist/agents/deepseek-harness.js +7 -0
- package/dist/agents/deepseek-harness.js.map +1 -0
- package/dist/agents/exact-npm-plugins.cjs +28 -0
- package/dist/agents/exact-npm-plugins.cjs.map +1 -0
- package/dist/agents/exact-npm-plugins.d.cts +10 -0
- package/dist/agents/exact-npm-plugins.d.mts +10 -0
- package/dist/agents/exact-npm-plugins.d.ts +10 -0
- package/dist/agents/exact-npm-plugins.js +8 -0
- package/dist/agents/exact-npm-plugins.js.map +1 -0
- package/dist/agents/index.cjs +5 -1
- package/dist/agents/index.cjs.map +1 -1
- package/dist/agents/index.d.cts +4 -0
- package/dist/agents/index.d.mts +4 -0
- package/dist/agents/index.d.ts +4 -0
- package/dist/agents/index.js +54 -50
- package/dist/agents/index.mjs +54 -50
- package/dist/agents/omp.cjs +170 -0
- package/dist/agents/omp.cjs.map +1 -0
- package/dist/agents/omp.d.cts +14 -0
- package/dist/agents/omp.d.mts +14 -0
- package/dist/agents/omp.d.ts +14 -0
- package/dist/agents/omp.js +7 -0
- package/dist/agents/omp.js.map +1 -0
- package/dist/agents/openclaw.cjs +51 -2
- package/dist/agents/openclaw.cjs.map +1 -1
- package/dist/agents/openclaw.d.cts +2 -0
- package/dist/agents/openclaw.d.mts +2 -0
- package/dist/agents/openclaw.d.ts +2 -0
- package/dist/agents/types.cjs.map +1 -1
- package/dist/agents/types.d.cts +4 -4
- package/dist/agents/types.d.mts +4 -4
- package/dist/agents/types.d.ts +4 -4
- package/dist/agents/ui-message-stream.cjs +24 -7
- package/dist/agents/ui-message-stream.cjs.map +1 -1
- package/dist/analysis/api.cjs +28 -2
- package/dist/analysis/api.cjs.map +1 -1
- package/dist/analysis/api.d.cts +22 -1
- package/dist/analysis/api.d.mts +22 -1
- package/dist/analysis/api.d.ts +22 -1
- package/dist/analysis/api.js +8 -6
- package/dist/analysis/bindings.cjs +11 -18
- package/dist/analysis/bindings.cjs.map +1 -1
- package/dist/analysis/bindings.d.cts +177 -49
- package/dist/analysis/bindings.d.mts +177 -49
- package/dist/analysis/bindings.d.ts +177 -49
- package/dist/analysis/contracts.cjs +1 -0
- package/dist/analysis/contracts.cjs.map +1 -1
- package/dist/analysis/contracts.d.cts +43 -3
- package/dist/analysis/contracts.d.mts +43 -3
- package/dist/analysis/contracts.d.ts +43 -3
- package/dist/analysis/cost-projection.cjs +2 -1
- package/dist/analysis/cost-projection.cjs.map +1 -1
- package/dist/analysis/cost-projection.d.cts +1 -1
- package/dist/analysis/cost-projection.d.mts +1 -1
- package/dist/analysis/cost-projection.d.ts +1 -1
- package/dist/analysis/cost.cjs +13 -3
- package/dist/analysis/cost.cjs.map +1 -1
- package/dist/analysis/cost.d.cts +10 -3
- package/dist/analysis/cost.d.mts +10 -3
- package/dist/analysis/cost.d.ts +10 -3
- package/dist/analysis/experiment-groups.cjs +96 -0
- package/dist/analysis/experiment-groups.cjs.map +1 -0
- package/dist/analysis/experiment-groups.d.cts +9 -0
- package/dist/analysis/experiment-groups.d.mts +9 -0
- package/dist/analysis/experiment-groups.d.ts +9 -0
- package/dist/analysis/experiment-groups.js +10 -0
- package/dist/analysis/experiment-groups.js.map +1 -0
- package/dist/analysis/index.cjs +4 -1
- package/dist/analysis/index.cjs.map +1 -1
- package/dist/analysis/index.d.cts +4 -2
- package/dist/analysis/index.d.mts +4 -2
- package/dist/analysis/index.d.ts +4 -2
- package/dist/analysis/index.js +40 -36
- package/dist/analysis/index.mjs +40 -36
- package/dist/assertions/limits.cjs +4 -0
- package/dist/assertions/limits.cjs.map +1 -1
- package/dist/assertions/limits.d.cts +4 -0
- package/dist/assertions/limits.d.mts +4 -0
- package/dist/assertions/limits.d.ts +4 -0
- package/dist/assertions/match.cjs +63 -25
- package/dist/assertions/match.cjs.map +1 -1
- package/dist/assertions/match.d.cts +7 -0
- package/dist/assertions/match.d.mts +7 -0
- package/dist/assertions/match.d.ts +7 -0
- package/dist/assertions/record/attachment.cjs +32 -4
- package/dist/assertions/record/attachment.cjs.map +1 -1
- package/dist/assertions/record/diff.cjs +10 -4
- package/dist/assertions/record/diff.cjs.map +1 -1
- package/dist/assertions/record/producer.cjs +101 -4
- package/dist/assertions/record/producer.cjs.map +1 -1
- package/dist/assertions/record/producer.d.cts +4 -1
- package/dist/assertions/record/producer.d.mts +4 -1
- package/dist/assertions/record/producer.d.ts +4 -1
- package/dist/assertions/runtime.cjs +45 -5
- package/dist/assertions/runtime.cjs.map +1 -1
- package/dist/cli/record.cjs +113 -8
- package/dist/cli/record.cjs.map +1 -1
- package/dist/cli/record.d.cts +20 -1
- package/dist/cli/record.d.mts +20 -1
- package/dist/cli/record.d.ts +20 -1
- package/dist/cli/record.js +4 -2
- package/dist/cli.cjs +386 -31
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +10 -2
- package/dist/cli.d.mts +10 -2
- package/dist/cli.d.ts +10 -2
- package/dist/context/send-retry.cjs +4 -4
- package/dist/context/send-retry.cjs.map +1 -1
- package/dist/coordination/host/runtime.cjs +8 -30
- package/dist/coordination/host/runtime.cjs.map +1 -1
- package/dist/coordination/host/runtime.d.cts +3 -3
- package/dist/coordination/host/runtime.d.mts +3 -3
- package/dist/coordination/host/runtime.d.ts +3 -3
- package/dist/coordination/host/types.cjs.map +1 -1
- package/dist/coordination/host/types.d.cts +0 -5
- package/dist/coordination/host/types.d.mts +0 -5
- package/dist/coordination/host/types.d.ts +0 -5
- package/dist/coordination/platform/node.cjs +90 -9
- package/dist/coordination/platform/node.cjs.map +1 -1
- package/dist/define.cjs +25 -1
- package/dist/define.cjs.map +1 -1
- package/dist/experiment/host/index.cjs +1 -0
- package/dist/experiment/host/index.cjs.map +1 -1
- package/dist/i18n/en.cjs +26 -8
- package/dist/i18n/en.cjs.map +1 -1
- package/dist/i18n/en.d.cts +19 -6
- package/dist/i18n/en.d.mts +19 -6
- package/dist/i18n/en.d.ts +19 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/o11y/parsers/hermes.cjs +1 -1
- package/dist/o11y/parsers/hermes.cjs.map +1 -1
- package/dist/o11y/prices.json +1 -1
- package/dist/o11y/record/families.cjs +12 -3
- package/dist/o11y/record/families.cjs.map +1 -1
- package/dist/o11y/record/families.d.cts +8 -8
- package/dist/o11y/record/families.d.mts +8 -8
- package/dist/o11y/record/families.d.ts +8 -8
- package/dist/o11y/record/family-projectors.d.cts +66 -18
- package/dist/o11y/record/family-projectors.d.mts +66 -18
- package/dist/o11y/record/family-projectors.d.ts +66 -18
- package/dist/o11y/record/family-writers.d.cts +11 -3
- package/dist/o11y/record/family-writers.d.mts +11 -3
- package/dist/o11y/record/family-writers.d.ts +11 -3
- package/dist/o11y/record/runner-producer.cjs +14 -4
- package/dist/o11y/record/runner-producer.cjs.map +1 -1
- package/dist/record/codec/core.d.cts +2 -2
- package/dist/record/codec/core.d.mts +2 -2
- package/dist/record/codec/core.d.ts +2 -2
- package/dist/record/family/catalog.d.cts +44 -12
- package/dist/record/family/catalog.d.mts +44 -12
- package/dist/record/family/catalog.d.ts +44 -12
- package/dist/record/family/index.js +128 -124
- package/dist/record/family/observability-v1.cjs +35 -0
- package/dist/record/family/observability-v1.cjs.map +1 -0
- package/dist/record/family/observability-v1.d.cts +3 -0
- package/dist/record/family/observability-v1.d.mts +3 -0
- package/dist/record/family/observability-v1.d.ts +3 -0
- package/dist/record/family/observability-v1.js +6 -0
- package/dist/record/family/observability-v1.js.map +1 -0
- package/dist/record/family/observability.cjs +58 -9
- package/dist/record/family/observability.cjs.map +1 -1
- package/dist/record/family/observability.d.cts +1014 -15
- package/dist/record/family/observability.d.mts +1014 -15
- package/dist/record/family/observability.d.ts +1014 -15
- package/dist/record/family/observability.js +22 -18
- package/dist/record/host/runtime.cjs +600 -31
- package/dist/record/host/runtime.cjs.map +1 -1
- package/dist/record/host/types.cjs.map +1 -1
- package/dist/record/host/types.d.cts +33 -9
- package/dist/record/host/types.d.mts +33 -9
- package/dist/record/host/types.d.ts +33 -9
- package/dist/record/maintenance/runtime.cjs +1 -2
- package/dist/record/maintenance/runtime.cjs.map +1 -1
- package/dist/record/model/core.cjs.map +1 -1
- package/dist/record/model/core.d.cts +1 -1
- package/dist/record/model/core.d.mts +1 -1
- package/dist/record/model/core.d.ts +1 -1
- package/dist/record/model/definition.d.cts +6 -6
- package/dist/record/model/definition.d.mts +6 -6
- package/dist/record/model/definition.d.ts +6 -6
- package/dist/record/model/identifiers.cjs +1 -1
- package/dist/record/model/identifiers.cjs.map +1 -1
- package/dist/record/model/identifiers.d.cts +1 -1
- package/dist/record/model/identifiers.d.mts +1 -1
- package/dist/record/model/identifiers.d.ts +1 -1
- package/dist/record/platform/node.cjs +159 -23
- package/dist/record/platform/node.cjs.map +1 -1
- package/dist/record/platform/services.cjs.map +1 -1
- package/dist/record/platform/services.d.cts +15 -2
- package/dist/record/platform/services.d.mts +15 -2
- package/dist/record/platform/services.d.ts +15 -2
- package/dist/record/reader/errors.cjs +37 -1
- package/dist/record/reader/errors.cjs.map +1 -1
- package/dist/record/reader/errors.d.cts +49 -1
- package/dist/record/reader/errors.d.mts +49 -1
- package/dist/record/reader/errors.d.ts +49 -1
- package/dist/record/reader/errors.js +22 -12
- package/dist/record/reader/format.cjs +76 -17
- package/dist/record/reader/format.cjs.map +1 -1
- package/dist/record/reader/format.d.cts +11 -4
- package/dist/record/reader/format.d.mts +11 -4
- package/dist/record/reader/format.d.ts +11 -4
- package/dist/record/reader/format.js +2 -0
- package/dist/record/reader/index.js +32 -18
- package/dist/record/reader/runtime.cjs +64 -0
- package/dist/record/reader/runtime.cjs.map +1 -1
- package/dist/record/reader/runtime.d.cts +15 -0
- package/dist/record/reader/runtime.d.mts +15 -0
- package/dist/record/reader/runtime.d.ts +15 -0
- package/dist/record/reader/runtime.js +2 -0
- package/dist/report/assets/styles.css +53 -29
- package/dist/report/built-in/analysis-values.cjs +21 -13
- package/dist/report/built-in/analysis-values.cjs.map +1 -1
- package/dist/report/built-in/analysis-values.d.cts +11 -22
- package/dist/report/built-in/analysis-values.d.mts +11 -22
- package/dist/report/built-in/analysis-values.d.ts +11 -22
- package/dist/report/built-in/analysis-values.js +4 -6
- package/dist/report/built-in/index.cjs +1 -3
- package/dist/report/built-in/index.cjs.map +1 -1
- package/dist/report/built-in/index.d.cts +1 -1
- package/dist/report/built-in/index.d.mts +1 -1
- package/dist/report/built-in/index.d.ts +1 -1
- package/dist/report/built-in/index.js +4 -8
- package/dist/report/built-in/index.mjs +4 -8
- package/dist/report/built-in/machine.cjs +0 -2
- package/dist/report/built-in/machine.cjs.map +1 -1
- package/dist/report/built-in/machine.d.cts +0 -2
- package/dist/report/built-in/machine.d.mts +0 -2
- package/dist/report/built-in/machine.d.ts +0 -2
- package/dist/report/built-in/result-components.cjs +49 -51
- package/dist/report/built-in/result-components.cjs.map +1 -1
- package/dist/report/built-in/result-components.d.cts +16 -17
- package/dist/report/built-in/result-components.d.mts +16 -17
- package/dist/report/built-in/result-components.d.ts +16 -17
- package/dist/report/built-in/result-components.js +0 -4
- package/dist/report/built-in/run-membership-overview.cjs +126 -17
- package/dist/report/built-in/run-membership-overview.cjs.map +1 -1
- package/dist/report/built-in/run-membership-overview.d.cts +14 -0
- package/dist/report/built-in/run-membership-overview.d.mts +14 -0
- package/dist/report/built-in/run-membership-overview.d.ts +14 -0
- package/dist/report/built-in/run-membership-overview.js +4 -2
- package/dist/report/built-in/standard.cjs +80 -45
- package/dist/report/built-in/standard.cjs.map +1 -1
- package/dist/report/built-in/standard.d.cts +19 -41
- package/dist/report/built-in/standard.d.mts +19 -41
- package/dist/report/built-in/standard.d.ts +19 -41
- package/dist/report/built-in/standard.js +6 -6
- package/dist/report/components/attempt-detail/compute.cjs +78 -2
- package/dist/report/components/attempt-detail/compute.cjs.map +1 -1
- package/dist/report/components/attempt-detail/compute.d.cts +1 -1
- package/dist/report/components/attempt-detail/compute.d.mts +1 -1
- package/dist/report/components/attempt-detail/compute.d.ts +1 -1
- package/dist/report/components/attempt-detail/content.cjs +1 -1
- package/dist/report/components/attempt-detail/content.cjs.map +1 -1
- package/dist/report/components/entity-lists/compute.cjs +42 -5
- package/dist/report/components/entity-lists/compute.cjs.map +1 -1
- package/dist/report/components/entity-lists/compute.d.cts +10 -8
- package/dist/report/components/entity-lists/compute.d.mts +10 -8
- package/dist/report/components/entity-lists/compute.d.ts +10 -8
- package/dist/report/components/entity-lists/content.cjs +31 -6
- package/dist/report/components/entity-lists/content.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.cjs +9 -4
- package/dist/report/components/entity-lists/index.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.d.cts +4 -7
- package/dist/report/components/entity-lists/index.d.mts +4 -7
- package/dist/report/components/entity-lists/index.d.ts +4 -7
- package/dist/report/components/summaries/compute.cjs +8 -1
- package/dist/report/components/summaries/compute.cjs.map +1 -1
- package/dist/report/components/summaries/compute.d.cts +9 -1
- package/dist/report/components/summaries/compute.d.mts +9 -1
- package/dist/report/components/summaries/compute.d.ts +9 -1
- package/dist/report/components/summaries/index.cjs +48 -4
- package/dist/report/components/summaries/index.cjs.map +1 -1
- package/dist/report/components/summaries/index.d.cts +7 -4
- package/dist/report/components/summaries/index.d.mts +7 -4
- package/dist/report/components/summaries/index.d.ts +7 -4
- package/dist/report/definition/cell.cjs +3 -0
- package/dist/report/definition/cell.cjs.map +1 -1
- package/dist/report/definition/cell.d.cts +2 -0
- package/dist/report/definition/cell.d.mts +2 -0
- package/dist/report/definition/cell.d.ts +2 -0
- package/dist/report/definition/primitives/chart.cjs +8 -5
- package/dist/report/definition/primitives/chart.cjs.map +1 -1
- package/dist/report/definition/primitives/points-dataset.cjs +1 -0
- package/dist/report/definition/primitives/points-dataset.cjs.map +1 -1
- package/dist/report/definition/primitives.cjs +15 -2
- package/dist/report/definition/primitives.cjs.map +1 -1
- package/dist/report/definition/report.cjs +27 -3
- package/dist/report/definition/report.cjs.map +1 -1
- package/dist/report/definition/report.d.cts +8 -0
- package/dist/report/definition/report.d.mts +8 -0
- package/dist/report/definition/report.d.ts +8 -0
- package/dist/report/execution/machine.cjs +30 -14
- package/dist/report/execution/machine.cjs.map +1 -1
- package/dist/report/execution/machine.d.cts +20 -10
- package/dist/report/execution/machine.d.mts +20 -10
- package/dist/report/execution/machine.d.ts +20 -10
- package/dist/report/execution/machine.js +6 -6
- package/dist/report/host/execute.cjs +25 -16
- package/dist/report/host/execute.cjs.map +1 -1
- package/dist/report/host/execute.d.cts +4 -0
- package/dist/report/host/execute.d.mts +4 -0
- package/dist/report/host/execute.d.ts +4 -0
- package/dist/report/host/from-record.cjs +22 -5
- package/dist/report/host/from-record.cjs.map +1 -1
- package/dist/report/host/machine.cjs +53 -11
- package/dist/report/host/machine.cjs.map +1 -1
- package/dist/report/host/site-runtime.cjs +9 -8
- package/dist/report/host/site-runtime.cjs.map +1 -1
- package/dist/report/host/site-runtime.d.cts +1 -1
- package/dist/report/host/site-runtime.d.mts +1 -1
- package/dist/report/host/site-runtime.d.ts +1 -1
- package/dist/report/host/static.cjs +56 -9
- package/dist/report/host/static.cjs.map +1 -1
- package/dist/report/index.cjs.map +1 -1
- package/dist/report/index.d.cts +1 -1
- package/dist/report/index.d.mts +1 -1
- package/dist/report/index.d.ts +1 -1
- package/dist/report/model/dataset.cjs +7 -2
- package/dist/report/model/dataset.cjs.map +1 -1
- package/dist/report/model/locale.cjs +2 -0
- package/dist/report/model/locale.cjs.map +1 -1
- package/dist/report/model/locale.d.cts +1 -0
- package/dist/report/model/locale.d.mts +1 -0
- package/dist/report/model/locale.d.ts +1 -0
- package/dist/report/model/metrics.cjs +3 -1
- package/dist/report/model/metrics.cjs.map +1 -1
- package/dist/report/model/pricing.cjs +16 -11
- package/dist/report/model/pricing.cjs.map +1 -1
- package/dist/report/react/styles.css +53 -29
- package/dist/runner/adoption.cjs +1 -0
- package/dist/runner/adoption.cjs.map +1 -1
- package/dist/runner/attempt.cjs +44 -5
- package/dist/runner/attempt.cjs.map +1 -1
- package/dist/runner/attempt.d.cts +13 -1
- package/dist/runner/attempt.d.mts +13 -1
- package/dist/runner/attempt.d.ts +13 -1
- package/dist/runner/config-identity.cjs +10 -2
- package/dist/runner/config-identity.cjs.map +1 -1
- package/dist/runner/config-identity.d.cts +4 -2
- package/dist/runner/config-identity.d.mts +4 -2
- package/dist/runner/config-identity.d.ts +4 -2
- package/dist/runner/feedback/human.cjs +298 -59
- package/dist/runner/feedback/human.cjs.map +1 -1
- package/dist/runner/feedback/json.cjs +14 -6
- package/dist/runner/feedback/json.cjs.map +1 -1
- package/dist/runner/feedback/json.d.cts +3 -2
- package/dist/runner/feedback/json.d.mts +3 -2
- package/dist/runner/feedback/json.d.ts +3 -2
- package/dist/runner/feedback/reducer.cjs +2 -0
- package/dist/runner/feedback/reducer.cjs.map +1 -1
- package/dist/runner/judge-config.cjs +1 -1
- package/dist/runner/judge-config.cjs.map +1 -1
- package/dist/runner/ledger.cjs +124 -12
- package/dist/runner/ledger.cjs.map +1 -1
- package/dist/runner/project-current.cjs +13 -5
- package/dist/runner/project-current.cjs.map +1 -1
- package/dist/runner/run.cjs +564 -256
- package/dist/runner/run.cjs.map +1 -1
- package/dist/runner/sandbox-pool.cjs +161 -30
- package/dist/runner/sandbox-pool.cjs.map +1 -1
- package/dist/runner/sandbox-pool.d.cts +34 -2
- package/dist/runner/sandbox-pool.d.mts +34 -2
- package/dist/runner/sandbox-pool.d.ts +34 -2
- package/dist/runner/shared-state-lease.cjs +803 -0
- package/dist/runner/shared-state-lease.cjs.map +1 -0
- package/dist/runner/shared-state-lease.d.cts +121 -0
- package/dist/runner/shared-state-lease.d.mts +121 -0
- package/dist/runner/shared-state-lease.d.ts +121 -0
- package/dist/runner/shared-state-lease.js +24 -0
- package/dist/runner/shared-state-lease.js.map +1 -0
- package/dist/runner/teardown-registry.cjs +97 -34
- package/dist/runner/teardown-registry.cjs.map +1 -1
- package/dist/runner/teardown-registry.d.cts +27 -1
- package/dist/runner/teardown-registry.d.mts +27 -1
- package/dist/runner/teardown-registry.d.ts +27 -1
- package/dist/runner/teardown-registry.js +20 -16
- package/dist/runner/types.cjs.map +1 -1
- package/dist/runner/types.d.cts +31 -5
- package/dist/runner/types.d.mts +31 -5
- package/dist/runner/types.d.ts +31 -5
- package/dist/sample/analysis.cjs +249 -459
- package/dist/sample/analysis.cjs.map +1 -1
- package/dist/sample/capability.cjs +138 -7
- package/dist/sample/capability.cjs.map +1 -1
- package/dist/sample/capability.d.cts +3 -1
- package/dist/sample/capability.d.mts +3 -1
- package/dist/sample/capability.d.ts +3 -1
- package/dist/sample/capability.js +8 -6
- package/dist/sandbox/docker-agent-image.cjs +5 -1
- package/dist/sandbox/docker-agent-image.cjs.map +1 -1
- package/dist/sandbox/docker-agent-image.d.cts +2 -0
- package/dist/sandbox/docker-agent-image.d.mts +2 -0
- package/dist/sandbox/docker-agent-image.d.ts +2 -0
- package/dist/sandbox/docker-agent-image.js +14 -10
- package/dist/sandbox/docker-profile/schema.cjs +283 -534
- package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
- package/dist/sandbox/docker-profile/schema.d.cts +10 -27
- package/dist/sandbox/docker-profile/schema.d.mts +10 -27
- package/dist/sandbox/docker-profile/schema.d.ts +10 -27
- package/dist/sandbox/e2b-agent-template.cjs +5 -2
- package/dist/sandbox/e2b-agent-template.cjs.map +1 -1
- package/dist/sandbox/index.cjs +4 -2
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.d.cts +1 -1
- package/dist/sandbox/index.d.mts +1 -1
- package/dist/sandbox/index.d.ts +1 -1
- package/dist/sandbox/index.js +120 -116
- package/dist/sandbox/index.mjs +120 -116
- package/dist/sandbox/keep-registry.cjs +28 -66
- package/dist/sandbox/keep-registry.cjs.map +1 -1
- package/dist/sandbox/types.cjs.map +1 -1
- package/dist/sandbox/types.d.cts +1 -1
- package/dist/sandbox/types.d.mts +1 -1
- package/dist/sandbox/types.d.ts +1 -1
- package/dist/shared/aggregate.cjs +16 -6
- package/dist/shared/aggregate.cjs.map +1 -1
- package/dist/shared/aggregate.d.cts +12 -4
- package/dist/shared/aggregate.d.mts +12 -4
- package/dist/shared/aggregate.d.ts +12 -4
- package/dist/shared/turn-label.cjs +20 -2
- package/dist/shared/turn-label.cjs.map +1 -1
- package/dist/shared/turn-label.d.cts +2 -0
- package/dist/shared/turn-label.d.mts +2 -0
- package/dist/shared/turn-label.d.ts +2 -0
- package/dist/shared/turn-label.js +4 -2
- package/dist/vendor/remark/remark-gfm.cjs +7 -7
- package/dist/vendor/remark/remark-gfm.cjs.map +1 -1
- package/dist/vendor/remark/remark-parse.cjs +12 -12
- package/dist/vendor/remark/remark-parse.cjs.map +1 -1
- package/dist/vendor/remark/remark.cjs +13 -13
- package/dist/vendor/remark/remark.cjs.map +1 -1
- package/dist/view/server.cjs +6 -0
- package/dist/view/server.cjs.map +1 -1
- package/docs-site/images/hitl-handshake-zh.svg +3 -3
- package/docs-site/zh/examples/ai-agent-application.mdx +1 -1
- package/docs-site/zh/examples/coding-agent-extensions.mdx +1 -1
- package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +4 -3
- package/docs-site/zh/examples/integrations/claude-sdk.mdx +3 -3
- package/docs-site/zh/examples/integrations/codex-sdk.mdx +5 -5
- package/docs-site/zh/examples/integrations/langgraph.mdx +4 -4
- package/docs-site/zh/examples/integrations/pi-sdk.mdx +5 -5
- package/docs-site/zh/explanation/adapter.mdx +5 -5
- package/docs-site/zh/explanation/assert.mdx +7 -7
- package/docs-site/zh/explanation/drive.mdx +4 -2
- package/docs-site/zh/explanation/evals.mdx +10 -8
- package/docs-site/zh/explanation/experiment.mdx +2 -2
- package/docs-site/zh/explanation/hitl.mdx +9 -9
- package/docs-site/zh/explanation/judge.mdx +5 -5
- package/docs-site/zh/explanation/overview.mdx +3 -3
- package/docs-site/zh/explanation/runner.mdx +1 -1
- package/docs-site/zh/index.mdx +3 -3
- package/docs-site/zh/reference/builtin-agents.mdx +13 -13
- package/docs-site/zh/reference/capabilities.mdx +1 -1
- package/docs-site/zh/reference/cli.mdx +18 -12
- package/docs-site/zh/reference/define-agent.mdx +130 -5
- package/docs-site/zh/reference/define-config.mdx +2 -2
- package/docs-site/zh/reference/define-eval.mdx +4 -4
- package/docs-site/zh/reference/events.mdx +11 -11
- package/docs-site/zh/reference/official-adapters.mdx +6 -6
- package/docs-site/zh/reference/results-data.mdx +6 -0
- package/docs-site/zh/troubleshooting/debugging.mdx +1 -1
- package/docs-site/zh/troubleshooting/recover-after-kill.mdx +37 -5
- package/docs-site/zh/tutorials/accept-results.mdx +72 -0
- package/docs-site/zh/tutorials/agent-onboarding.mdx +6 -6
- package/docs-site/zh/tutorials/authoring.mdx +9 -13
- package/docs-site/zh/tutorials/ci-integration.mdx +6 -6
- package/docs-site/zh/tutorials/compare-runs.mdx +61 -0
- package/docs-site/zh/tutorials/concurrency.mdx +13 -12
- package/docs-site/zh/tutorials/configuration.mdx +4 -6
- package/docs-site/zh/tutorials/connect-your-agent.mdx +1 -1
- package/docs-site/zh/tutorials/control-run-cost.mdx +58 -0
- package/docs-site/zh/tutorials/criteria-files.mdx +2 -2
- package/docs-site/zh/tutorials/custom-reports.mdx +2 -2
- package/docs-site/zh/tutorials/debug-lifecycle-plan.mdx +46 -0
- package/docs-site/zh/tutorials/docker-in-docker.mdx +52 -43
- package/docs-site/zh/tutorials/eval-groups.mdx +6 -6
- package/docs-site/zh/tutorials/evaluation-kinds.mdx +3 -3
- package/docs-site/zh/tutorials/experiments.mdx +2 -3
- package/docs-site/zh/tutorials/handle-execution-failures.mdx +18 -10
- package/docs-site/zh/tutorials/install-custom-sandbox-agent.mdx +16 -8
- package/docs-site/zh/tutorials/nixos-managed-dind.mdx +160 -0
- package/docs-site/zh/tutorials/plugins.mdx +14 -0
- package/docs-site/zh/tutorials/rerun-and-cache.mdx +4 -2
- package/docs-site/zh/tutorials/sandbox-agent.mdx +17 -11
- package/docs-site/zh/tutorials/sandbox-providers.mdx +17 -13
- package/docs-site/zh/tutorials/sandbox-reuse.mdx +12 -19
- package/docs-site/zh/tutorials/select-and-preview.mdx +65 -0
- package/docs-site/zh/tutorials/verify-judge.mdx +78 -0
- package/docs-site/zh/tutorials/viewing-results.mdx +38 -1
- package/docs-site/zh/tutorials/write-experiment.mdx +7 -5
- package/docs-site/zh/tutorials/write-send.mdx +9 -8
- package/package.json +9 -5
- package/dist/report/built-in/overview.cjs +0 -44
- package/dist/report/built-in/overview.cjs.map +0 -1
- package/dist/report/built-in/overview.d.cts +0 -6
- package/dist/report/built-in/overview.d.mts +0 -6
- package/dist/report/built-in/overview.d.ts +0 -6
- package/dist/report/built-in/overview.js +0 -9
- package/dist/report/built-in/overview.js.map +0 -1
- package/dist/runner/gate-lease.cjs +0 -283
- package/dist/runner/gate-lease.cjs.map +0 -1
- package/dist/runner/gate-lease.d.cts +0 -62
- package/dist/runner/gate-lease.d.mts +0 -62
- package/dist/runner/gate-lease.d.ts +0 -62
- package/dist/runner/gate-lease.js +0 -22
- package/dist/runner/gate-lease.js.map +0 -1
package/dist/sample/analysis.cjs
CHANGED
|
@@ -158,32 +158,252 @@ function decodeSampleSnapshot(value) {
|
|
|
158
158
|
}
|
|
159
159
|
/** @internal Typed codec branch for host diagnostics. */
|
|
160
160
|
function decodeSampleSnapshotEither(value) {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return effect_1.Either.left(selection.left);
|
|
169
|
-
const runs = decodeRuns(valueAt(value, "runs"), ["runs"]);
|
|
170
|
-
if (effect_1.Either.isLeft(runs))
|
|
171
|
-
return effect_1.Either.left(runs.left);
|
|
172
|
-
const slots = decodeSlots(valueAt(value, "slots"), ["slots"]);
|
|
173
|
-
if (effect_1.Either.isLeft(slots))
|
|
174
|
-
return effect_1.Either.left(slots.left);
|
|
175
|
-
const alignment = validateSlotRunAlignment(runs.right, slots.right);
|
|
161
|
+
const decoded = effect_1.Schema.decodeUnknownEither(SampleSnapshotWireSchema, SampleSchemaParseOptions)(value);
|
|
162
|
+
if (effect_1.Either.isLeft(decoded))
|
|
163
|
+
return effect_1.Either.left(codecErrorFromSchema(decoded.left));
|
|
164
|
+
const canonical = canonicalizeSnapshotWire(decoded.right);
|
|
165
|
+
if (effect_1.Either.isLeft(canonical))
|
|
166
|
+
return effect_1.Either.left(canonical.left);
|
|
167
|
+
const alignment = validateSlotRunAlignment(canonical.right.runs, canonical.right.slots);
|
|
176
168
|
if (alignment !== undefined)
|
|
177
169
|
return effect_1.Either.left(alignment);
|
|
178
|
-
const snapshot = makeSnapshot(
|
|
179
|
-
if (
|
|
170
|
+
const snapshot = makeSnapshot(canonical.right);
|
|
171
|
+
if (decoded.right.identity.kind !== snapshot.identity.kind || decoded.right.identity.id !== snapshot.identity.id) {
|
|
180
172
|
return effect_1.Either.left(codecError(["identity"], "does not match the canonical frozen selection"));
|
|
181
173
|
}
|
|
182
|
-
if (!sameCoverage(
|
|
174
|
+
if (!sameCoverage(decoded.right.coverage, snapshot.coverage)) {
|
|
183
175
|
return effect_1.Either.left(codecError(["coverage"], "does not satisfy the canonical coverage equations"));
|
|
184
176
|
}
|
|
185
177
|
return effect_1.Either.right(snapshot);
|
|
186
178
|
}
|
|
179
|
+
const SampleSchemaParseOptions = Object.freeze({
|
|
180
|
+
errors: "all",
|
|
181
|
+
exact: true,
|
|
182
|
+
onExcessProperty: "error",
|
|
183
|
+
});
|
|
184
|
+
const PlainObjectSchema = effect_1.Schema.declare((value) => {
|
|
185
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
186
|
+
return false;
|
|
187
|
+
const prototype = Object.getPrototypeOf(value);
|
|
188
|
+
return prototype === Object.prototype || prototype === null;
|
|
189
|
+
}, { identifier: "SamplePlainObject", description: "a plain object or null-prototype record" });
|
|
190
|
+
const plainStruct = (fields) => effect_1.Schema.compose(effect_1.Schema.Struct(fields), { strict: false })(PlainObjectSchema);
|
|
191
|
+
const AttemptOrdinalSchema = effect_1.Schema.JsonNumber.pipe(effect_1.Schema.filter((value) => Number.isSafeInteger(value) && value >= 0, {
|
|
192
|
+
identifier: "SampleAttemptOrdinal",
|
|
193
|
+
description: "a zero-based non-negative safe attempt ordinal",
|
|
194
|
+
}));
|
|
195
|
+
const AttemptLocatorSchema = effect_1.Schema.String.pipe(effect_1.Schema.filter((value) => (0, attempt_locator_ts_1.parseAttemptLocator)(value).valid, { identifier: "SampleAttemptLocator", description: "a canonical Attempt locator" }));
|
|
196
|
+
const JsonValueSchema = effect_1.Schema.suspend(() => effect_1.Schema.Union(effect_1.Schema.Null, effect_1.Schema.Boolean, effect_1.Schema.JsonNumber, effect_1.Schema.String, effect_1.Schema.Array(JsonValueSchema), effect_1.Schema.Record({ key: effect_1.Schema.String, value: JsonValueSchema })));
|
|
197
|
+
const RunContextWireSchema = plainStruct({
|
|
198
|
+
execution: plainStruct({
|
|
199
|
+
agentId: effect_1.Schema.String.pipe(effect_1.Schema.minLength(1)),
|
|
200
|
+
model: effect_1.Schema.NullOr(effect_1.Schema.String),
|
|
201
|
+
reasoningEffort: effect_1.Schema.NullOr(effect_1.Schema.String),
|
|
202
|
+
flags: effect_1.Schema.Record({ key: effect_1.Schema.String, value: JsonValueSchema }),
|
|
203
|
+
}),
|
|
204
|
+
labels: effect_1.Schema.Record({ key: effect_1.Schema.String, value: effect_1.Schema.String }),
|
|
205
|
+
});
|
|
206
|
+
const SelectionProblemSchema = plainStruct({
|
|
207
|
+
code: effect_1.Schema.Literal("incomplete-run", "record-core-invalid", "selection-run-missing", "selection-run-unreadable"),
|
|
208
|
+
runId: identifiers_ts_1.RunIdSchema,
|
|
209
|
+
});
|
|
210
|
+
const SelectionSchema = effect_1.Schema.Union(plainStruct({
|
|
211
|
+
policy: effect_1.Schema.Literal("explicit-runs"),
|
|
212
|
+
runIds: effect_1.Schema.Array(identifiers_ts_1.RunIdSchema),
|
|
213
|
+
selectedRunIds: effect_1.Schema.Array(identifiers_ts_1.RunIdSchema),
|
|
214
|
+
problems: effect_1.Schema.Array(SelectionProblemSchema),
|
|
215
|
+
}), plainStruct({
|
|
216
|
+
policy: effect_1.Schema.Literal("project-current"),
|
|
217
|
+
experimentIds: effect_1.Schema.Union(effect_1.Schema.Literal("all"), effect_1.Schema.Array(identifiers_ts_1.ExperimentIdSchema)),
|
|
218
|
+
selectedRunIds: effect_1.Schema.Array(identifiers_ts_1.RunIdSchema),
|
|
219
|
+
problems: effect_1.Schema.Array(SelectionProblemSchema),
|
|
220
|
+
}));
|
|
221
|
+
const RunSchema = plainStruct({
|
|
222
|
+
runId: identifiers_ts_1.RunIdSchema,
|
|
223
|
+
experimentId: identifiers_ts_1.ExperimentIdSchema,
|
|
224
|
+
context: effect_1.Schema.NullOr(RunContextWireSchema),
|
|
225
|
+
startedAt: identifiers_ts_1.UtcMillisSchema,
|
|
226
|
+
completedAt: identifiers_ts_1.UtcMillisSchema,
|
|
227
|
+
expectedSlots: effect_1.Schema.Array(identifiers_ts_1.SlotIdSchema),
|
|
228
|
+
});
|
|
229
|
+
const SlotReferenceFields = {
|
|
230
|
+
runId: identifiers_ts_1.RunIdSchema,
|
|
231
|
+
slotId: identifiers_ts_1.SlotIdSchema,
|
|
232
|
+
experimentId: identifiers_ts_1.ExperimentIdSchema,
|
|
233
|
+
evalId: identifiers_ts_1.EvalIdSchema,
|
|
234
|
+
attemptOrdinal: AttemptOrdinalSchema,
|
|
235
|
+
executionIdentityDigest: identifiers_ts_1.ExecutionIdentityDigestSchema,
|
|
236
|
+
};
|
|
237
|
+
const AttemptEvidenceSchema = plainStruct({
|
|
238
|
+
kind: effect_1.Schema.Literal("attempt"),
|
|
239
|
+
locator: AttemptLocatorSchema,
|
|
240
|
+
originRunId: identifiers_ts_1.RunIdSchema,
|
|
241
|
+
});
|
|
242
|
+
const IssueSchema = plainStruct({
|
|
243
|
+
code: effect_1.Schema.Literal("missing", "migration-required", "unsupported", "producer-incompatible", "input-invalid", "reduction-failed", "relation-unmatched"),
|
|
244
|
+
message: effect_1.Schema.String,
|
|
245
|
+
refs: effect_1.Schema.Array(plainStruct({
|
|
246
|
+
identity: plainStruct({ kind: effect_1.Schema.Literal("attempt"), locator: AttemptLocatorSchema }),
|
|
247
|
+
})),
|
|
248
|
+
});
|
|
249
|
+
const ActiveSlotSchema = effect_1.Schema.Union(plainStruct({
|
|
250
|
+
...SlotReferenceFields,
|
|
251
|
+
state: effect_1.Schema.Literal("included"),
|
|
252
|
+
action: effect_1.Schema.Literal("executed", "carried", "accepted"),
|
|
253
|
+
relation: effect_1.Schema.Literal("origin", "reference"),
|
|
254
|
+
attempt: AttemptEvidenceSchema,
|
|
255
|
+
}), plainStruct({
|
|
256
|
+
...SlotReferenceFields,
|
|
257
|
+
state: effect_1.Schema.Literal("not-recorded"),
|
|
258
|
+
action: effect_1.Schema.Literal("not-dispatched", "interrupted").pipe(effect_1.Schema.NullOr),
|
|
259
|
+
attempt: effect_1.Schema.Null,
|
|
260
|
+
}), plainStruct({
|
|
261
|
+
...SlotReferenceFields,
|
|
262
|
+
state: effect_1.Schema.Literal("core-invalid"),
|
|
263
|
+
action: effect_1.Schema.Literal("executed", "carried", "accepted", "not-dispatched", "interrupted").pipe(effect_1.Schema.NullOr),
|
|
264
|
+
attempt: effect_1.Schema.Null,
|
|
265
|
+
issues: effect_1.Schema.Array(IssueSchema),
|
|
266
|
+
}));
|
|
267
|
+
const SlotSchemaRaw = effect_1.Schema.suspend(() => effect_1.Schema.Union(ActiveSlotSchema, plainStruct({
|
|
268
|
+
...SlotReferenceFields,
|
|
269
|
+
state: effect_1.Schema.Literal("excluded"),
|
|
270
|
+
base: ActiveSlotSchema,
|
|
271
|
+
}), plainStruct({
|
|
272
|
+
...SlotReferenceFields,
|
|
273
|
+
state: effect_1.Schema.Literal("excluded"),
|
|
274
|
+
base: ActiveSlotSchema,
|
|
275
|
+
reason: effect_1.Schema.Literal("identity-mismatch"),
|
|
276
|
+
})));
|
|
277
|
+
const SlotSchema = SlotSchemaRaw;
|
|
278
|
+
const CoverageWireSchema = plainStruct({
|
|
279
|
+
frameTotal: effect_1.Schema.JsonNumber,
|
|
280
|
+
selected: effect_1.Schema.JsonNumber,
|
|
281
|
+
included: effect_1.Schema.JsonNumber,
|
|
282
|
+
notRecorded: effect_1.Schema.JsonNumber,
|
|
283
|
+
coreInvalid: effect_1.Schema.JsonNumber,
|
|
284
|
+
excluded: effect_1.Schema.JsonNumber,
|
|
285
|
+
});
|
|
286
|
+
const SampleSnapshotWireSchema = plainStruct({
|
|
287
|
+
version: effect_1.Schema.Literal(1),
|
|
288
|
+
identity: plainStruct({ kind: effect_1.Schema.Literal("analysis-sample"), id: effect_1.Schema.String }),
|
|
289
|
+
selection: SelectionSchema,
|
|
290
|
+
runs: effect_1.Schema.Array(RunSchema).pipe(effect_1.Schema.filter((runs) => runs.length <= MAX_SELECTED_RUNS, { identifier: "SampleSelectedRuns", description: "at most 4096 selected Runs" })),
|
|
291
|
+
slots: effect_1.Schema.Array(SlotSchema).pipe(effect_1.Schema.filter((slots) => slots.length <= MAX_SLOTS, { identifier: "SampleSlots", description: "at most 250000 Slots" })),
|
|
292
|
+
coverage: CoverageWireSchema,
|
|
293
|
+
});
|
|
294
|
+
function canonicalizeSnapshotWire(input) {
|
|
295
|
+
const selection = canonicalizeSelection(input.selection);
|
|
296
|
+
const runs = [];
|
|
297
|
+
for (let index = 0; index < input.runs.length; index += 1) {
|
|
298
|
+
const run = input.runs[index];
|
|
299
|
+
const context = run.context === null
|
|
300
|
+
? null
|
|
301
|
+
: (0, run_context_ts_1.canonicalizeRunContext)({ experimentId: run.experimentId, ...run.context });
|
|
302
|
+
if (context !== null && effect_1.Either.isLeft(context)) {
|
|
303
|
+
return effect_1.Either.left(codecError(["runs", String(index), "context"], "is not a valid closed Run context"));
|
|
304
|
+
}
|
|
305
|
+
runs.push(Object.freeze({
|
|
306
|
+
runId: run.runId,
|
|
307
|
+
experimentId: run.experimentId,
|
|
308
|
+
context: context === null ? null : closeRunContext(context.right),
|
|
309
|
+
startedAt: run.startedAt,
|
|
310
|
+
completedAt: run.completedAt,
|
|
311
|
+
expectedSlots: Object.freeze(uniqueSorted(run.expectedSlots)),
|
|
312
|
+
}));
|
|
313
|
+
}
|
|
314
|
+
let canonicalRuns;
|
|
315
|
+
try {
|
|
316
|
+
canonicalRuns = uniqueSortedBy(runs, (run) => run.runId);
|
|
317
|
+
}
|
|
318
|
+
catch {
|
|
319
|
+
return effect_1.Either.left(codecError(["runs"], "duplicates a Run identity"));
|
|
320
|
+
}
|
|
321
|
+
const identities = new Set();
|
|
322
|
+
const slots = [];
|
|
323
|
+
for (let index = 0; index < input.slots.length; index += 1) {
|
|
324
|
+
const slot = input.slots[index];
|
|
325
|
+
const key = slotKey(slot.runId, slot.slotId);
|
|
326
|
+
if (identities.has(key))
|
|
327
|
+
return effect_1.Either.left(codecError(["slots", String(index)], "duplicates a Run/Slot identity"));
|
|
328
|
+
identities.add(key);
|
|
329
|
+
const closed = closeDecodedSlot(slot, ["slots", String(index)]);
|
|
330
|
+
if (effect_1.Either.isLeft(closed))
|
|
331
|
+
return effect_1.Either.left(closed.left);
|
|
332
|
+
slots.push(closed.right);
|
|
333
|
+
}
|
|
334
|
+
return effect_1.Either.right(Object.freeze({
|
|
335
|
+
selection,
|
|
336
|
+
runs: canonicalRuns,
|
|
337
|
+
slots: Object.freeze(slots.sort(compareSlots)),
|
|
338
|
+
}));
|
|
339
|
+
}
|
|
340
|
+
function closeDecodedSlot(slot, path) {
|
|
341
|
+
if (slot.state === "excluded") {
|
|
342
|
+
const base = closeDecodedSlot(slot.base, [...path, "base"]);
|
|
343
|
+
if (effect_1.Either.isLeft(base))
|
|
344
|
+
return base;
|
|
345
|
+
if (base.right.state === "excluded") {
|
|
346
|
+
return effect_1.Either.left(codecError([...path, "base"], "must be an active Slot"));
|
|
347
|
+
}
|
|
348
|
+
if (base.right.runId !== slot.runId || base.right.slotId !== slot.slotId ||
|
|
349
|
+
base.right.experimentId !== slot.experimentId || base.right.evalId !== slot.evalId ||
|
|
350
|
+
base.right.attemptOrdinal !== slot.attemptOrdinal ||
|
|
351
|
+
base.right.executionIdentityDigest !== slot.executionIdentityDigest)
|
|
352
|
+
return effect_1.Either.left(codecError(path, "excluded base must be a matching active Slot"));
|
|
353
|
+
return effect_1.Either.right(Object.freeze({ ...slot, base: base.right }));
|
|
354
|
+
}
|
|
355
|
+
if (slot.state === "included") {
|
|
356
|
+
return effect_1.Either.right(Object.freeze({ ...slot, attempt: Object.freeze({ ...slot.attempt }) }));
|
|
357
|
+
}
|
|
358
|
+
if (slot.state === "not-recorded")
|
|
359
|
+
return effect_1.Either.right(Object.freeze({ ...slot }));
|
|
360
|
+
return effect_1.Either.right(Object.freeze({
|
|
361
|
+
...slot,
|
|
362
|
+
issues: Object.freeze(slot.issues.map((issue) => Object.freeze({
|
|
363
|
+
...issue,
|
|
364
|
+
refs: Object.freeze(issue.refs.map((ref) => Object.freeze({
|
|
365
|
+
identity: Object.freeze({ ...ref.identity }),
|
|
366
|
+
}))),
|
|
367
|
+
}))),
|
|
368
|
+
}));
|
|
369
|
+
}
|
|
370
|
+
function canonicalizeSelection(selection) {
|
|
371
|
+
const problems = normalizedSelectionProblems(selection.problems);
|
|
372
|
+
return selection.policy === "explicit-runs"
|
|
373
|
+
? Object.freeze({
|
|
374
|
+
policy: selection.policy,
|
|
375
|
+
runIds: uniqueSorted(selection.runIds),
|
|
376
|
+
selectedRunIds: uniqueSorted(selection.selectedRunIds),
|
|
377
|
+
problems,
|
|
378
|
+
})
|
|
379
|
+
: Object.freeze({
|
|
380
|
+
policy: selection.policy,
|
|
381
|
+
experimentIds: selection.experimentIds === "all" ? "all" : uniqueSorted(selection.experimentIds),
|
|
382
|
+
selectedRunIds: uniqueSorted(selection.selectedRunIds),
|
|
383
|
+
problems,
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
/** A Snapshot Slot is a derived occurrence of exactly one closed AnalysisRun. */
|
|
387
|
+
function validateSlotRunAlignment(runs, slots) {
|
|
388
|
+
const runsById = new Map(runs.map((run) => [run.runId, run]));
|
|
389
|
+
for (let index = 0; index < slots.length; index += 1) {
|
|
390
|
+
const slot = slots[index];
|
|
391
|
+
const run = runsById.get(slot.runId);
|
|
392
|
+
if (run === undefined)
|
|
393
|
+
return codecError(["slots", String(index), "runId"], "does not identify a selected AnalysisRun");
|
|
394
|
+
if (run.experimentId !== slot.experimentId)
|
|
395
|
+
return codecError(["slots", String(index), "experimentId"], "does not match the associated AnalysisRun");
|
|
396
|
+
if (!run.expectedSlots.includes(slot.slotId))
|
|
397
|
+
return codecError(["slots", String(index), "slotId"], "does not belong to the associated AnalysisRun");
|
|
398
|
+
}
|
|
399
|
+
return undefined;
|
|
400
|
+
}
|
|
401
|
+
function codecErrorFromSchema(error) {
|
|
402
|
+
const issue = effect_1.ParseResult.ArrayFormatter.formatErrorSync(error)[0];
|
|
403
|
+
if (issue === undefined)
|
|
404
|
+
return codecError([], "is not a valid Sample snapshot");
|
|
405
|
+
return codecError(issue.path.map(String), issue.message);
|
|
406
|
+
}
|
|
187
407
|
function expectedSlotsByRun(selection) {
|
|
188
408
|
const result = new Map();
|
|
189
409
|
for (const entry of selection.expectedSlots) {
|
|
@@ -212,13 +432,9 @@ function expectedSlotsForRun(ref, facts, fromSelection) {
|
|
|
212
432
|
}
|
|
213
433
|
function selectionSummary(request, selection) {
|
|
214
434
|
const selectedRunIds = uniqueSorted(selection.runRefs.map((ref) => ref.runId));
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
code: "incomplete-run",
|
|
219
|
-
runId: warning.runId,
|
|
220
|
-
})),
|
|
221
|
-
]);
|
|
435
|
+
// Unpublished Run directories are normal writer residue. Record keeps the
|
|
436
|
+
// warning for maintenance, but it is not a problem with the selected Sample.
|
|
437
|
+
const problems = normalizedSelectionProblems(selection.problems);
|
|
222
438
|
if (request.policy === "explicit-runs") {
|
|
223
439
|
return Object.freeze({
|
|
224
440
|
policy: "explicit-runs",
|
|
@@ -607,414 +823,6 @@ function issueJson(issue) {
|
|
|
607
823
|
}))),
|
|
608
824
|
});
|
|
609
825
|
}
|
|
610
|
-
function decodeSelection(value, path) {
|
|
611
|
-
if (!isPlainObject(value))
|
|
612
|
-
return effect_1.Either.left(codecError(path, "must be an object"));
|
|
613
|
-
const policy = valueAt(value, "policy");
|
|
614
|
-
if (policy === "explicit-runs") {
|
|
615
|
-
if (!isExactObject(value, ["policy", "runIds", "selectedRunIds", "problems"])) {
|
|
616
|
-
return effect_1.Either.left(codecError(path, "explicit-runs must contain exactly policy, runIds, selectedRunIds, and problems"));
|
|
617
|
-
}
|
|
618
|
-
const runIds = decodeArray(valueAt(value, "runIds"), [...path, "runIds"], decodeRunId);
|
|
619
|
-
const selectedRunIds = decodeArray(valueAt(value, "selectedRunIds"), [...path, "selectedRunIds"], decodeRunId);
|
|
620
|
-
const problems = decodeSelectionProblems(valueAt(value, "problems"), [...path, "problems"]);
|
|
621
|
-
if (effect_1.Either.isLeft(runIds))
|
|
622
|
-
return effect_1.Either.left(runIds.left);
|
|
623
|
-
if (effect_1.Either.isLeft(selectedRunIds))
|
|
624
|
-
return effect_1.Either.left(selectedRunIds.left);
|
|
625
|
-
if (effect_1.Either.isLeft(problems))
|
|
626
|
-
return effect_1.Either.left(problems.left);
|
|
627
|
-
return effect_1.Either.right(Object.freeze({
|
|
628
|
-
policy: "explicit-runs",
|
|
629
|
-
runIds: uniqueSorted(runIds.right),
|
|
630
|
-
selectedRunIds: uniqueSorted(selectedRunIds.right),
|
|
631
|
-
problems: normalizedSelectionProblems(problems.right),
|
|
632
|
-
}));
|
|
633
|
-
}
|
|
634
|
-
if (policy === "project-current") {
|
|
635
|
-
if (!isExactObject(value, ["policy", "experimentIds", "selectedRunIds", "problems"])) {
|
|
636
|
-
return effect_1.Either.left(codecError(path, "project-current must contain exactly policy, experimentIds, selectedRunIds, and problems"));
|
|
637
|
-
}
|
|
638
|
-
const experimentIdsValue = valueAt(value, "experimentIds");
|
|
639
|
-
let experimentIds;
|
|
640
|
-
if (experimentIdsValue === "all") {
|
|
641
|
-
experimentIds = "all";
|
|
642
|
-
}
|
|
643
|
-
else {
|
|
644
|
-
const decodedExperimentIds = decodeArray(experimentIdsValue, [...path, "experimentIds"], decodeExperimentId);
|
|
645
|
-
if (effect_1.Either.isLeft(decodedExperimentIds))
|
|
646
|
-
return effect_1.Either.left(decodedExperimentIds.left);
|
|
647
|
-
experimentIds = uniqueSorted(decodedExperimentIds.right);
|
|
648
|
-
}
|
|
649
|
-
const selectedRunIds = decodeArray(valueAt(value, "selectedRunIds"), [...path, "selectedRunIds"], decodeRunId);
|
|
650
|
-
const problems = decodeSelectionProblems(valueAt(value, "problems"), [...path, "problems"]);
|
|
651
|
-
if (effect_1.Either.isLeft(selectedRunIds))
|
|
652
|
-
return effect_1.Either.left(selectedRunIds.left);
|
|
653
|
-
if (effect_1.Either.isLeft(problems))
|
|
654
|
-
return effect_1.Either.left(problems.left);
|
|
655
|
-
return effect_1.Either.right(Object.freeze({
|
|
656
|
-
policy: "project-current",
|
|
657
|
-
experimentIds,
|
|
658
|
-
selectedRunIds: uniqueSorted(selectedRunIds.right),
|
|
659
|
-
problems: normalizedSelectionProblems(problems.right),
|
|
660
|
-
}));
|
|
661
|
-
}
|
|
662
|
-
return effect_1.Either.left(codecError([...path, "policy"], "must be explicit-runs or project-current"));
|
|
663
|
-
}
|
|
664
|
-
function decodeSelectionProblems(value, path) {
|
|
665
|
-
if (!Array.isArray(value))
|
|
666
|
-
return effect_1.Either.left(codecError(path, "must be an array"));
|
|
667
|
-
const problems = [];
|
|
668
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
669
|
-
const decoded = decodeSelectionProblem(value[index], [...path, String(index)]);
|
|
670
|
-
if (effect_1.Either.isLeft(decoded))
|
|
671
|
-
return effect_1.Either.left(decoded.left);
|
|
672
|
-
problems.push(decoded.right);
|
|
673
|
-
}
|
|
674
|
-
return effect_1.Either.right(Object.freeze(problems));
|
|
675
|
-
}
|
|
676
|
-
function decodeSelectionProblem(value, path) {
|
|
677
|
-
if (!isExactObject(value, ["code", "runId"]))
|
|
678
|
-
return effect_1.Either.left(codecError(path, "must contain exactly code and runId"));
|
|
679
|
-
const code = valueAt(value, "code");
|
|
680
|
-
if (code !== "incomplete-run" && code !== "record-core-invalid" && code !== "selection-run-missing" && code !== "selection-run-unreadable") {
|
|
681
|
-
return effect_1.Either.left(codecError([...path, "code"], "is not a known selection problem"));
|
|
682
|
-
}
|
|
683
|
-
const runId = decodeRunId(valueAt(value, "runId"), [...path, "runId"]);
|
|
684
|
-
return effect_1.Either.isLeft(runId) ? effect_1.Either.left(runId.left) : effect_1.Either.right(Object.freeze({ code, runId: runId.right }));
|
|
685
|
-
}
|
|
686
|
-
function decodeRuns(value, path) {
|
|
687
|
-
if (!Array.isArray(value))
|
|
688
|
-
return effect_1.Either.left(codecError(path, "must be an array"));
|
|
689
|
-
if (value.length > MAX_SELECTED_RUNS)
|
|
690
|
-
return effect_1.Either.left(codecError(path, "exceeds the selected-runs limit"));
|
|
691
|
-
const runs = [];
|
|
692
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
693
|
-
const decoded = decodeRun(value[index], [...path, String(index)]);
|
|
694
|
-
if (effect_1.Either.isLeft(decoded))
|
|
695
|
-
return effect_1.Either.left(decoded.left);
|
|
696
|
-
runs.push(decoded.right);
|
|
697
|
-
}
|
|
698
|
-
return effect_1.Either.right(Object.freeze(uniqueSortedBy(runs, (run) => run.runId)));
|
|
699
|
-
}
|
|
700
|
-
function decodeRun(value, path) {
|
|
701
|
-
if (!isExactObject(value, ["runId", "experimentId", "context", "startedAt", "completedAt", "expectedSlots"])) {
|
|
702
|
-
return effect_1.Either.left(codecError(path, "contains unsupported fields"));
|
|
703
|
-
}
|
|
704
|
-
const runId = decodeRunId(valueAt(value, "runId"), [...path, "runId"]);
|
|
705
|
-
const experimentId = decodeExperimentId(valueAt(value, "experimentId"), [...path, "experimentId"]);
|
|
706
|
-
const startedAt = decodeUtcMillis(valueAt(value, "startedAt"), [...path, "startedAt"]);
|
|
707
|
-
const completedAt = decodeUtcMillis(valueAt(value, "completedAt"), [...path, "completedAt"]);
|
|
708
|
-
const slots = decodeArray(valueAt(value, "expectedSlots"), [...path, "expectedSlots"], decodeSlotId);
|
|
709
|
-
if (effect_1.Either.isLeft(runId))
|
|
710
|
-
return effect_1.Either.left(runId.left);
|
|
711
|
-
if (effect_1.Either.isLeft(experimentId))
|
|
712
|
-
return effect_1.Either.left(experimentId.left);
|
|
713
|
-
const context = decodeRunContext(valueAt(value, "context"), experimentId.right, [...path, "context"]);
|
|
714
|
-
if (effect_1.Either.isLeft(context))
|
|
715
|
-
return effect_1.Either.left(context.left);
|
|
716
|
-
if (effect_1.Either.isLeft(startedAt))
|
|
717
|
-
return effect_1.Either.left(startedAt.left);
|
|
718
|
-
if (effect_1.Either.isLeft(completedAt))
|
|
719
|
-
return effect_1.Either.left(completedAt.left);
|
|
720
|
-
if (effect_1.Either.isLeft(slots))
|
|
721
|
-
return effect_1.Either.left(slots.left);
|
|
722
|
-
return effect_1.Either.right(Object.freeze({
|
|
723
|
-
runId: runId.right,
|
|
724
|
-
experimentId: experimentId.right,
|
|
725
|
-
context: context.right,
|
|
726
|
-
startedAt: startedAt.right,
|
|
727
|
-
completedAt: completedAt.right,
|
|
728
|
-
expectedSlots: Object.freeze(uniqueSorted(slots.right)),
|
|
729
|
-
}));
|
|
730
|
-
}
|
|
731
|
-
function decodeRunContext(value, experimentId, path) {
|
|
732
|
-
if (value === null)
|
|
733
|
-
return effect_1.Either.right(null);
|
|
734
|
-
if (!isExactObject(value, ["execution", "labels"])) {
|
|
735
|
-
return effect_1.Either.left(codecError(path, "must contain exactly execution and labels"));
|
|
736
|
-
}
|
|
737
|
-
const decoded = (0, run_context_ts_1.canonicalizeRunContext)({
|
|
738
|
-
experimentId,
|
|
739
|
-
execution: valueAt(value, "execution"),
|
|
740
|
-
labels: valueAt(value, "labels"),
|
|
741
|
-
});
|
|
742
|
-
return effect_1.Either.isLeft(decoded)
|
|
743
|
-
? effect_1.Either.left(codecError(path, "is not a valid closed Run context"))
|
|
744
|
-
: effect_1.Either.right(closeRunContext(decoded.right));
|
|
745
|
-
}
|
|
746
|
-
function decodeSlots(value, path) {
|
|
747
|
-
if (!Array.isArray(value))
|
|
748
|
-
return effect_1.Either.left(codecError(path, "must be an array"));
|
|
749
|
-
if (value.length > MAX_SLOTS)
|
|
750
|
-
return effect_1.Either.left(codecError(path, "exceeds the Slot limit"));
|
|
751
|
-
const slots = [];
|
|
752
|
-
const identities = new Set();
|
|
753
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
754
|
-
const decoded = decodeSlot(value[index], [...path, String(index)], false);
|
|
755
|
-
if (effect_1.Either.isLeft(decoded))
|
|
756
|
-
return effect_1.Either.left(decoded.left);
|
|
757
|
-
const key = slotKey(decoded.right.runId, decoded.right.slotId);
|
|
758
|
-
if (identities.has(key))
|
|
759
|
-
return effect_1.Either.left(codecError([...path, String(index)], "duplicates a Run/Slot identity"));
|
|
760
|
-
identities.add(key);
|
|
761
|
-
slots.push(decoded.right);
|
|
762
|
-
}
|
|
763
|
-
return effect_1.Either.right(Object.freeze(slots.sort(compareSlots)));
|
|
764
|
-
}
|
|
765
|
-
/** A Snapshot Slot is a derived occurrence of exactly one closed AnalysisRun. */
|
|
766
|
-
function validateSlotRunAlignment(runs, slots) {
|
|
767
|
-
const runsById = new Map(runs.map((run) => [run.runId, run]));
|
|
768
|
-
for (let index = 0; index < slots.length; index += 1) {
|
|
769
|
-
const slot = slots[index];
|
|
770
|
-
const run = runsById.get(slot.runId);
|
|
771
|
-
if (run === undefined) {
|
|
772
|
-
return codecError(["slots", String(index), "runId"], "does not identify a selected AnalysisRun");
|
|
773
|
-
}
|
|
774
|
-
if (run.experimentId !== slot.experimentId) {
|
|
775
|
-
return codecError(["slots", String(index), "experimentId"], "does not match the associated AnalysisRun");
|
|
776
|
-
}
|
|
777
|
-
if (!run.expectedSlots.includes(slot.slotId)) {
|
|
778
|
-
return codecError(["slots", String(index), "slotId"], "does not belong to the associated AnalysisRun");
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
return undefined;
|
|
782
|
-
}
|
|
783
|
-
function decodeSlot(value, path, nested) {
|
|
784
|
-
if (!isPlainObject(value))
|
|
785
|
-
return effect_1.Either.left(codecError(path, "must be an object"));
|
|
786
|
-
const state = valueAt(value, "state");
|
|
787
|
-
if (state === "excluded") {
|
|
788
|
-
const hasReason = Object.prototype.hasOwnProperty.call(value, "reason");
|
|
789
|
-
const expectedKeys = hasReason
|
|
790
|
-
? ["runId", "slotId", "experimentId", "evalId", "attemptOrdinal", "executionIdentityDigest", "state", "base", "reason"]
|
|
791
|
-
: ["runId", "slotId", "experimentId", "evalId", "attemptOrdinal", "executionIdentityDigest", "state", "base"];
|
|
792
|
-
if (nested || !isExactObject(value, expectedKeys)) {
|
|
793
|
-
return effect_1.Either.left(codecError(path, "excluded Slots must contain exactly runId, slotId, state, base, and optional reason"));
|
|
794
|
-
}
|
|
795
|
-
const runId = decodeRunId(valueAt(value, "runId"), [...path, "runId"]);
|
|
796
|
-
const slotId = decodeSlotId(valueAt(value, "slotId"), [...path, "slotId"]);
|
|
797
|
-
const experimentId = decodeExperimentId(valueAt(value, "experimentId"), [...path, "experimentId"]);
|
|
798
|
-
const evalId = decodeEvalId(valueAt(value, "evalId"), [...path, "evalId"]);
|
|
799
|
-
const attemptOrdinal = decodeAttemptOrdinal(valueAt(value, "attemptOrdinal"), [...path, "attemptOrdinal"]);
|
|
800
|
-
const executionIdentityDigest = decodeExecutionIdentityDigest(valueAt(value, "executionIdentityDigest"), [...path, "executionIdentityDigest"]);
|
|
801
|
-
const base = decodeSlot(valueAt(value, "base"), [...path, "base"], true);
|
|
802
|
-
if (effect_1.Either.isLeft(runId))
|
|
803
|
-
return effect_1.Either.left(runId.left);
|
|
804
|
-
if (effect_1.Either.isLeft(slotId))
|
|
805
|
-
return effect_1.Either.left(slotId.left);
|
|
806
|
-
if (effect_1.Either.isLeft(experimentId))
|
|
807
|
-
return effect_1.Either.left(experimentId.left);
|
|
808
|
-
if (effect_1.Either.isLeft(evalId))
|
|
809
|
-
return effect_1.Either.left(evalId.left);
|
|
810
|
-
if (effect_1.Either.isLeft(attemptOrdinal))
|
|
811
|
-
return effect_1.Either.left(attemptOrdinal.left);
|
|
812
|
-
if (effect_1.Either.isLeft(executionIdentityDigest))
|
|
813
|
-
return effect_1.Either.left(executionIdentityDigest.left);
|
|
814
|
-
if (effect_1.Either.isLeft(base))
|
|
815
|
-
return effect_1.Either.left(base.left);
|
|
816
|
-
if (base.right.state === "excluded"
|
|
817
|
-
|| base.right.runId !== runId.right
|
|
818
|
-
|| base.right.slotId !== slotId.right
|
|
819
|
-
|| base.right.experimentId !== experimentId.right
|
|
820
|
-
|| base.right.evalId !== evalId.right
|
|
821
|
-
|| base.right.attemptOrdinal !== attemptOrdinal.right
|
|
822
|
-
|| base.right.executionIdentityDigest !== executionIdentityDigest.right) {
|
|
823
|
-
return effect_1.Either.left(codecError(path, "excluded base must be a matching active Slot"));
|
|
824
|
-
}
|
|
825
|
-
if (hasReason && valueAt(value, "reason") !== "identity-mismatch") {
|
|
826
|
-
return effect_1.Either.left(codecError([...path, "reason"], "must be identity-mismatch"));
|
|
827
|
-
}
|
|
828
|
-
return effect_1.Either.right(Object.freeze({
|
|
829
|
-
runId: runId.right,
|
|
830
|
-
slotId: slotId.right,
|
|
831
|
-
experimentId: experimentId.right,
|
|
832
|
-
evalId: evalId.right,
|
|
833
|
-
attemptOrdinal: attemptOrdinal.right,
|
|
834
|
-
executionIdentityDigest: executionIdentityDigest.right,
|
|
835
|
-
state,
|
|
836
|
-
base: base.right,
|
|
837
|
-
...(hasReason ? { reason: "identity-mismatch" } : {}),
|
|
838
|
-
}));
|
|
839
|
-
}
|
|
840
|
-
const runId = decodeRunId(valueAt(value, "runId"), [...path, "runId"]);
|
|
841
|
-
const slotId = decodeSlotId(valueAt(value, "slotId"), [...path, "slotId"]);
|
|
842
|
-
const experimentId = decodeExperimentId(valueAt(value, "experimentId"), [...path, "experimentId"]);
|
|
843
|
-
const evalId = decodeEvalId(valueAt(value, "evalId"), [...path, "evalId"]);
|
|
844
|
-
const attemptOrdinal = decodeAttemptOrdinal(valueAt(value, "attemptOrdinal"), [...path, "attemptOrdinal"]);
|
|
845
|
-
const executionIdentityDigest = decodeExecutionIdentityDigest(valueAt(value, "executionIdentityDigest"), [...path, "executionIdentityDigest"]);
|
|
846
|
-
if (effect_1.Either.isLeft(runId))
|
|
847
|
-
return effect_1.Either.left(runId.left);
|
|
848
|
-
if (effect_1.Either.isLeft(slotId))
|
|
849
|
-
return effect_1.Either.left(slotId.left);
|
|
850
|
-
if (effect_1.Either.isLeft(experimentId))
|
|
851
|
-
return effect_1.Either.left(experimentId.left);
|
|
852
|
-
if (effect_1.Either.isLeft(evalId))
|
|
853
|
-
return effect_1.Either.left(evalId.left);
|
|
854
|
-
if (effect_1.Either.isLeft(attemptOrdinal))
|
|
855
|
-
return effect_1.Either.left(attemptOrdinal.left);
|
|
856
|
-
if (effect_1.Either.isLeft(executionIdentityDigest))
|
|
857
|
-
return effect_1.Either.left(executionIdentityDigest.left);
|
|
858
|
-
if (state === "included") {
|
|
859
|
-
if (!isExactObject(value, ["runId", "slotId", "experimentId", "evalId", "attemptOrdinal", "executionIdentityDigest", "state", "action", "relation", "attempt"])) {
|
|
860
|
-
return effect_1.Either.left(codecError(path, "included Slots contain unsupported fields"));
|
|
861
|
-
}
|
|
862
|
-
const action = valueAt(value, "action");
|
|
863
|
-
const relation = valueAt(value, "relation");
|
|
864
|
-
const attempt = decodeAttemptIdentity(valueAt(value, "attempt"), [...path, "attempt"]);
|
|
865
|
-
if ((action !== "executed" && action !== "carried" && action !== "accepted") || (relation !== "origin" && relation !== "reference")) {
|
|
866
|
-
return effect_1.Either.left(codecError(path, "included Slot has an invalid Member action or relation"));
|
|
867
|
-
}
|
|
868
|
-
if (effect_1.Either.isLeft(attempt))
|
|
869
|
-
return effect_1.Either.left(attempt.left);
|
|
870
|
-
return effect_1.Either.right(Object.freeze({
|
|
871
|
-
runId: runId.right,
|
|
872
|
-
slotId: slotId.right,
|
|
873
|
-
experimentId: experimentId.right,
|
|
874
|
-
evalId: evalId.right,
|
|
875
|
-
attemptOrdinal: attemptOrdinal.right,
|
|
876
|
-
executionIdentityDigest: executionIdentityDigest.right,
|
|
877
|
-
state,
|
|
878
|
-
action,
|
|
879
|
-
relation,
|
|
880
|
-
attempt: attempt.right,
|
|
881
|
-
}));
|
|
882
|
-
}
|
|
883
|
-
if (state === "not-recorded") {
|
|
884
|
-
if (!isExactObject(value, ["runId", "slotId", "experimentId", "evalId", "attemptOrdinal", "executionIdentityDigest", "state", "action", "attempt"]) || valueAt(value, "attempt") !== null) {
|
|
885
|
-
return effect_1.Either.left(codecError(path, "not-recorded Slots must retain a null Attempt"));
|
|
886
|
-
}
|
|
887
|
-
const action = valueAt(value, "action");
|
|
888
|
-
if (action !== null && action !== "not-dispatched" && action !== "interrupted") {
|
|
889
|
-
return effect_1.Either.left(codecError([...path, "action"], "is not a null Member action"));
|
|
890
|
-
}
|
|
891
|
-
return effect_1.Either.right(Object.freeze({
|
|
892
|
-
runId: runId.right,
|
|
893
|
-
slotId: slotId.right,
|
|
894
|
-
experimentId: experimentId.right,
|
|
895
|
-
evalId: evalId.right,
|
|
896
|
-
attemptOrdinal: attemptOrdinal.right,
|
|
897
|
-
executionIdentityDigest: executionIdentityDigest.right,
|
|
898
|
-
state,
|
|
899
|
-
action,
|
|
900
|
-
attempt: null,
|
|
901
|
-
}));
|
|
902
|
-
}
|
|
903
|
-
if (state === "core-invalid") {
|
|
904
|
-
if (!isExactObject(value, ["runId", "slotId", "experimentId", "evalId", "attemptOrdinal", "executionIdentityDigest", "state", "action", "attempt", "issues"]) || valueAt(value, "attempt") !== null) {
|
|
905
|
-
return effect_1.Either.left(codecError(path, "core-invalid Slots must contain null Attempt and issues"));
|
|
906
|
-
}
|
|
907
|
-
const action = valueAt(value, "action");
|
|
908
|
-
if (action !== null && action !== "executed" && action !== "carried" && action !== "accepted" && action !== "not-dispatched" && action !== "interrupted") {
|
|
909
|
-
return effect_1.Either.left(codecError([...path, "action"], "is not a Member action"));
|
|
910
|
-
}
|
|
911
|
-
const issues = decodeIssues(valueAt(value, "issues"), [...path, "issues"]);
|
|
912
|
-
if (effect_1.Either.isLeft(issues))
|
|
913
|
-
return effect_1.Either.left(issues.left);
|
|
914
|
-
return effect_1.Either.right(Object.freeze({
|
|
915
|
-
runId: runId.right,
|
|
916
|
-
slotId: slotId.right,
|
|
917
|
-
experimentId: experimentId.right,
|
|
918
|
-
evalId: evalId.right,
|
|
919
|
-
attemptOrdinal: attemptOrdinal.right,
|
|
920
|
-
executionIdentityDigest: executionIdentityDigest.right,
|
|
921
|
-
state,
|
|
922
|
-
action,
|
|
923
|
-
attempt: null,
|
|
924
|
-
issues: issues.right,
|
|
925
|
-
}));
|
|
926
|
-
}
|
|
927
|
-
return effect_1.Either.left(codecError([...path, "state"], "must be included, not-recorded, core-invalid, or excluded"));
|
|
928
|
-
}
|
|
929
|
-
function decodeAttemptIdentity(value, path) {
|
|
930
|
-
if (!isExactObject(value, ["kind", "locator", "originRunId"]) || valueAt(value, "kind") !== "attempt") {
|
|
931
|
-
return effect_1.Either.left(codecError(path, "must contain an Attempt locator identity"));
|
|
932
|
-
}
|
|
933
|
-
const locator = valueAt(value, "locator");
|
|
934
|
-
const originRunId = decodeRunId(valueAt(value, "originRunId"), [...path, "originRunId"]);
|
|
935
|
-
if (typeof locator !== "string" || !(0, attempt_locator_ts_1.parseAttemptLocator)(locator).valid) {
|
|
936
|
-
return effect_1.Either.left(codecError([...path, "locator"], "is not a canonical Attempt locator"));
|
|
937
|
-
}
|
|
938
|
-
return effect_1.Either.isLeft(originRunId)
|
|
939
|
-
? effect_1.Either.left(originRunId.left)
|
|
940
|
-
: effect_1.Either.right(Object.freeze({ kind: "attempt", locator: locator, originRunId: originRunId.right }));
|
|
941
|
-
}
|
|
942
|
-
function decodeIssues(value, path) {
|
|
943
|
-
if (!Array.isArray(value))
|
|
944
|
-
return effect_1.Either.left(codecError(path, "must be an array"));
|
|
945
|
-
const issues = [];
|
|
946
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
947
|
-
const entry = value[index];
|
|
948
|
-
if (!isExactObject(entry, ["code", "message", "refs"]))
|
|
949
|
-
return effect_1.Either.left(codecError([...path, String(index)], "has unsupported fields"));
|
|
950
|
-
const code = valueAt(entry, "code");
|
|
951
|
-
const message = valueAt(entry, "message");
|
|
952
|
-
const refs = valueAt(entry, "refs");
|
|
953
|
-
if ((code !== "missing" && code !== "unsupported" && code !== "producer-incompatible" && code !== "input-invalid" && code !== "reduction-failed" && code !== "relation-unmatched") || typeof message !== "string" || !Array.isArray(refs)) {
|
|
954
|
-
return effect_1.Either.left(codecError([...path, String(index)], "is not a closed Analysis issue"));
|
|
955
|
-
}
|
|
956
|
-
const decodedRefs = [];
|
|
957
|
-
for (let refIndex = 0; refIndex < refs.length; refIndex += 1) {
|
|
958
|
-
const ref = refs[refIndex];
|
|
959
|
-
if (!isExactObject(ref, ["identity"]) || !isExactObject(valueAt(ref, "identity"), ["kind", "locator"])) {
|
|
960
|
-
return effect_1.Either.left(codecError([...path, String(index), "refs", String(refIndex)], "is not a closed evidence reference"));
|
|
961
|
-
}
|
|
962
|
-
const identity = valueAt(ref, "identity");
|
|
963
|
-
if (!isExactObject(identity, ["kind", "locator"])) {
|
|
964
|
-
return effect_1.Either.left(codecError([...path, String(index), "refs", String(refIndex)], "is not a closed evidence reference"));
|
|
965
|
-
}
|
|
966
|
-
const locator = valueAt(identity, "locator");
|
|
967
|
-
if (valueAt(identity, "kind") !== "attempt" || typeof locator !== "string" || !(0, attempt_locator_ts_1.parseAttemptLocator)(locator).valid) {
|
|
968
|
-
return effect_1.Either.left(codecError([...path, String(index), "refs", String(refIndex)], "has an invalid evidence locator"));
|
|
969
|
-
}
|
|
970
|
-
decodedRefs.push(Object.freeze({ identity: Object.freeze({ kind: "attempt", locator: locator }) }));
|
|
971
|
-
}
|
|
972
|
-
issues.push(Object.freeze({ code, message, refs: Object.freeze(decodedRefs) }));
|
|
973
|
-
}
|
|
974
|
-
return effect_1.Either.right(Object.freeze(issues));
|
|
975
|
-
}
|
|
976
|
-
function decodeArray(value, path, decode) {
|
|
977
|
-
if (!Array.isArray(value))
|
|
978
|
-
return effect_1.Either.left(codecError(path, "must be an array"));
|
|
979
|
-
const values = [];
|
|
980
|
-
for (let index = 0; index < value.length; index += 1) {
|
|
981
|
-
const decoded = decode(value[index], [...path, String(index)]);
|
|
982
|
-
if (effect_1.Either.isLeft(decoded))
|
|
983
|
-
return effect_1.Either.left(decoded.left);
|
|
984
|
-
values.push(decoded.right);
|
|
985
|
-
}
|
|
986
|
-
return effect_1.Either.right(Object.freeze(values));
|
|
987
|
-
}
|
|
988
|
-
function decodeRunId(value, path) {
|
|
989
|
-
return decodeBrand(identifiers_ts_1.RunIdSchema, value, path, "a RunId");
|
|
990
|
-
}
|
|
991
|
-
function decodeSlotId(value, path) {
|
|
992
|
-
return decodeBrand(identifiers_ts_1.SlotIdSchema, value, path, "a SlotId");
|
|
993
|
-
}
|
|
994
|
-
function decodeEvalId(value, path) {
|
|
995
|
-
return decodeBrand(identifiers_ts_1.EvalIdSchema, value, path, "an EvalId");
|
|
996
|
-
}
|
|
997
|
-
function decodeAttemptOrdinal(value, path) {
|
|
998
|
-
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0
|
|
999
|
-
? effect_1.Either.right(value)
|
|
1000
|
-
: effect_1.Either.left(codecError(path, "must be a zero-based non-negative safe attempt ordinal"));
|
|
1001
|
-
}
|
|
1002
|
-
function decodeExecutionIdentityDigest(value, path) {
|
|
1003
|
-
return decodeBrand(identifiers_ts_1.ExecutionIdentityDigestSchema, value, path, "an execution identity digest");
|
|
1004
|
-
}
|
|
1005
|
-
function decodeExperimentId(value, path) {
|
|
1006
|
-
return decodeBrand(identifiers_ts_1.ExperimentIdSchema, value, path, "an ExperimentId");
|
|
1007
|
-
}
|
|
1008
|
-
function decodeUtcMillis(value, path) {
|
|
1009
|
-
return decodeBrand(identifiers_ts_1.UtcMillisSchema, value, path, "a UTC millisecond value");
|
|
1010
|
-
}
|
|
1011
|
-
function decodeBrand(schema, value, path, label) {
|
|
1012
|
-
const decoded = effect_1.Schema.decodeUnknownEither(schema)(value);
|
|
1013
|
-
return effect_1.Either.isLeft(decoded) ? effect_1.Either.left(codecError(path, `must be ${label}`)) : effect_1.Either.right(decoded.right);
|
|
1014
|
-
}
|
|
1015
|
-
function uniqueSorted(values) {
|
|
1016
|
-
return Object.freeze([...new Set(values)].sort(identifiers_ts_2.compareCanonicalIdentity));
|
|
1017
|
-
}
|
|
1018
826
|
function uniqueSortedBy(values, key) {
|
|
1019
827
|
const byKey = new Map();
|
|
1020
828
|
for (const value of values) {
|
|
@@ -1027,19 +835,16 @@ function uniqueSortedBy(values, key) {
|
|
|
1027
835
|
.sort(([left], [right]) => (0, identifiers_ts_2.compareCanonicalIdentity)(left, right))
|
|
1028
836
|
.map(([, value]) => value));
|
|
1029
837
|
}
|
|
1030
|
-
function
|
|
1031
|
-
return
|
|
1032
|
-
&& valueAt(value, "kind") === expected.kind
|
|
1033
|
-
&& valueAt(value, "id") === expected.id;
|
|
838
|
+
function uniqueSorted(values) {
|
|
839
|
+
return Object.freeze([...new Set(values)].sort(identifiers_ts_2.compareCanonicalIdentity));
|
|
1034
840
|
}
|
|
1035
841
|
function sameCoverage(value, expected) {
|
|
1036
|
-
return
|
|
1037
|
-
&&
|
|
1038
|
-
&&
|
|
1039
|
-
&&
|
|
1040
|
-
&&
|
|
1041
|
-
&&
|
|
1042
|
-
&& valueAt(value, "excluded") === expected.excluded;
|
|
842
|
+
return value.frameTotal === expected.frameTotal
|
|
843
|
+
&& value.selected === expected.selected
|
|
844
|
+
&& value.included === expected.included
|
|
845
|
+
&& value.notRecorded === expected.notRecorded
|
|
846
|
+
&& value.coreInvalid === expected.coreInvalid
|
|
847
|
+
&& value.excluded === expected.excluded;
|
|
1043
848
|
}
|
|
1044
849
|
function codecException(error) {
|
|
1045
850
|
const exception = new Error(error.reason);
|
|
@@ -1056,19 +861,4 @@ function canonicalIdentity(value) {
|
|
|
1056
861
|
throw new Error("Sample identity input must be JSON-serializable");
|
|
1057
862
|
return `sample-v1:${encoded}`;
|
|
1058
863
|
}
|
|
1059
|
-
function isPlainObject(value) {
|
|
1060
|
-
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
1061
|
-
return false;
|
|
1062
|
-
const prototype = Object.getPrototypeOf(value);
|
|
1063
|
-
return prototype === Object.prototype || prototype === null;
|
|
1064
|
-
}
|
|
1065
|
-
function isExactObject(value, keys) {
|
|
1066
|
-
if (!isPlainObject(value))
|
|
1067
|
-
return false;
|
|
1068
|
-
const actual = Reflect.ownKeys(value);
|
|
1069
|
-
return actual.length === keys.length && actual.every((key) => typeof key === "string" && keys.includes(key));
|
|
1070
|
-
}
|
|
1071
|
-
function valueAt(value, key) {
|
|
1072
|
-
return Reflect.get(value, key);
|
|
1073
|
-
}
|
|
1074
864
|
//# sourceMappingURL=analysis.cjs.map
|