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/cli.cjs
CHANGED
|
@@ -38,8 +38,8 @@ const project_current_ts_1 = require("./runner/project-current.cjs");
|
|
|
38
38
|
const index_ts_2 = require("./record/index.cjs");
|
|
39
39
|
const identifiers_ts_1 = require("./record/codec/identifiers.cjs");
|
|
40
40
|
const attempt_overview_ts_1 = require("./report/built-in/attempt-overview.cjs");
|
|
41
|
-
const overview_ts_1 = require("./report/built-in/overview.cjs");
|
|
42
41
|
const run_membership_overview_ts_1 = require("./report/built-in/run-membership-overview.cjs");
|
|
42
|
+
const standard_tsx_1 = require("./report/built-in/standard.cjs");
|
|
43
43
|
const execution_ts_1 = require("./report/built-in/execution.cjs");
|
|
44
44
|
const source_ts_1 = require("./report/built-in/source.cjs");
|
|
45
45
|
const model_ts_1 = require("./report/execution/model.cjs");
|
|
@@ -59,7 +59,7 @@ const link_ts_1 = require("./sandbox/link.cjs");
|
|
|
59
59
|
const plan_ts_1 = require("./sandbox/plan.cjs");
|
|
60
60
|
const experiment_cleanup_registry_ts_1 = require("./runner/experiment-cleanup-registry.cjs");
|
|
61
61
|
const lock_ts_1 = require("./runner/lock.cjs");
|
|
62
|
-
const
|
|
62
|
+
const shared_state_lease_ts_1 = require("./runner/shared-state-lease.cjs");
|
|
63
63
|
const cleanup_timeout_ts_1 = require("./runner/cleanup-timeout.cjs");
|
|
64
64
|
const report_view_cache_ts_1 = require("./view/report-view-cache.cjs");
|
|
65
65
|
const timeout_ts_1 = require("./runner/timeout.cjs");
|
|
@@ -110,6 +110,9 @@ function renderCliFailure(failure) {
|
|
|
110
110
|
return `${(0, link_ts_1.formatSandboxLayerLinkError)(failure.cause)}\n`;
|
|
111
111
|
if (failure.cause instanceof plan_ts_1.SandboxPhysicalPlanningError)
|
|
112
112
|
return `${(0, plan_ts_1.formatSandboxPhysicalPlanningError)(failure.cause)}\n`;
|
|
113
|
+
const assertionsMessage = runnerAssertionsMessage(failure.cause);
|
|
114
|
+
if (assertionsMessage !== undefined)
|
|
115
|
+
return `error: ${assertionsMessage}\n`;
|
|
113
116
|
if (isReportCliOperation(failure.operation)) {
|
|
114
117
|
const code = failureCode(failure.cause);
|
|
115
118
|
if (code !== undefined) {
|
|
@@ -146,6 +149,16 @@ function failureCode(value) {
|
|
|
146
149
|
const code = Reflect.get(value, "code");
|
|
147
150
|
return typeof code === "string" ? code : undefined;
|
|
148
151
|
}
|
|
152
|
+
function runnerAssertionsMessage(value) {
|
|
153
|
+
if (failureCode(value) !== "runner-record-assertions-invalid" || typeof value !== "object" || value === null) {
|
|
154
|
+
return undefined;
|
|
155
|
+
}
|
|
156
|
+
const issue = Reflect.get(value, "issue");
|
|
157
|
+
if (typeof issue !== "object" || issue === null)
|
|
158
|
+
return undefined;
|
|
159
|
+
const message = Reflect.get(issue, "message");
|
|
160
|
+
return typeof message === "string" && message.length > 0 ? message : undefined;
|
|
161
|
+
}
|
|
149
162
|
// 表驱动的 flag 定义(node:util parseArgs)。--no-x 显式声明,不依赖 Node 20.14+
|
|
150
163
|
// 才支持的 allowNegative,也避免每个 boolean flag 都隐式获得未设计的负向别名。
|
|
151
164
|
// 未知 flag 由 strict 模式报清晰错误,不会静默吞掉后面的位置参数。
|
|
@@ -219,7 +232,7 @@ const FLAG_OPTIONS = {
|
|
|
219
232
|
record: { type: "string" },
|
|
220
233
|
/** `show` / `view` 可重复传入 `--run`;每次按完整 RunId 增加一个显式 Run,重复 identity 去重。 */
|
|
221
234
|
run: { type: "string", multiple: true },
|
|
222
|
-
/** `show` / `view` 命令专用:内建 `
|
|
235
|
+
/** `show` / `view` 命令专用:内建 `standard` 或受信任的 Report module 路径。 */
|
|
223
236
|
report: { type: "string" },
|
|
224
237
|
/** `show` / `view` 命令专用:内建 Theme 或受信任的闭合 Theme module 路径。 */
|
|
225
238
|
theme: { type: "string" },
|
|
@@ -227,6 +240,14 @@ const FLAG_OPTIONS = {
|
|
|
227
240
|
page: { type: "string" },
|
|
228
241
|
/** `exp` 命令专用:补齐被强杀打断的实验级 teardown——只对选中的实验各执行一次 teardown(新进程语义),不派发 attempt、不跑 setup;没有遗留登记也照常执行。与 eval 前缀位置参数组合是用法错误。 */
|
|
229
242
|
teardown: { type: "boolean" },
|
|
243
|
+
/** `exp --teardown` 专用:显式恢复一个永不自动接管的 sharedState lease;必须同时提供 --owner-token、--confirm-owner-terminated 和 --confirm-remote-quiesced。 */
|
|
244
|
+
"recover-shared-state": { type: "string" },
|
|
245
|
+
/** `--recover-shared-state` 专用:要恢复的不可变 owner token;错误或过期 token 不会修改 lease。 */
|
|
246
|
+
"owner-token": { type: "string" },
|
|
247
|
+
/** `--recover-shared-state` 专用:确认原 owner 已终止。 */
|
|
248
|
+
"confirm-owner-terminated": { type: "boolean" },
|
|
249
|
+
/** `--recover-shared-state` 专用:确认远端外部状态已静止。 */
|
|
250
|
+
"confirm-remote-quiesced": { type: "boolean" },
|
|
230
251
|
/** 只打印本次会匹配到的 eval × 运行配置,不实际执行(人读文本或 `--json` 单文档,见「机器怎么读:--json」)。 */
|
|
231
252
|
dry: { type: "boolean" },
|
|
232
253
|
/** `sandbox prune` 专用:除 orphan 外也销毁 unverified 实例;`exp` 明确拒绝此 flag,重跑失败项或全部项请用 `--rerun` / `--rerun all`。 */
|
|
@@ -240,7 +261,7 @@ const FLAG_OPTIONS = {
|
|
|
240
261
|
/** `view` 命令专用:启动后自动打开浏览器(默认行为)。 */
|
|
241
262
|
open: { type: "boolean" },
|
|
242
263
|
"no-open": { type: "boolean" },
|
|
243
|
-
/** `clean` / `migrate` 专用:确认不可逆 maintenance
|
|
264
|
+
/** `clean` / `migrate` 专用:确认不可逆 maintenance 动作或在 clean Git restore point 下执行 migration。 */
|
|
244
265
|
yes: { type: "boolean" },
|
|
245
266
|
/** 打印用法说明并退出。 */
|
|
246
267
|
help: { type: "boolean", short: "h" },
|
|
@@ -430,6 +451,10 @@ function parseArgs(argv) {
|
|
|
430
451
|
theme: values.theme,
|
|
431
452
|
orphans: values.orphans === true,
|
|
432
453
|
teardown: values.teardown === true,
|
|
454
|
+
recoverSharedState: values["recover-shared-state"],
|
|
455
|
+
ownerToken: values["owner-token"],
|
|
456
|
+
confirmOwnerTerminated: values["confirm-owner-terminated"] === true,
|
|
457
|
+
confirmRemoteQuiesced: values["confirm-remote-quiesced"] === true,
|
|
433
458
|
};
|
|
434
459
|
return { command, positionals, flags, providedOptions };
|
|
435
460
|
}
|
|
@@ -630,6 +655,10 @@ function firstRecordMaintenanceUnsupportedFlag(flags) {
|
|
|
630
655
|
["--theme", flags.theme],
|
|
631
656
|
["--orphans", flags.orphans],
|
|
632
657
|
["--teardown", flags.teardown],
|
|
658
|
+
["--recover-shared-state", flags.recoverSharedState],
|
|
659
|
+
["--owner-token", flags.ownerToken],
|
|
660
|
+
["--confirm-owner-terminated", flags.confirmOwnerTerminated],
|
|
661
|
+
["--confirm-remote-quiesced", flags.confirmRemoteQuiesced],
|
|
633
662
|
];
|
|
634
663
|
const bad = unsupported.find(([flag, value]) => {
|
|
635
664
|
if (flag === "--open/--no-open" || flag === "--early-exit/--no-early-exit") {
|
|
@@ -688,6 +717,10 @@ function parseAcceptLocators(positionals, flags) {
|
|
|
688
717
|
["--theme", flags.theme],
|
|
689
718
|
["--orphans", flags.orphans],
|
|
690
719
|
["--teardown", flags.teardown],
|
|
720
|
+
["--recover-shared-state", flags.recoverSharedState],
|
|
721
|
+
["--owner-token", flags.ownerToken],
|
|
722
|
+
["--confirm-owner-terminated", flags.confirmOwnerTerminated],
|
|
723
|
+
["--confirm-remote-quiesced", flags.confirmRemoteQuiesced],
|
|
691
724
|
];
|
|
692
725
|
const bad = unsupported.find(([flag, value]) => {
|
|
693
726
|
// `--no-open` / `--no-early-exit` are represented as false, but are still
|
|
@@ -787,6 +820,10 @@ function firstExperimentRenameUnsupportedFlag(flags) {
|
|
|
787
820
|
["--theme", flags.theme],
|
|
788
821
|
["--orphans", flags.orphans],
|
|
789
822
|
["--teardown", flags.teardown],
|
|
823
|
+
["--recover-shared-state", flags.recoverSharedState],
|
|
824
|
+
["--owner-token", flags.ownerToken],
|
|
825
|
+
["--confirm-owner-terminated", flags.confirmOwnerTerminated],
|
|
826
|
+
["--confirm-remote-quiesced", flags.confirmRemoteQuiesced],
|
|
790
827
|
["--out", flags.out],
|
|
791
828
|
["--port", flags.port],
|
|
792
829
|
["--host", flags.host],
|
|
@@ -1182,12 +1219,10 @@ function writeStderr(text) {
|
|
|
1182
1219
|
}
|
|
1183
1220
|
/** Idempotent application-level sweep for resources owned by this invocation. */
|
|
1184
1221
|
function releaseCliResources() {
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
(0, gate_lease_ts_1.drainHeldGateLeasesEffect)().pipe(effect_1.Effect.ignore),
|
|
1190
|
-
], { concurrency: "unbounded" }).pipe(effect_1.Effect.asVoid);
|
|
1222
|
+
// Shared-state leases are never part of this exit sweep. A normal Runner
|
|
1223
|
+
// lifecycle releases one only after every pool/provider/Experiment cleanup
|
|
1224
|
+
// succeeds; a failed cleanup intentionally leaves explicit recovery work.
|
|
1225
|
+
return cliPromise("stop remaining sandboxes", () => (0, registry_ts_1.stopAllSandboxes)()).pipe(effect_1.Effect.ignore, effect_1.Effect.zipRight((0, experiment_cleanup_registry_ts_1.drainExperimentTeardowns)().pipe(effect_1.Effect.ignore)), effect_1.Effect.zipRight((0, lock_ts_1.drainHeldCaseLocksEffect)().pipe(effect_1.Effect.ignore)));
|
|
1191
1226
|
}
|
|
1192
1227
|
function errorMessage(cause) {
|
|
1193
1228
|
return cause instanceof Error ? cause.message : String(cause);
|
|
@@ -1286,6 +1321,7 @@ function agentRunFromExperiment(experiment, selectedEvalIds, overrides = {}) {
|
|
|
1286
1321
|
earlyExit: overrides.earlyExit ?? experiment.earlyExit ?? false,
|
|
1287
1322
|
sandbox: experiment.sandbox,
|
|
1288
1323
|
sandboxReuse: experiment.sandboxReuse,
|
|
1324
|
+
...(experiment.sharedState === undefined ? {} : { sharedState: experiment.sharedState }),
|
|
1289
1325
|
judge: experiment.judge,
|
|
1290
1326
|
...(0, timeout_ts_1.resolveRunTimeout)(overrides.timeout, experiment.timeoutMs),
|
|
1291
1327
|
budget: overrides.budget ?? experiment.budget,
|
|
@@ -1301,6 +1337,89 @@ function agentRunFromExperiment(experiment, selectedEvalIds, overrides = {}) {
|
|
|
1301
1337
|
classifyFailure: experiment.classifyFailure,
|
|
1302
1338
|
};
|
|
1303
1339
|
}
|
|
1340
|
+
function hasSharedStateRecoveryOptions(flags) {
|
|
1341
|
+
return flags.recoverSharedState !== undefined ||
|
|
1342
|
+
flags.ownerToken !== undefined ||
|
|
1343
|
+
flags.confirmOwnerTerminated ||
|
|
1344
|
+
flags.confirmRemoteQuiesced;
|
|
1345
|
+
}
|
|
1346
|
+
function renderSharedStateRecoveryTarget(record) {
|
|
1347
|
+
return (0, index_ts_5.t)("cli.exp.sharedStateRecoveryTarget", {
|
|
1348
|
+
key: record.key,
|
|
1349
|
+
experimentId: record.experimentId,
|
|
1350
|
+
ownerToken: record.ownerToken,
|
|
1351
|
+
host: record.host,
|
|
1352
|
+
pid: record.pid,
|
|
1353
|
+
processIdentity: record.processIdentity,
|
|
1354
|
+
heartbeatAt: record.heartbeatAt,
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1357
|
+
function experimentTeardownOf(experiment) {
|
|
1358
|
+
return typeof experiment.teardown === "function" ? experiment.teardown : undefined;
|
|
1359
|
+
}
|
|
1360
|
+
/**
|
|
1361
|
+
* A legacy free generation can exist from an interrupted pre-fix recovery:
|
|
1362
|
+
* it has durable owner evidence but may still have its old teardown entry.
|
|
1363
|
+
* Only the entry keyed by that exact immutable owner is eligible for removal.
|
|
1364
|
+
*
|
|
1365
|
+
* Claimed recovery takes the same path before publishing free. A failed or
|
|
1366
|
+
* contested claim therefore leaves the recovery generation closed rather than
|
|
1367
|
+
* letting a waiter enter while the old teardown could still be replayed.
|
|
1368
|
+
*/
|
|
1369
|
+
function inspectExactRecoveryTeardownRegistrationEffect(input) {
|
|
1370
|
+
const { niceevalRoot, record, currentHost } = input;
|
|
1371
|
+
const id = (0, teardown_registry_ts_1.teardownEntryId)(record.experimentId, record.pid);
|
|
1372
|
+
return effect_1.Effect.gen(function* () {
|
|
1373
|
+
const registration = yield* (0, teardown_registry_ts_1.readExactTeardownRegistrationEffect)(niceevalRoot, record.experimentId, record.pid);
|
|
1374
|
+
// A holder can die before its registration is durably written. There is
|
|
1375
|
+
// then no old teardown obligation to clear, but no unrelated entry may be
|
|
1376
|
+
// inferred from the current Experiment declaration.
|
|
1377
|
+
if (registration === undefined)
|
|
1378
|
+
return false;
|
|
1379
|
+
if (registration.host !== record.host) {
|
|
1380
|
+
return yield* effect_1.Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} belongs to host ${JSON.stringify(registration.host)}, ` +
|
|
1381
|
+
`not immutable sharedState owner host ${JSON.stringify(record.host)}`));
|
|
1382
|
+
}
|
|
1383
|
+
// The registration does not carry a process identity itself, so recovery
|
|
1384
|
+
// compares it to the immutable sharedState owner. This shares the lease
|
|
1385
|
+
// terminal boundary: an exact local Z/X/x owner is stopped; an unreadable
|
|
1386
|
+
// or malformed identity probe fails closed instead of treating PID
|
|
1387
|
+
// existence as proof that cleanup can still run.
|
|
1388
|
+
const terminated = yield* (0, teardown_registry_ts_1.isExactTeardownRegistrationOwnerTerminatedEffect)({
|
|
1389
|
+
registration,
|
|
1390
|
+
owner: record,
|
|
1391
|
+
currentHost,
|
|
1392
|
+
});
|
|
1393
|
+
if (!terminated) {
|
|
1394
|
+
return yield* effect_1.Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} still belongs to a live exact sharedState owner; refusing to clear it`));
|
|
1395
|
+
}
|
|
1396
|
+
return true;
|
|
1397
|
+
});
|
|
1398
|
+
}
|
|
1399
|
+
function clearExactRecoveryTeardownRegistrationEffect(input) {
|
|
1400
|
+
const { niceevalRoot, record, currentHost, expectedRegistration } = input;
|
|
1401
|
+
const id = (0, teardown_registry_ts_1.teardownEntryId)(record.experimentId, record.pid);
|
|
1402
|
+
return effect_1.Effect.gen(function* () {
|
|
1403
|
+
const present = yield* inspectExactRecoveryTeardownRegistrationEffect({
|
|
1404
|
+
niceevalRoot,
|
|
1405
|
+
record,
|
|
1406
|
+
currentHost,
|
|
1407
|
+
});
|
|
1408
|
+
if (!present) {
|
|
1409
|
+
if (expectedRegistration) {
|
|
1410
|
+
return yield* effect_1.Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} disappeared before this recovery could clear it`));
|
|
1411
|
+
}
|
|
1412
|
+
return;
|
|
1413
|
+
}
|
|
1414
|
+
if (!expectedRegistration) {
|
|
1415
|
+
return yield* effect_1.Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} appeared after this recovery was claimed`));
|
|
1416
|
+
}
|
|
1417
|
+
const removed = yield* (0, teardown_registry_ts_1.removeTeardownRegistrationIfPresentEffect)(niceevalRoot, id);
|
|
1418
|
+
if (!removed) {
|
|
1419
|
+
return yield* effect_1.Effect.fail(new Error(`teardown registration ${JSON.stringify(id)} changed before this recovery could clear it`));
|
|
1420
|
+
}
|
|
1421
|
+
});
|
|
1422
|
+
}
|
|
1304
1423
|
function renderDebugPlanJson(input) {
|
|
1305
1424
|
return `${JSON.stringify({
|
|
1306
1425
|
format: "niceeval.debug-plan/v1",
|
|
@@ -1363,6 +1482,13 @@ function runDebugCommand(cwd, positionals, flags) {
|
|
|
1363
1482
|
}
|
|
1364
1483
|
function runEvaluationCommand(cwd, command, positionals, flags, interruption) {
|
|
1365
1484
|
return effect_1.Effect.gen(function* () {
|
|
1485
|
+
// Explicit recovery is intentionally human-only. It has no receipt or
|
|
1486
|
+
// NDJSON contract, so accepting --json would give machine callers an
|
|
1487
|
+
// apparently successful but unparseable interface.
|
|
1488
|
+
if (command === "exp" && flags.recoverSharedState !== undefined && flags.json) {
|
|
1489
|
+
yield* writeStderr((0, index_ts_5.t)("cli.exp.sharedStateRecoveryJsonUnsupported"));
|
|
1490
|
+
return 1;
|
|
1491
|
+
}
|
|
1366
1492
|
// Keep project-local coordination (sessions, locks, kept sandboxes) separate
|
|
1367
1493
|
// from the portable Record root selected by `--record` below.
|
|
1368
1494
|
const coordinationRoot = (0, node_path_1.resolve)(cwd, ".niceeval");
|
|
@@ -1389,6 +1515,10 @@ function runEvaluationCommand(cwd, command, positionals, flags, interruption) {
|
|
|
1389
1515
|
let experimentSelection = (0, index_ts_5.t)("cli.all");
|
|
1390
1516
|
let availableExperimentPaths = (0, index_ts_5.t)("cli.none");
|
|
1391
1517
|
if (command === "exp" || command === "check") {
|
|
1518
|
+
if (hasSharedStateRecoveryOptions(flags) && (command !== "exp" || !flags.teardown)) {
|
|
1519
|
+
yield* writeStderr((0, index_ts_5.t)("cli.exp.sharedStateRecoveryFlags"));
|
|
1520
|
+
return 1;
|
|
1521
|
+
}
|
|
1392
1522
|
if (flags.agent || flags.model) {
|
|
1393
1523
|
yield* writeStderr((0, index_ts_5.t)("cli.exp.agentModelFlagUnsupported"));
|
|
1394
1524
|
return 1;
|
|
@@ -1488,7 +1618,7 @@ function runEvaluationCommand(cwd, command, positionals, flags, interruption) {
|
|
|
1488
1618
|
if (orphans)
|
|
1489
1619
|
yield* writeStderr(orphans);
|
|
1490
1620
|
const teardownReminder = yield* (0, teardown_registry_ts_1.orphanedTeardownReminderEffect)(coordinationRoot, new Set(selected
|
|
1491
|
-
.filter(({ experiment }) => experiment
|
|
1621
|
+
.filter(({ experiment }) => experimentTeardownOf(experiment) !== undefined)
|
|
1492
1622
|
.map(({ experiment }) => experiment.id)), (0, node_os_1.hostname)()).pipe(effect_1.Effect.catchAll(() => effect_1.Effect.succeed(undefined)));
|
|
1493
1623
|
if (teardownReminder)
|
|
1494
1624
|
yield* writeStderr(teardownReminder);
|
|
@@ -1498,10 +1628,143 @@ function runEvaluationCommand(cwd, command, positionals, flags, interruption) {
|
|
|
1498
1628
|
return 1;
|
|
1499
1629
|
}
|
|
1500
1630
|
const niceevalRootForTeardown = coordinationRoot;
|
|
1631
|
+
let selectedForTeardown = selected;
|
|
1632
|
+
let explicitRecovery;
|
|
1633
|
+
if (flags.recoverSharedState !== undefined) {
|
|
1634
|
+
// The input key is the recovery authority. Read its immutable
|
|
1635
|
+
// evidence before considering today's Experiment declaration: an
|
|
1636
|
+
// author may have renamed or removed sharedState after the holder
|
|
1637
|
+
// crashed, but must still have a public recovery path for that old
|
|
1638
|
+
// external state.
|
|
1639
|
+
const inspected = yield* effect_1.Effect.either((0, shared_state_lease_ts_1.readSharedStateLeaseRecoveryTargetEffect)(niceevalRootForTeardown, flags.recoverSharedState));
|
|
1640
|
+
if (effect_1.Either.isLeft(inspected)) {
|
|
1641
|
+
yield* writeStderr(`sharedState recovery inspection failed: ${errorMessage(inspected.left)}\n`);
|
|
1642
|
+
return 1;
|
|
1643
|
+
}
|
|
1644
|
+
if (inspected.right === undefined) {
|
|
1645
|
+
yield* writeStderr(`No recoverable sharedState ownership evidence exists for ${JSON.stringify(flags.recoverSharedState)}.\n`);
|
|
1646
|
+
return 1;
|
|
1647
|
+
}
|
|
1648
|
+
yield* writeStderr(renderSharedStateRecoveryTarget(inspected.right));
|
|
1649
|
+
if (selected.length !== 1) {
|
|
1650
|
+
yield* writeStderr("sharedState recovery requires an experiment selector that resolves to exactly one Experiment.\n");
|
|
1651
|
+
return 1;
|
|
1652
|
+
}
|
|
1653
|
+
const target = selected[0];
|
|
1654
|
+
if (inspected.right.experimentId !== target.experiment.id) {
|
|
1655
|
+
yield* writeStderr(`sharedState key ${JSON.stringify(flags.recoverSharedState)} belongs to experiment ${inspected.right.experimentId}, not ${target.experiment.id}; refusing recovery.\n`);
|
|
1656
|
+
return 1;
|
|
1657
|
+
}
|
|
1658
|
+
// Inspection intentionally precedes confirmation validation. The
|
|
1659
|
+
// immutable generation head retains the exact owner evidence even
|
|
1660
|
+
// after a crashed recovery attempt; this public command is the only
|
|
1661
|
+
// supported way to reveal it, never private-file manipulation.
|
|
1662
|
+
if (flags.ownerToken === undefined ||
|
|
1663
|
+
!flags.confirmOwnerTerminated ||
|
|
1664
|
+
!flags.confirmRemoteQuiesced) {
|
|
1665
|
+
yield* writeStderr((0, index_ts_5.t)("cli.exp.sharedStateRecoveryFlags"));
|
|
1666
|
+
return 1;
|
|
1667
|
+
}
|
|
1668
|
+
// Inspection is read-only and remains available without a teardown.
|
|
1669
|
+
// Only the uniquely selected target can reach this point. Validate
|
|
1670
|
+
// its teardown immediately before claiming a recovery generation.
|
|
1671
|
+
if (experimentTeardownOf(target.experiment) === undefined) {
|
|
1672
|
+
yield* writeStderr((0, index_ts_5.t)("cli.exp.sharedStateRecoveryTeardownRequired", {
|
|
1673
|
+
experimentId: target.experiment.id,
|
|
1674
|
+
}));
|
|
1675
|
+
return 1;
|
|
1676
|
+
}
|
|
1677
|
+
const begun = yield* effect_1.Effect.either((0, shared_state_lease_ts_1.beginExplicitSharedStateRecoveryEffect)({
|
|
1678
|
+
niceevalRoot: niceevalRootForTeardown,
|
|
1679
|
+
key: flags.recoverSharedState,
|
|
1680
|
+
ownerToken: flags.ownerToken,
|
|
1681
|
+
localHost: (0, node_os_1.hostname)(),
|
|
1682
|
+
confirmOwnerTerminated: flags.confirmOwnerTerminated,
|
|
1683
|
+
confirmRemoteQuiesced: flags.confirmRemoteQuiesced,
|
|
1684
|
+
}));
|
|
1685
|
+
if (effect_1.Either.isLeft(begun)) {
|
|
1686
|
+
yield* writeStderr(`sharedState recovery refused: ${errorMessage(begun.left)}\n`);
|
|
1687
|
+
return 1;
|
|
1688
|
+
}
|
|
1689
|
+
if (begun.right._tag === "AlreadyReleased") {
|
|
1690
|
+
const registrationWasPresent = yield* effect_1.Effect.either(inspectExactRecoveryTeardownRegistrationEffect({
|
|
1691
|
+
niceevalRoot: niceevalRootForTeardown,
|
|
1692
|
+
record: begun.right.record,
|
|
1693
|
+
currentHost: (0, node_os_1.hostname)(),
|
|
1694
|
+
}));
|
|
1695
|
+
if (effect_1.Either.isLeft(registrationWasPresent)) {
|
|
1696
|
+
yield* writeStderr((0, index_ts_5.t)("cli.exp.sharedStateRecoveryAlreadyReleasedRegistrationFailed", {
|
|
1697
|
+
key: begun.right.record.key,
|
|
1698
|
+
message: errorMessage(registrationWasPresent.left),
|
|
1699
|
+
}));
|
|
1700
|
+
return 1;
|
|
1701
|
+
}
|
|
1702
|
+
const cleared = yield* effect_1.Effect.either(clearExactRecoveryTeardownRegistrationEffect({
|
|
1703
|
+
niceevalRoot: niceevalRootForTeardown,
|
|
1704
|
+
record: begun.right.record,
|
|
1705
|
+
currentHost: (0, node_os_1.hostname)(),
|
|
1706
|
+
expectedRegistration: registrationWasPresent.right,
|
|
1707
|
+
}));
|
|
1708
|
+
if (effect_1.Either.isLeft(cleared)) {
|
|
1709
|
+
yield* writeStderr((0, index_ts_5.t)("cli.exp.sharedStateRecoveryAlreadyReleasedRegistrationFailed", {
|
|
1710
|
+
key: begun.right.record.key,
|
|
1711
|
+
message: errorMessage(cleared.left),
|
|
1712
|
+
}));
|
|
1713
|
+
return 1;
|
|
1714
|
+
}
|
|
1715
|
+
yield* writeStderr((0, index_ts_5.t)("cli.exp.sharedStateRecoveryAlreadyReleased", { key: begun.right.record.key }));
|
|
1716
|
+
yield* writeStderr((0, index_ts_5.t)("runner.sharedStateExplicitRecovered", {
|
|
1717
|
+
key: begun.right.record.key,
|
|
1718
|
+
experimentId: begun.right.record.experimentId,
|
|
1719
|
+
ownerToken: begun.right.record.ownerToken,
|
|
1720
|
+
}));
|
|
1721
|
+
return 0;
|
|
1722
|
+
}
|
|
1723
|
+
if (begun.right.record.experimentId !== target.experiment.id) {
|
|
1724
|
+
yield* writeStderr(`sharedState key ${JSON.stringify(flags.recoverSharedState)} changed Experiment ownership during recovery; refusing teardown.\n`);
|
|
1725
|
+
return 1;
|
|
1726
|
+
}
|
|
1727
|
+
const registrationWasPresent = yield* effect_1.Effect.either(inspectExactRecoveryTeardownRegistrationEffect({
|
|
1728
|
+
niceevalRoot: niceevalRootForTeardown,
|
|
1729
|
+
record: begun.right.record,
|
|
1730
|
+
currentHost: (0, node_os_1.hostname)(),
|
|
1731
|
+
}));
|
|
1732
|
+
if (effect_1.Either.isLeft(registrationWasPresent)) {
|
|
1733
|
+
yield* writeStderr((0, index_ts_5.t)("cli.exp.sharedStateRecoveryRegistrationFailed", {
|
|
1734
|
+
key: begun.right.record.key,
|
|
1735
|
+
message: errorMessage(registrationWasPresent.left),
|
|
1736
|
+
}));
|
|
1737
|
+
return 1;
|
|
1738
|
+
}
|
|
1739
|
+
explicitRecovery = {
|
|
1740
|
+
key: begun.right.record.key,
|
|
1741
|
+
ownerToken: begun.right.record.ownerToken,
|
|
1742
|
+
recoveryId: begun.right.recoveryId,
|
|
1743
|
+
experimentId: begun.right.record.experimentId,
|
|
1744
|
+
record: begun.right.record,
|
|
1745
|
+
registrationWasPresent: registrationWasPresent.right,
|
|
1746
|
+
};
|
|
1747
|
+
selectedForTeardown = [target];
|
|
1748
|
+
}
|
|
1749
|
+
else if (hasSharedStateRecoveryOptions(flags)) {
|
|
1750
|
+
yield* writeStderr((0, index_ts_5.t)("cli.exp.sharedStateRecoveryFlags"));
|
|
1751
|
+
return 1;
|
|
1752
|
+
}
|
|
1501
1753
|
let anyFailed = false;
|
|
1502
|
-
for (const { experiment, selectedEvalIds } of
|
|
1503
|
-
|
|
1754
|
+
for (const { experiment, selectedEvalIds } of selectedForTeardown) {
|
|
1755
|
+
const teardown = experimentTeardownOf(experiment);
|
|
1756
|
+
if (teardown === undefined) {
|
|
1757
|
+
// Discovery normally reaches this branch only for an absent
|
|
1758
|
+
// teardown, because defineExperiment rejects non-functions. Keep
|
|
1759
|
+
// the CLI boundary equally strict for dynamically supplied
|
|
1760
|
+
// definitions: a truthy or null-ish impostor must never be
|
|
1761
|
+
// treated as a completed recovery hook.
|
|
1762
|
+
if (experiment.teardown !== undefined) {
|
|
1763
|
+
anyFailed = true;
|
|
1764
|
+
yield* writeStderr((0, index_ts_5.t)("define.experimentTeardownNotFunction"));
|
|
1765
|
+
}
|
|
1504
1766
|
continue;
|
|
1767
|
+
}
|
|
1505
1768
|
const ctx = {
|
|
1506
1769
|
experimentId: experiment.id,
|
|
1507
1770
|
selectedEvalIds,
|
|
@@ -1509,14 +1772,31 @@ function runEvaluationCommand(cwd, command, positionals, flags, interruption) {
|
|
|
1509
1772
|
progress: () => { },
|
|
1510
1773
|
diagnostic: (input) => process.stderr.write(`${input.message}\n`),
|
|
1511
1774
|
};
|
|
1775
|
+
if (explicitRecovery !== undefined) {
|
|
1776
|
+
// The exact registration was inspected after the immutable
|
|
1777
|
+
// recovery marker was claimed. Do not re-scan by current
|
|
1778
|
+
// Experiment identity: its sharedState declaration can have
|
|
1779
|
+
// changed, and broad scans could claim another run's cleanup.
|
|
1780
|
+
const outcome = yield* effect_1.Effect.either(cliEffect("run experiment teardown", (0, cleanup_timeout_ts_1.cleanupCallback)(() => teardown(ctx))));
|
|
1781
|
+
if (effect_1.Either.isRight(outcome)) {
|
|
1782
|
+
yield* writeStderr((0, index_ts_5.t)("cli.exp.teardownDone", { experimentId: experiment.id }));
|
|
1783
|
+
}
|
|
1784
|
+
else {
|
|
1785
|
+
anyFailed = true;
|
|
1786
|
+
const error = outcome.left.cause;
|
|
1787
|
+
yield* writeStderr((0, index_ts_5.t)("cli.exp.teardownFailed", {
|
|
1788
|
+
experimentId: experiment.id,
|
|
1789
|
+
message: error instanceof Error ? error.message : String(error),
|
|
1790
|
+
}));
|
|
1791
|
+
}
|
|
1792
|
+
continue;
|
|
1793
|
+
}
|
|
1512
1794
|
const registrations = yield* (0, teardown_registry_ts_1.readTeardownRegistrationsEffect)(niceevalRootForTeardown).pipe(effect_1.Effect.catchAll(() => effect_1.Effect.succeed([])));
|
|
1513
1795
|
const matching = registrations.filter(({ entry }) => entry.experimentId === experiment.id);
|
|
1514
|
-
const
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
for (const _ of executions) {
|
|
1519
|
-
const outcome = yield* effect_1.Effect.either(cliEffect("run experiment teardown", (0, cleanup_timeout_ts_1.cleanupCallback)(() => experiment.teardown(ctx))));
|
|
1796
|
+
const orphaned = matching.filter(({ entry }) => (0, teardown_registry_ts_1.isOrphanedTeardownRegistration)(entry, (0, node_os_1.hostname)()));
|
|
1797
|
+
const executions = effect_1.Effect.all(orphaned.map(({ id }) => (0, teardown_registry_ts_1.removeTeardownRegistrationIfPresentEffect)(niceevalRootForTeardown, id).pipe(effect_1.Effect.catchAll(() => effect_1.Effect.succeed(false)), effect_1.Effect.map((claimed) => claimed ? id : undefined))), { concurrency: "unbounded" }).pipe(effect_1.Effect.map((claimed) => matching.length === 0 ? [undefined] : claimed.filter((id) => id !== undefined)));
|
|
1798
|
+
for (const _ of yield* executions) {
|
|
1799
|
+
const outcome = yield* effect_1.Effect.either(cliEffect("run experiment teardown", (0, cleanup_timeout_ts_1.cleanupCallback)(() => teardown(ctx))));
|
|
1520
1800
|
if (effect_1.Either.isRight(outcome)) {
|
|
1521
1801
|
yield* writeStderr((0, index_ts_5.t)("cli.exp.teardownDone", { experimentId: experiment.id }));
|
|
1522
1802
|
}
|
|
@@ -1530,6 +1810,42 @@ function runEvaluationCommand(cwd, command, positionals, flags, interruption) {
|
|
|
1530
1810
|
}
|
|
1531
1811
|
}
|
|
1532
1812
|
}
|
|
1813
|
+
if (!anyFailed && explicitRecovery !== undefined) {
|
|
1814
|
+
// A waiter may enter as soon as `complete...` publishes free. The
|
|
1815
|
+
// old durable teardown obligation must therefore be removed first.
|
|
1816
|
+
// Any read/claim failure leaves the immutable recovery marker
|
|
1817
|
+
// closed, so an operator can inspect and retry instead of replaying
|
|
1818
|
+
// old teardown after a new owner starts.
|
|
1819
|
+
const cleared = yield* effect_1.Effect.either(clearExactRecoveryTeardownRegistrationEffect({
|
|
1820
|
+
niceevalRoot: niceevalRootForTeardown,
|
|
1821
|
+
record: explicitRecovery.record,
|
|
1822
|
+
currentHost: (0, node_os_1.hostname)(),
|
|
1823
|
+
expectedRegistration: explicitRecovery.registrationWasPresent,
|
|
1824
|
+
}));
|
|
1825
|
+
if (effect_1.Either.isLeft(cleared)) {
|
|
1826
|
+
yield* writeStderr((0, index_ts_5.t)("cli.exp.sharedStateRecoveryRegistrationFailed", {
|
|
1827
|
+
key: explicitRecovery.key,
|
|
1828
|
+
message: errorMessage(cleared.left),
|
|
1829
|
+
}));
|
|
1830
|
+
return 1;
|
|
1831
|
+
}
|
|
1832
|
+
const completed = yield* effect_1.Effect.either((0, shared_state_lease_ts_1.completeExplicitSharedStateRecoveryEffect)({
|
|
1833
|
+
niceevalRoot: niceevalRootForTeardown,
|
|
1834
|
+
key: explicitRecovery.key,
|
|
1835
|
+
ownerToken: explicitRecovery.ownerToken,
|
|
1836
|
+
recoveryId: explicitRecovery.recoveryId,
|
|
1837
|
+
localHost: (0, node_os_1.hostname)(),
|
|
1838
|
+
}));
|
|
1839
|
+
if (effect_1.Either.isLeft(completed)) {
|
|
1840
|
+
yield* writeStderr(`sharedState recovery could not release its exact owner token: ${errorMessage(completed.left)}\n`);
|
|
1841
|
+
return 1;
|
|
1842
|
+
}
|
|
1843
|
+
yield* writeStderr((0, index_ts_5.t)("runner.sharedStateExplicitRecovered", {
|
|
1844
|
+
key: explicitRecovery.key,
|
|
1845
|
+
experimentId: explicitRecovery.experimentId,
|
|
1846
|
+
ownerToken: explicitRecovery.ownerToken,
|
|
1847
|
+
}));
|
|
1848
|
+
}
|
|
1533
1849
|
return anyFailed ? 1 : 0;
|
|
1534
1850
|
}
|
|
1535
1851
|
const experimentScopeIds = new Set();
|
|
@@ -1738,6 +2054,7 @@ function runEvaluationCommand(cwd, command, positionals, flags, interruption) {
|
|
|
1738
2054
|
session: sessionTracker,
|
|
1739
2055
|
onCurrentRecordReusePlan: (current) => effect_1.Effect.sync(() => coordinator.start({
|
|
1740
2056
|
...plan,
|
|
2057
|
+
shape: { ...plan.shape, runIds: current.runIds },
|
|
1741
2058
|
reused: current.reused,
|
|
1742
2059
|
...(current.reusedFailures.length === 0 ? {} : { reusedFailures: current.reusedFailures }),
|
|
1743
2060
|
})),
|
|
@@ -1913,7 +2230,7 @@ function parseReportCliRequest(input) {
|
|
|
1913
2230
|
kind: "project-current",
|
|
1914
2231
|
...(input.flags.experiment === undefined
|
|
1915
2232
|
? {}
|
|
1916
|
-
: {
|
|
2233
|
+
: { experimentSelectors: uniqueExperimentSelectors(input.flags.experiment) }),
|
|
1917
2234
|
});
|
|
1918
2235
|
return Object.freeze({
|
|
1919
2236
|
command: input.command,
|
|
@@ -1973,6 +2290,10 @@ function reportUnsupportedFlag(command, flags) {
|
|
|
1973
2290
|
["--stats", flags.stats],
|
|
1974
2291
|
["--orphans", flags.orphans],
|
|
1975
2292
|
["--teardown", flags.teardown],
|
|
2293
|
+
["--recover-shared-state", flags.recoverSharedState],
|
|
2294
|
+
["--owner-token", flags.ownerToken],
|
|
2295
|
+
["--confirm-owner-terminated", flags.confirmOwnerTerminated],
|
|
2296
|
+
["--confirm-remote-quiesced", flags.confirmRemoteQuiesced],
|
|
1976
2297
|
["--yes", flags.yes],
|
|
1977
2298
|
];
|
|
1978
2299
|
const found = unsupported.find(([, value]) => value !== undefined && value !== false && (!Array.isArray(value) || value.length > 0));
|
|
@@ -1990,12 +2311,12 @@ function parseReportRoute(value) {
|
|
|
1990
2311
|
function reportSelection(cwd, value) {
|
|
1991
2312
|
if (value === undefined)
|
|
1992
2313
|
return Object.freeze({ kind: "config" });
|
|
1993
|
-
if (value === "
|
|
1994
|
-
return Object.freeze({ kind: "built-in", name: "
|
|
2314
|
+
if (value === "standard")
|
|
2315
|
+
return Object.freeze({ kind: "built-in", name: "standard" });
|
|
1995
2316
|
if (isTrustedModulePath(value)) {
|
|
1996
2317
|
return Object.freeze({ kind: "module", path: (0, node_ts_1.resolveTrustedModulePath)(cwd, value) });
|
|
1997
2318
|
}
|
|
1998
|
-
throw usageError("--report accepts built-in
|
|
2319
|
+
throw usageError("--report accepts built-in standard or an explicit trusted module path.\n");
|
|
1999
2320
|
}
|
|
2000
2321
|
function themeSelection(cwd, value) {
|
|
2001
2322
|
if (value === undefined)
|
|
@@ -2038,13 +2359,13 @@ function uniqueExactRunIds(values) {
|
|
|
2038
2359
|
}
|
|
2039
2360
|
return Object.freeze(result);
|
|
2040
2361
|
}
|
|
2041
|
-
function
|
|
2362
|
+
function uniqueExperimentSelectors(values) {
|
|
2042
2363
|
const result = [];
|
|
2043
2364
|
const seen = new Set();
|
|
2044
2365
|
for (const value of values) {
|
|
2045
2366
|
const decoded = effect_1.Schema.decodeUnknownEither(identifiers_ts_1.ExperimentIdSchema)(value);
|
|
2046
2367
|
if (effect_1.Either.isLeft(decoded)) {
|
|
2047
|
-
throw usageError(`Invalid --experiment value "${value}": expected
|
|
2368
|
+
throw usageError(`Invalid --experiment value "${value}": expected an Experiment selector.\n`);
|
|
2048
2369
|
}
|
|
2049
2370
|
if (!seen.has(decoded.right)) {
|
|
2050
2371
|
seen.add(decoded.right);
|
|
@@ -2053,6 +2374,10 @@ function uniqueExactExperimentIds(values) {
|
|
|
2053
2374
|
}
|
|
2054
2375
|
return Object.freeze(result);
|
|
2055
2376
|
}
|
|
2377
|
+
function selectedExperimentIds(slots) {
|
|
2378
|
+
return Object.freeze([...new Set(slots.map((slot) => slot.experimentId))]
|
|
2379
|
+
.sort((left, right) => Buffer.compare(Buffer.from(left), Buffer.from(right))));
|
|
2380
|
+
}
|
|
2056
2381
|
/** Current Record locators use the strict scheme-1 short alias. */
|
|
2057
2382
|
function parseCurrentAttemptLocator(value) {
|
|
2058
2383
|
const parsed = (0, attempt_locator_ts_1.parseAttemptLocator)(value);
|
|
@@ -2070,9 +2395,9 @@ function loadCliReportInputs(request) {
|
|
|
2070
2395
|
return effect_1.Effect.gen(function* () {
|
|
2071
2396
|
const projectCurrent = request.target.kind === "project-current"
|
|
2072
2397
|
? yield* cliEffect("load current project target", (0, project_current_ts_1.loadProjectCurrent)(request.cwd, {
|
|
2073
|
-
...(request.target.
|
|
2398
|
+
...(request.target.experimentSelectors === undefined
|
|
2074
2399
|
? {}
|
|
2075
|
-
: { experiments: request.target.
|
|
2400
|
+
: { experiments: request.target.experimentSelectors }),
|
|
2076
2401
|
freshImport: true,
|
|
2077
2402
|
}))
|
|
2078
2403
|
: undefined;
|
|
@@ -2084,8 +2409,8 @@ function loadCliReportInputs(request) {
|
|
|
2084
2409
|
: Object.freeze({
|
|
2085
2410
|
policy: "project-current",
|
|
2086
2411
|
currentSlots: projectCurrent.currentSlots,
|
|
2087
|
-
...(request.target.kind === "project-current" && request.target.
|
|
2088
|
-
? { experimentIds:
|
|
2412
|
+
...(request.target.kind === "project-current" && request.target.experimentSelectors !== undefined
|
|
2413
|
+
? { experimentIds: selectedExperimentIds(projectCurrent.currentSlots) }
|
|
2089
2414
|
: {}),
|
|
2090
2415
|
});
|
|
2091
2416
|
const sourceWatchInputs = uniqueWatchInputs([
|
|
@@ -2113,11 +2438,11 @@ function reportFromSelection(selection, configured, configuredWatchInputs) {
|
|
|
2113
2438
|
return effect_1.Effect.succeed(Object.freeze({ value: selection.report, watchInputs: Object.freeze([]) }));
|
|
2114
2439
|
case "config":
|
|
2115
2440
|
return effect_1.Effect.succeed(Object.freeze({
|
|
2116
|
-
value: configured ??
|
|
2441
|
+
value: configured ?? standard_tsx_1.standard,
|
|
2117
2442
|
watchInputs: configured === undefined ? Object.freeze([]) : configuredWatchInputs,
|
|
2118
2443
|
}));
|
|
2119
2444
|
case "built-in":
|
|
2120
|
-
return effect_1.Effect.succeed(Object.freeze({ value:
|
|
2445
|
+
return effect_1.Effect.succeed(Object.freeze({ value: standard_tsx_1.standard, watchInputs: Object.freeze([]) }));
|
|
2121
2446
|
case "module":
|
|
2122
2447
|
return cliEffect("load trusted Report module", (0, node_ts_1.loadTrustedReportModule)(selection.path)).pipe(effect_1.Effect.map((loaded) => Object.freeze({ value: loaded.report, watchInputs: loaded.watchInputs })));
|
|
2123
2448
|
}
|
|
@@ -2190,6 +2515,23 @@ function reportExecutionFailure(error) {
|
|
|
2190
2515
|
return cliFailure("execute report from Record", error);
|
|
2191
2516
|
}
|
|
2192
2517
|
}
|
|
2518
|
+
function automaticRecordMigrationFailure(error) {
|
|
2519
|
+
const code = failureCode(error);
|
|
2520
|
+
if (code === "record-auto-migration-git-save-required") {
|
|
2521
|
+
return usageError("record-auto-migration-git-save-required\n" +
|
|
2522
|
+
"Save every portable Record byte first (for example: git add .niceeval/record && git commit), then retry the same command.\n");
|
|
2523
|
+
}
|
|
2524
|
+
if (code === "record-maintenance-busy" || code === "record-writer-busy") {
|
|
2525
|
+
return usageError(`${code}\nClose the command using this Record, then retry.\n`);
|
|
2526
|
+
}
|
|
2527
|
+
if (code === "record-format-unsupported") {
|
|
2528
|
+
return usageError("record-format-unsupported\nUse the NiceEval version that wrote this future or unknown Record format.\n");
|
|
2529
|
+
}
|
|
2530
|
+
if (code === "record-migration-recovery-required" || code === "record-migration-interrupted") {
|
|
2531
|
+
return usageError(`${code}\nRestore and verify the complete Record from Git before retrying.\n`);
|
|
2532
|
+
}
|
|
2533
|
+
return cliFailure("automatically migrate Record", error);
|
|
2534
|
+
}
|
|
2193
2535
|
/** Preserve the actionable dimension and target from the Host's closed budget error. */
|
|
2194
2536
|
function reportBuildBudgetExceededMessage(error) {
|
|
2195
2537
|
const budget = stringProperty(error, "budget");
|
|
@@ -2722,10 +3064,23 @@ const cliProgram = (interruption) => effect_1.Effect.gen(function* () {
|
|
|
2722
3064
|
yield* writeStdout((0, index_ts_5.t)("cli.help"));
|
|
2723
3065
|
return 0;
|
|
2724
3066
|
}
|
|
3067
|
+
if (command === "exp" && positionals.length === 1 && positionals[0] === "help") {
|
|
3068
|
+
yield* writeStdout((0, index_ts_5.t)("cli.help"));
|
|
3069
|
+
return 0;
|
|
3070
|
+
}
|
|
2725
3071
|
if (flags.version) {
|
|
2726
3072
|
yield* writeStdout((yield* packageVersion()) + "\n");
|
|
2727
3073
|
return 0;
|
|
2728
3074
|
}
|
|
3075
|
+
if (command === "show" || command === "view" || command === "exp") {
|
|
3076
|
+
const migrated = yield* (0, record_ts_1.ensureAutomaticRecordMigration)({
|
|
3077
|
+
cwd,
|
|
3078
|
+
...(flags.record === undefined ? {} : { record: flags.record }),
|
|
3079
|
+
}).pipe(effect_1.Effect.mapError(automaticRecordMigrationFailure));
|
|
3080
|
+
if (migrated !== null) {
|
|
3081
|
+
yield* writeStderr(`Record automatically migrated to schemaVersion ${migrated.targetSchemaVersion}; restore commit ${migrated.restoreCommit}.\n`);
|
|
3082
|
+
}
|
|
3083
|
+
}
|
|
2729
3084
|
if (command === "debug") {
|
|
2730
3085
|
const unsupported = providedOptions.find((name) => name !== "json" && name !== "help" && name !== "version");
|
|
2731
3086
|
if (unsupported !== undefined) {
|