niceeval 0.13.2-canary.35 → 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 +24 -2
- 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/deepseek-harness.cjs +50 -2
- package/dist/agents/deepseek-harness.cjs.map +1 -1
- package/dist/agents/deepseek-harness.d.cts +2 -0
- package/dist/agents/deepseek-harness.d.mts +2 -0
- package/dist/agents/deepseek-harness.d.ts +2 -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/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 +2 -2
- package/dist/agents/types.d.mts +2 -2
- package/dist/agents/types.d.ts +2 -2
- package/dist/agents/ui-message-stream.cjs +24 -7
- package/dist/agents/ui-message-stream.cjs.map +1 -1
- package/dist/analysis/api.cjs +19 -1
- package/dist/analysis/api.cjs.map +1 -1
- package/dist/analysis/api.d.cts +2 -2
- package/dist/analysis/api.d.mts +2 -2
- package/dist/analysis/api.d.ts +2 -2
- 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 +19 -6
- package/dist/i18n/en.cjs.map +1 -1
- package/dist/i18n/en.d.cts +12 -4
- package/dist/i18n/en.d.mts +12 -4
- package/dist/i18n/en.d.ts +12 -4
- 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/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 +0 -8
- package/dist/report/built-in/analysis-values.cjs.map +1 -1
- package/dist/report/built-in/analysis-values.d.cts +0 -13
- package/dist/report/built-in/analysis-values.d.mts +0 -13
- package/dist/report/built-in/analysis-values.d.ts +0 -13
- 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 +25 -73
- package/dist/report/built-in/result-components.cjs.map +1 -1
- package/dist/report/built-in/result-components.d.cts +3 -19
- package/dist/report/built-in/result-components.d.mts +3 -19
- package/dist/report/built-in/result-components.d.ts +3 -19
- package/dist/report/built-in/result-components.js +0 -4
- package/dist/report/built-in/run-membership-overview.cjs +30 -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 -46
- package/dist/report/built-in/standard.cjs.map +1 -1
- package/dist/report/built-in/standard.d.cts +19 -42
- package/dist/report/built-in/standard.d.mts +19 -42
- package/dist/report/built-in/standard.d.ts +19 -42
- 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 +2 -2
- package/dist/report/components/entity-lists/compute.cjs.map +1 -1
- package/dist/report/components/entity-lists/compute.d.cts +2 -2
- package/dist/report/components/entity-lists/compute.d.mts +2 -2
- package/dist/report/components/entity-lists/compute.d.ts +2 -2
- package/dist/report/components/entity-lists/index.cjs +6 -2
- package/dist/report/components/entity-lists/index.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.d.cts +3 -6
- package/dist/report/components/entity-lists/index.d.mts +3 -6
- package/dist/report/components/entity-lists/index.d.ts +3 -6
- 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/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 +6 -0
- 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 +139 -64
- 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 +521 -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 +46 -8
- package/dist/sample/capability.cjs.map +1 -1
- 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/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/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 +1 -0
- package/docs-site/zh/examples/integrations/langgraph.mdx +1 -1
- package/docs-site/zh/explanation/assert.mdx +6 -6
- package/docs-site/zh/explanation/drive.mdx +1 -1
- package/docs-site/zh/explanation/evals.mdx +9 -9
- package/docs-site/zh/explanation/experiment.mdx +2 -2
- package/docs-site/zh/explanation/hitl.mdx +3 -3
- 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 +9 -9
- 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 +1 -1
- package/docs-site/zh/reference/official-adapters.mdx +5 -5
- 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 +50 -44
- 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/plugins.mdx +14 -0
- package/docs-site/zh/tutorials/rerun-and-cache.mdx +3 -17
- 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 +27 -8
- package/docs-site/zh/tutorials/write-experiment.mdx +7 -5
- package/docs-site/zh/tutorials/write-send.mdx +2 -2
- package/package.json +9 -5
- package/dist/report/built-in/overview.cjs +0 -45
- 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
|
@@ -4,28 +4,28 @@ sidebarTitle: "Docker 与 DinD"
|
|
|
4
4
|
description: "根据任务信任边界选择 Docker socket、raw privileged DinD 或受管 rootless DinD,并为 Agent 准备 Docker CLI 与 daemon。"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
当评估任务要求 Agent执行 `docker build`、`docker run
|
|
7
|
+
当评估任务要求 Agent 执行 `docker build`、`docker run` 或 `docker compose` 时,先按任务的信任边界
|
|
8
8
|
选择 Docker access:
|
|
9
9
|
|
|
10
10
|
| 模式 | 什么时候用 | 启动成本 | 安全边界 |
|
|
11
11
|
| --- | --- | --- | --- |
|
|
12
|
-
| Docker socket | 可信 Agent、个人开发机、已有 daemon,优先启动速度 | 最低,共用已有 daemon | Agent拥有该 daemon的完整控制权。rootful socket通常等价宿主 root |
|
|
13
|
-
| Raw privileged DinD | 一次性 VM或专用 runner,需要独立 image、network和 cache | 每个 Sandbox启动 inner daemon | outer container是 raw privileged,不是安全隔离方案 |
|
|
14
|
-
| Managed rootless DinD | 不可信 Agent、共享宿主、并发评估、需要资源准入和强杀恢复 | 最高,需要宿主 profile | privileged限制在受管 rootless user namespace或专用 VM,并有 watchdog与容量契约 |
|
|
12
|
+
| Docker socket | 可信 Agent、个人开发机、已有 daemon,优先启动速度 | 最低,共用已有 daemon | Agent 拥有该 daemon 的完整控制权。rootful socket 通常等价宿主 root |
|
|
13
|
+
| Raw privileged DinD | 一次性 VM 或专用 runner,需要独立 image、network 和 cache | 每个 Sandbox 启动 inner daemon | outer container 是 raw privileged,不是安全隔离方案 |
|
|
14
|
+
| Managed rootless DinD | 不可信 Agent、共享宿主、并发评估、需要资源准入和强杀恢复 | 最高,需要宿主 profile | privileged 限制在受管 rootless user namespace 或专用 VM,并有 watchdog 与容量契约 |
|
|
15
15
|
|
|
16
|
-
三种模式都要求镜像预装 Docker CLI。两种 DinD模式只接受从官方
|
|
17
|
-
`docker:<version>-dind
|
|
18
|
-
但不需要自定义 NiceEval `ENTRYPOINT`。NiceEval负责启动与监督 inner daemon、
|
|
19
|
-
Sandbox保活、容器内 TTL和 `docker info
|
|
16
|
+
三种模式都要求镜像预装 Docker CLI。两种 DinD 模式只接受从官方
|
|
17
|
+
`docker:<version>-dind` 派生的兼容镜像。镜像需要 Docker daemon、Node 和评估工具,
|
|
18
|
+
但不需要自定义 NiceEval `ENTRYPOINT`。NiceEval 负责启动与监督 inner daemon、
|
|
19
|
+
Sandbox 保活、容器内 TTL 和 `docker info` 探活,不会向任意镜像动态安装 Docker。
|
|
20
20
|
|
|
21
|
-
不能直接把未经派生的 `docker:<version>-dind
|
|
22
|
-
需要的 Node,也没有被测 Agent的工具。创建时会以
|
|
23
|
-
`dind-image-incompatible: missing node
|
|
24
|
-
再让 `source
|
|
21
|
+
不能直接把未经派生的 `docker:<version>-dind` 写成 `source.image`。该镜像没有 NiceEval supervisor
|
|
22
|
+
需要的 Node,也没有被测 Agent 的工具。创建时会以
|
|
23
|
+
`dind-image-incompatible: missing node` 失败。请使用下面的 Dockerfile,或先发布等价的派生镜像,
|
|
24
|
+
再让 `source` 引用它。
|
|
25
25
|
|
|
26
26
|
## 方案一:直接挂 Docker socket
|
|
27
27
|
|
|
28
|
-
先准备只有 CLI、Node和评估工具的镜像:
|
|
28
|
+
先准备只有 CLI、Node 和评估工具的镜像:
|
|
29
29
|
|
|
30
30
|
```dockerfile title="sandbox/Dockerfile"
|
|
31
31
|
FROM docker:29-cli
|
|
@@ -35,7 +35,7 @@ RUN apk add --no-cache ca-certificates git nodejs npm python3 \
|
|
|
35
35
|
&& adduser -D -u 1000 -G node node
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
在 Experiment里显式填写宿主 Unix socket。NiceEval不会从进程环境或 Docker context猜这个路径:
|
|
38
|
+
在 Experiment 里显式填写宿主 Unix socket。NiceEval 不会从进程环境或 Docker context 猜这个路径:
|
|
39
39
|
|
|
40
40
|
```ts title="experiments/docker-socket.ts"
|
|
41
41
|
import { defineExperiment } from "niceeval";
|
|
@@ -59,22 +59,22 @@ export default defineExperiment({
|
|
|
59
59
|
});
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
NiceEval会解析 symlink、确认最终目标是 Unix socket,把它挂到 Sandbox内固定的
|
|
63
|
-
`/var/run/docker.sock`,并按 socket的数值 GID给 `node
|
|
64
|
-
镜像没有预设 Docker endpoint或 context,而且默认 `docker info
|
|
65
|
-
daemon。CLI缺失、用户无法访问 socket或镜像把默认 endpoint改到别处时,Sandbox创建失败。
|
|
62
|
+
NiceEval 会解析 symlink、确认最终目标是 Unix socket,把它挂到 Sandbox 内固定的
|
|
63
|
+
`/var/run/docker.sock`,并按 socket 的数值 GID 给 `node` 添加补充组。启动 Agent 前,NiceEval 会确认
|
|
64
|
+
镜像没有预设 Docker endpoint 或 context,而且默认 `docker info` 与显式访问这个 Unix socket 得到同一个
|
|
65
|
+
daemon。CLI 缺失、用户无法访问 socket 或镜像把默认 endpoint 改到别处时,Sandbox 创建失败。
|
|
66
66
|
|
|
67
|
-
这项检查只固定 Agent启动时的默认用法,不是安全边界。Agent之后仍可显式传 `docker --host
|
|
68
|
-
endpoint。不可信任务需要依赖 managed模式的网络策略,而不是依赖 Docker CLI的默认值。
|
|
67
|
+
这项检查只固定 Agent 启动时的默认用法,不是安全边界。Agent 之后仍可显式传 `docker --host` 访问另一个
|
|
68
|
+
endpoint。不可信任务需要依赖 managed 模式的网络策略,而不是依赖 Docker CLI 的默认值。
|
|
69
69
|
|
|
70
70
|
<Warning>
|
|
71
|
-
这不是隔离方案。Agent可以通过 socket创建 privileged容器、挂宿主目录,并操作同一 daemon上的
|
|
72
|
-
其它容器、image、volume和 network。不要给不可信 Agent挂 rootful宿主 socket。
|
|
71
|
+
这不是隔离方案。Agent 可以通过 socket 创建 privileged 容器、挂宿主目录,并操作同一 daemon 上的
|
|
72
|
+
其它容器、image、volume 和 network。不要给不可信 Agent 挂 rootful 宿主 socket。
|
|
73
73
|
</Warning>
|
|
74
74
|
|
|
75
75
|
## 方案二:Docker-in-Docker
|
|
76
76
|
|
|
77
|
-
DinD让每个外层 Sandbox拥有自己的 inner daemon。先创建镜像:
|
|
77
|
+
DinD 让每个外层 Sandbox 拥有自己的 inner daemon。先创建镜像:
|
|
78
78
|
|
|
79
79
|
```dockerfile title="sandbox/Dockerfile"
|
|
80
80
|
FROM docker:29-dind
|
|
@@ -85,7 +85,7 @@ RUN apk add --no-cache ca-certificates git nodejs npm python3 \
|
|
|
85
85
|
&& addgroup node docker
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
生产评估应把 `FROM
|
|
88
|
+
生产评估应把 `FROM` 钉到审核过的 digest,并把被测 Agent 需要的固定 CLI 烘焙进镜像。
|
|
89
89
|
|
|
90
90
|
### NiceEval 如何启动 DinD
|
|
91
91
|
|
|
@@ -111,15 +111,17 @@ Agent 仍以 `user: "node"` 运行。上面 Dockerfile 在构建期把 `node`
|
|
|
111
111
|
|
|
112
112
|
### 在 setup 中准备 Attempt 运行时
|
|
113
113
|
|
|
114
|
-
Dockerfile
|
|
115
|
-
`setup`,不要放进镜像 `ENTRYPOINT
|
|
116
|
-
workspace,并运行项目自己的 smoke check:
|
|
114
|
+
Dockerfile 只烘焙固定工具和项目初始文件。需要 inner daemon 的操作放进 Sandbox 级
|
|
115
|
+
`setup`,不要放进镜像 `ENTRYPOINT`。下面这个完整 setup 会创建可写 workspace 并验证 inner daemon;只有镜像确实烘焙了对应归档和文件时,才在这里加入 `docker load`、文件复制或项目 smoke-check 命令:
|
|
117
116
|
|
|
118
117
|
```ts title="lib/dind-sandbox.ts"
|
|
119
|
-
import {
|
|
118
|
+
import { dockerSandbox } from "niceeval/sandbox";
|
|
120
119
|
|
|
121
|
-
export const dindSandbox =
|
|
122
|
-
|
|
120
|
+
export const dindSandbox = dockerSandbox({
|
|
121
|
+
source: {
|
|
122
|
+
type: "dockerfile",
|
|
123
|
+
context: new URL("../sandbox/", import.meta.url),
|
|
124
|
+
},
|
|
123
125
|
user: "node",
|
|
124
126
|
dockerAccess: {
|
|
125
127
|
mode: "dind",
|
|
@@ -132,7 +134,11 @@ export const dindSandbox = dockerfileSandbox({
|
|
|
132
134
|
},
|
|
133
135
|
}).setup(async (sandbox, ctx) => {
|
|
134
136
|
ctx.progress({ message: "准备 inner Docker 运行时" });
|
|
135
|
-
const result = await sandbox.runCommand("
|
|
137
|
+
const result = await sandbox.runCommand("sh", ["-lc", [
|
|
138
|
+
"set -eu",
|
|
139
|
+
"mkdir -p /workspace",
|
|
140
|
+
"docker info >/dev/null",
|
|
141
|
+
].join("\n")], {
|
|
136
142
|
user: "root",
|
|
137
143
|
stream: true,
|
|
138
144
|
});
|
|
@@ -148,7 +154,7 @@ Attempt 在 `sandbox.create` 阶段记为 `errored`,不会把半成品 Sandbox
|
|
|
148
154
|
|
|
149
155
|
### Raw privileged DinD
|
|
150
156
|
|
|
151
|
-
在一次性 VM或专用 runner上,可以显式选择 raw privileged:
|
|
157
|
+
在一次性 VM 或专用 runner 上,可以显式选择 raw privileged:
|
|
152
158
|
|
|
153
159
|
```ts title="experiments/dind-raw.ts"
|
|
154
160
|
import { defineExperiment } from "niceeval";
|
|
@@ -172,15 +178,15 @@ export default defineExperiment({
|
|
|
172
178
|
});
|
|
173
179
|
```
|
|
174
180
|
|
|
175
|
-
必填的 `raw-privileged
|
|
181
|
+
必填的 `raw-privileged` 字面量是风险授权。NiceEval 不会把 raw 模式描述成 rootless,也不会在失败时
|
|
176
182
|
自动改用 managed profile。
|
|
177
183
|
|
|
178
184
|
### Managed rootless DinD
|
|
179
185
|
|
|
180
|
-
共享宿主或不可信 Agent使用 managed模式。它在 inner daemon之外增加 profile attestation、单容器
|
|
181
|
-
资源限制、跨进程容量准入、独占外层网络和 watchdog恢复:
|
|
186
|
+
共享宿主或不可信 Agent 使用 managed 模式。它在 inner daemon 之外增加 profile attestation、单容器
|
|
187
|
+
资源限制、跨进程容量准入、独占外层网络和 watchdog 恢复:
|
|
182
188
|
|
|
183
|
-
NixOS宿主先按照[在 NixOS上配置 Managed DinD](/zh/tutorials/nixos-managed-dind)部署并验证 profile,
|
|
189
|
+
NixOS 宿主先按照[在 NixOS 上配置 Managed DinD](/zh/tutorials/nixos-managed-dind)部署并验证 profile,
|
|
184
190
|
再配置下面的 Experiment。
|
|
185
191
|
|
|
186
192
|
```ts title="experiments/dind-managed.ts"
|
|
@@ -229,7 +235,7 @@ export default defineExperiment({
|
|
|
229
235
|
});
|
|
230
236
|
```
|
|
231
237
|
|
|
232
|
-
profile缺失、拼错、attestation失败或容量不足时,NiceEval会在模型调用前失败,绝不降级成 raw
|
|
238
|
+
profile 缺失、拼错、attestation 失败或容量不足时,NiceEval 会在模型调用前失败,绝不降级成 raw
|
|
233
239
|
privileged。宿主部署完成后先检查 profile:
|
|
234
240
|
|
|
235
241
|
```bash
|
|
@@ -238,9 +244,9 @@ npx niceeval docker profile doctor default --smoke
|
|
|
238
244
|
npx niceeval exp dind-managed
|
|
239
245
|
```
|
|
240
246
|
|
|
241
|
-
`doctor --smoke
|
|
242
|
-
`docker run --rm alpine:3.20 true`。它证明 profile支持 nested Docker,但不会检查项目自己的
|
|
243
|
-
Dockerfile。项目镜像仍由默认 `docker info` readiness验证。
|
|
247
|
+
`doctor --smoke` 会在该 profile 上启动一次 DinD 容器,并实际运行内层
|
|
248
|
+
`docker run --rm alpine:3.20 true`。它证明 profile 支持 nested Docker,但不会检查项目自己的
|
|
249
|
+
Dockerfile。项目镜像仍由默认 `docker info` readiness 验证。
|
|
244
250
|
|
|
245
251
|
### 为 DinD 设置运行并发
|
|
246
252
|
|
|
@@ -273,9 +279,9 @@ pnpm exec niceeval show @1ABC234DEF
|
|
|
273
279
|
| Docker access compatibility timeout | 从 `niceeval show` 给出的有界 `dockerd.log` 尾部检查 daemon 启动、socket 与 storage driver |
|
|
274
280
|
| 启动前提示 orphan Sandbox | 先用 `niceeval sandbox list --orphans` 只读核对,再显式运行 `niceeval sandbox prune` |
|
|
275
281
|
|
|
276
|
-
##
|
|
282
|
+
## 在评估用例里验证 Docker 任务
|
|
277
283
|
|
|
278
|
-
|
|
284
|
+
三种模式对评估用例暴露相同的 Docker CLI 用法:
|
|
279
285
|
|
|
280
286
|
```ts title="evals/docker-compose.eval.ts"
|
|
281
287
|
import { defineEval } from "niceeval";
|
|
@@ -294,5 +300,5 @@ export default defineEval({
|
|
|
294
300
|
});
|
|
295
301
|
```
|
|
296
302
|
|
|
297
|
-
|
|
298
|
-
`sandbox
|
|
303
|
+
Socket 模式的命令操作显式选择的外层 daemon。两种 DinD 模式操作 Sandbox 内的 inner daemon。
|
|
304
|
+
`sandbox` 也可以直接写在 `defineEval({ sandbox: ... })` 里。多条评估用例共用配置时写在 Experiment 上。
|
|
@@ -12,7 +12,7 @@ Sandbox,也不要为了复用而把整批任务都降成串行。`defineEvalGr
|
|
|
12
12
|
| 你会得到什么 | 运行行为 |
|
|
13
13
|
| --- | --- |
|
|
14
14
|
| 公共准备少付几次 | Sandbox 创建和组级 `setup()` 每个组内实例只执行一次 |
|
|
15
|
-
| 组内稳定串行 | Runner
|
|
15
|
+
| 组内稳定串行 | Runner 按规范化评估用例 ID 排序,同组同时只派发一条 Attempt |
|
|
16
16
|
| 组间保留吞吐 | 不同组和未分组评估用例可以并行 |
|
|
17
17
|
| 结果仍能单独比较 | 每条 Attempt 继续拥有自己的断言、判定、用量和文件改动 |
|
|
18
18
|
|
|
@@ -69,9 +69,9 @@ export default defineEvalGroup({
|
|
|
69
69
|
`tag` 或 `selector`。NiceEval 也不会自动收集同目录文件;成员增删和顺序变化都会明确出现在
|
|
70
70
|
`eval-group.ts` 的 diff 中。
|
|
71
71
|
|
|
72
|
-
`evals` 数组只声明成员,不声明业务顺序。Runner
|
|
72
|
+
`evals` 数组只声明成员,不声明业务顺序。Runner 始终按规范化评估用例 ID 稳定排序;只调整
|
|
73
73
|
数组位置不会改变调度行为或组指纹。需要“先构建、后查询”这类结果依赖时,把两个步骤放进
|
|
74
|
-
|
|
74
|
+
同一条评估用例。评估组的业务排序 API 还没有实现。
|
|
75
75
|
|
|
76
76
|
`onUnavailable` 是必填策略。`"stop-group"` 在物理 Sandbox 无法创建、重置或准备时停止
|
|
77
77
|
该组后续派发;`"replace-sandbox"` 会先退休当前实例,并让下一条 slot 尝试建立替代实例。
|
|
@@ -123,14 +123,14 @@ codex workflow/01-index [group workflow] new
|
|
|
123
123
|
codex workflow/02-query [group workflow] new
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
确认两条选中评估用例都显示相同的组 ID 后再运行:
|
|
127
127
|
|
|
128
128
|
```bash
|
|
129
129
|
npx niceeval exp codex
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
132
|
+
当前调度器按规范化评估用例 ID 排列成员;`attempts` 大于 1 时,同一成员的各次 Attempt 连续
|
|
133
|
+
进入组内泳道,再进入下一个成员。这只是稳定的调度规则,不是跨评估用例的数据依赖契约。
|
|
134
134
|
首过即停或结果沿用没有实际派发的槽位会直接跳过。
|
|
135
135
|
|
|
136
136
|
## 把公共准备放到评估组
|
|
@@ -28,7 +28,7 @@ Boolean `matched` 进入 Verdict;`mismatched` 使最终 Verdict 为 `failed`
|
|
|
28
28
|
|
|
29
29
|
## 连续质量线
|
|
30
30
|
|
|
31
|
-
`similarity(...)` 这类 Match 产生 `[0, 1]` 的 measurement
|
|
31
|
+
`similarity(...)` 这类 Match 产生 `[0, 1]` 的 measurement。它计算字符级 Levenshtein 编辑相似度,不判断语义。通过制评估用 `.gate(n)` 给它 hard 阈值:
|
|
32
32
|
|
|
33
33
|
```ts
|
|
34
34
|
t.check(turn.message, similarity(expected))
|
|
@@ -44,7 +44,7 @@ t.check(turn.message, similarity(expected))
|
|
|
44
44
|
|
|
45
45
|
```ts
|
|
46
46
|
import { defineScoreEval } from "niceeval";
|
|
47
|
-
import { commandSucceeded, includes
|
|
47
|
+
import { commandSucceeded, includes } from "niceeval/expect";
|
|
48
48
|
|
|
49
49
|
export default defineScoreEval({
|
|
50
50
|
description: "安装并启动 DB-GPT",
|
|
@@ -57,7 +57,7 @@ export default defineScoreEval({
|
|
|
57
57
|
t.check(health, commandSucceeded()).score(1).label("健康检查可达");
|
|
58
58
|
t.check(health.stdout, includes("ok")).score(1).label("健康检查内容正确");
|
|
59
59
|
|
|
60
|
-
t.check(turn.message,
|
|
60
|
+
t.check(turn.message, includes("验证")).score(2).label("回复说明验证方法");
|
|
61
61
|
|
|
62
62
|
t.score(1).label("代码精简");
|
|
63
63
|
},
|
|
@@ -84,11 +84,10 @@ pnpm exec niceeval view --experiment models
|
|
|
84
84
|
```ts
|
|
85
85
|
evals: (eval) =>
|
|
86
86
|
eval.id.startsWith("coding/") &&
|
|
87
|
-
eval.tags.includes("coding")
|
|
88
|
-
eval.environment !== "gpu"
|
|
87
|
+
eval.tags.includes("coding")
|
|
89
88
|
```
|
|
90
89
|
|
|
91
|
-
`eval.id` 是文件路径推导出的项目内 ID,不是绝对路径,可以直接用 `startsWith` / `includes` 判断。在[评估用例](/zh/tutorials/authoring#tags-与-
|
|
90
|
+
`eval.id` 是文件路径推导出的项目内 ID,不是绝对路径,可以直接用 `startsWith` / `includes` 判断。在[评估用例](/zh/tutorials/authoring#tags-与-sandbox)中,`coding/fix-button` 示例同时满足两个条件。解析结果形成本次运行计划。报告读取实际物理 Attempts 与覆盖事实。
|
|
92
91
|
|
|
93
92
|
## 设计 experiment 的建议
|
|
94
93
|
|
|
@@ -49,18 +49,26 @@ export default defineEval({
|
|
|
49
49
|
});
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
共享服务无法访问时,把检查写进真实评估用例的 `test(t)` callback。先把
|
|
53
|
+
`serviceHealthUrl` 换成服务的健康检查地址,再用 `ExperimentFatalError` 停止同一实验的剩余 Attempt:
|
|
53
54
|
|
|
54
55
|
```ts
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
// evals/coding/shared-service-health.eval.ts
|
|
57
|
+
import { defineEval, ExperimentFatalError } from "niceeval";
|
|
58
|
+
|
|
59
|
+
const serviceHealthUrl = "https://service.example.test/health";
|
|
60
|
+
|
|
61
|
+
export default defineEval({
|
|
62
|
+
async test(t) {
|
|
63
|
+
const health = await t.sandbox.runCommand("curl", ["-fsS", serviceHealthUrl]);
|
|
64
|
+
if (health.exitCode !== 0) {
|
|
65
|
+
throw new ExperimentFatalError(
|
|
66
|
+
"共享服务无法访问。请检查服务和隧道,然后重跑实验。",
|
|
67
|
+
{ cause: health.stderr },
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
});
|
|
64
72
|
```
|
|
65
73
|
|
|
66
74
|
错误消息会出现在终端和运行记录中。请写明发生了什么,以及下一步怎么修复。
|
|
@@ -13,10 +13,12 @@ Node.js CLI 可以使用 `createNpmCliInstaller`。下面的代码把 npm 包 `m
|
|
|
13
13
|
```ts
|
|
14
14
|
// agents/my-agent.ts
|
|
15
15
|
import {
|
|
16
|
-
completeEvidenceCoverage,
|
|
17
16
|
createNpmCliInstaller,
|
|
18
17
|
defineSandboxAgent,
|
|
19
|
-
|
|
18
|
+
agentBin,
|
|
19
|
+
responsesEvidenceCoverage,
|
|
20
|
+
turnFromResponses,
|
|
21
|
+
type ResponseLike,
|
|
20
22
|
} from "niceeval/adapter";
|
|
21
23
|
|
|
22
24
|
const { ensure, installer } = createNpmCliInstaller({
|
|
@@ -36,7 +38,7 @@ const { ensure, installer } = createNpmCliInstaller({
|
|
|
36
38
|
|
|
37
39
|
export default defineSandboxAgent({
|
|
38
40
|
name: "my-agent",
|
|
39
|
-
evidenceCoverage:
|
|
41
|
+
evidenceCoverage: responsesEvidenceCoverage,
|
|
40
42
|
ensure,
|
|
41
43
|
installers: [installer],
|
|
42
44
|
|
|
@@ -45,16 +47,22 @@ export default defineSandboxAgent({
|
|
|
45
47
|
},
|
|
46
48
|
|
|
47
49
|
async send(input, ctx) {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
+
const result = await ctx.sandbox.runCommand("sh", [
|
|
51
|
+
"-lc",
|
|
52
|
+
`exec ${agentBin("my-agent")} run --json "$1"`,
|
|
53
|
+
"my-agent",
|
|
54
|
+
input.text,
|
|
55
|
+
]);
|
|
50
56
|
if (result.exitCode !== 0) {
|
|
51
57
|
throw new Error(`my-agent 退出码 ${result.exitCode}: ${result.stderr}`);
|
|
52
58
|
}
|
|
53
|
-
return
|
|
59
|
+
return turnFromResponses(JSON.parse(result.stdout) as ResponseLike);
|
|
54
60
|
},
|
|
55
61
|
});
|
|
56
62
|
```
|
|
57
63
|
|
|
64
|
+
这个示例约定 `my-agent run --json` 输出一个 OpenAI Responses 兼容的 JSON 对象。`turnFromResponses` 会把其中的 `output` 项与 usage 转成 NiceEval 的 `Turn`;如果 CLI 输出的是另一套 schema,就把这一行替换成对 `events`、`status` 与 `usage` 的显式映射。
|
|
65
|
+
|
|
58
66
|
`identity.version` 是 CLI 的精确版本。同一版本的安装步骤变化时,同时更新 `identity.revision`。不要在这里使用 `latest`。
|
|
59
67
|
|
|
60
68
|
`setup` 只写鉴权和运行配置。CLI 安装由 `installer` 负责,因此每个 Attempt 都会先完成版本检查。
|
|
@@ -72,7 +80,7 @@ import myAgent from "../agents/my-agent.ts";
|
|
|
72
80
|
export default defineExperiment({
|
|
73
81
|
agent: myAgent,
|
|
74
82
|
model: "acme-model-v2",
|
|
75
|
-
sandbox: dockerSandbox({ source: { type: "image", image: "
|
|
83
|
+
sandbox: dockerSandbox({ source: { type: "image", image: "node:22-slim" } }),
|
|
76
84
|
});
|
|
77
85
|
```
|
|
78
86
|
|
|
@@ -80,7 +88,7 @@ export default defineExperiment({
|
|
|
80
88
|
npx niceeval exp my-agent fixtures/button
|
|
81
89
|
```
|
|
82
90
|
|
|
83
|
-
Sandbox
|
|
91
|
+
普通 npm 包要求 Sandbox 提供 Node.js 与 npm。`createNpmCliInstaller` 在宿主机打包、上传,再在 Sandbox 内执行 `npm install -g`。Sandbox 如果已有正确版本,NiceEval 会直接使用它。只有真正自包含的 `platformPackage` 才能省掉这项运行时前置条件。
|
|
84
92
|
|
|
85
93
|
## 检查安装失败
|
|
86
94
|
|
|
@@ -39,6 +39,15 @@ export const memory = definePlugin<MemoryOptions>({
|
|
|
39
39
|
teardown: (_sandbox, ctx) => ctx.progress({ message: "断开当前 Sandbox" }),
|
|
40
40
|
}),
|
|
41
41
|
});
|
|
42
|
+
|
|
43
|
+
export const telemetry = definePlugin({
|
|
44
|
+
name: "acme.telemetry",
|
|
45
|
+
behaviorRevision: "1",
|
|
46
|
+
experiment: () => ({
|
|
47
|
+
setup: (ctx) => ctx.progress({ message: "启动 telemetry 收集" }),
|
|
48
|
+
teardown: (ctx) => ctx.progress({ message: "停止 telemetry 收集" }),
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
42
51
|
```
|
|
43
52
|
|
|
44
53
|
`name` 命名 Plugin family。`instanceKey(options)` 区分同一 family 的不同配置。实现语义改变时提高 `behaviorRevision`,让旧结果不再被精确沿用。
|
|
@@ -50,6 +59,11 @@ export const memory = definePlugin<MemoryOptions>({
|
|
|
50
59
|
`plugins` 始终接收数组:
|
|
51
60
|
|
|
52
61
|
```ts
|
|
62
|
+
import { defineExperiment } from "niceeval";
|
|
63
|
+
import { codexAgent } from "niceeval/adapter";
|
|
64
|
+
import { dockerSandbox } from "niceeval/sandbox";
|
|
65
|
+
import { memory, telemetry } from "./shared/memory.ts";
|
|
66
|
+
|
|
53
67
|
export default defineExperiment({
|
|
54
68
|
agent: codexAgent({
|
|
55
69
|
skills: [{ kind: "local", path: ".agents/skills/memory" }],
|
|
@@ -62,29 +62,15 @@ npx niceeval exp checkout --rerun all
|
|
|
62
62
|
|
|
63
63
|
## 明确接受已有 Attempt
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
身份变化不一定表示历史结果已经失效,但 NiceEval 不会替操作者猜测。先从 dry run 或结果页取得完整 locator,核对候选 Attempt;确认它在新配置下仍然成立时,明确接受它:
|
|
66
66
|
|
|
67
67
|
```sh
|
|
68
68
|
npx niceeval accept @1K1P0VJAPVJ12
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
`accept`
|
|
71
|
+
`accept` 会发布一个新的采用 Run,不会修改原 Attempt。一次需要接受多个结果时,把全部 locator 放在同一条命令中;NiceEval 会先原子预检所有输入,避免只接受一半。
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
每次 `accept` 调用都会发布新 Run,不会修改或合并上一次调用。连续接受同一 Experiment 的多个 locator 后,`project-current` 会保留这些仍匹配的 Run occurrence。默认 Overview 会在有边框的 `Result coverage` 区域提示只有部分预期结果可用;这里的可用数是结果覆盖率,不是通过率或 score。
|
|
76
|
-
|
|
77
|
-
需要接受同一 Experiment 的多个结果时,把 locator 放进同一条命令:
|
|
78
|
-
|
|
79
|
-
```sh
|
|
80
|
-
npx niceeval accept @1K1P0VJAPVJ12 @1K1P0VJAPVJ13
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
同一次调用会为该 Experiment 发布一个 Run,并让两个目标 slot 都成为 `accepted`。需要核对某次接受的精确分母时,复制成功反馈中的 Run ID:
|
|
84
|
-
|
|
85
|
-
```sh
|
|
86
|
-
npx niceeval show --run <accepted-run-id>
|
|
87
|
-
```
|
|
73
|
+
候选 locator 的取得方式、审阅项目、原子预检和失败处理见[审阅并采用历史 Attempt](/zh/tutorials/accept-results)。
|
|
88
74
|
|
|
89
75
|
## 发布后不可修改
|
|
90
76
|
|
|
@@ -13,16 +13,16 @@ Sandbox agent 会在隔离环境中启动 coding-agent CLI,给它 workspace
|
|
|
13
13
|
运行 Anthropic Claude Code CLI,需要 `ANTHROPIC_API_KEY`。
|
|
14
14
|
</Card>
|
|
15
15
|
<Card title="codex" icon="terminal">
|
|
16
|
-
运行 OpenAI Codex CLI,需要 `
|
|
16
|
+
运行 OpenAI Codex CLI,需要 `OPENAI_API_KEY`。
|
|
17
17
|
</Card>
|
|
18
18
|
<Card title="bub" icon="robot">
|
|
19
|
-
运行 bub coding agent
|
|
19
|
+
运行 bub coding agent,需要 `OPENAI_API_KEY` 与 `OPENAI_BASE_URL`。
|
|
20
20
|
</Card>
|
|
21
21
|
</CardGroup>
|
|
22
22
|
|
|
23
23
|
## 运行内置 agent
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
在评估用例或 Experiment 上设置 `sandbox`,选择 [NiceEval](https://niceeval.com/) 在哪里创建隔离环境:
|
|
26
26
|
|
|
27
27
|
```ts
|
|
28
28
|
// experiments/local.ts
|
|
@@ -45,7 +45,7 @@ npx niceeval exp local fixtures/button --attempts 10
|
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
<Note>
|
|
48
|
-
没有对应的 CLI flag,也没有项目级默认 provider
|
|
48
|
+
没有对应的 CLI flag,也没有项目级默认 provider。评估用例与 Experiment 都没贡献 template-bearing layer 时,link planning 会在创建任何 Sandbox 前失败。
|
|
49
49
|
</Note>
|
|
50
50
|
|
|
51
51
|
云端跑 coding agent 时,可以直接使用 NiceEval 已发布的 E2B 公共模板,避免每个 Attempt 安装 CLI:
|
|
@@ -95,8 +95,10 @@ export default defineExperiment({
|
|
|
95
95
|
| Agent | 必需变量 |
|
|
96
96
|
|---|---|
|
|
97
97
|
| `claude-code` | `ANTHROPIC_API_KEY` |
|
|
98
|
-
| `codex` | `
|
|
99
|
-
| `bub` |
|
|
98
|
+
| `codex` | `OPENAI_API_KEY` |
|
|
99
|
+
| `bub` | `OPENAI_API_KEY`、`OPENAI_BASE_URL` |
|
|
100
|
+
|
|
101
|
+
省略工厂参数时,NiceEval 的 `bubAgent()` 与 `codexAgent()` 都读取这组 OpenAI-compatible 变量。旧的 `BUB_API_KEY`、`BUB_API_BASE`、`CODEX_API_KEY`、`CODEX_BASE_URL` 不再读取;运行 Experiment 前要完成改名。
|
|
100
102
|
|
|
101
103
|
## 工作流程
|
|
102
104
|
|
|
@@ -140,7 +142,7 @@ export default defineEval({
|
|
|
140
142
|
|
|
141
143
|
pattern 是 gitignore 风格,以 workdir 根为基准:不带 `/` 的匹配任意深度的同名项,带 `/` 的从 workdir 根匹配,末尾 `/` 表示目录。项目自己的 `.gitignore` 不参与判断,被项目忽略的文件照常记录。清单在第一次记账时冻结,agent 事后改 `.gitignore` 影响不了它。
|
|
142
144
|
|
|
143
|
-
单个 `t.send()`
|
|
145
|
+
单个 `t.send()` 窗口最多扫描 100,000 个路径和 256 MiB 去重文本。扫描结果中,File Changes 最多保留 10,000 条 change;候选更多时,它保存确定性前缀,并用 `collection-cap-reached` 把 collection 标为 `partial`。只有超过扫描上限才会报执行错误,不会伪装成「一个文件都没改」让文件断言假通过。异常大的 workspace 应用 `diff.include` 或 `diff.ignore` 收窄。
|
|
144
146
|
|
|
145
147
|
生命周期(`.setup()` / `.teardown()`)挂在 experiment `sandbox` 字段的 spec 上,用来做"按实验变化的环境准备"——装某个实验专属的二进制、预热、跨 attempt 载入和回存状态。它写下的文件属于环境,不会被算进 agent 产出的 diff。写法和规则见 [Sandbox provider · 生命周期](/zh/tutorials/sandbox-providers#生命周期)。
|
|
146
148
|
|
|
@@ -151,7 +153,7 @@ import {
|
|
|
151
153
|
completeEvidenceCoverage,
|
|
152
154
|
createNpmCliInstaller,
|
|
153
155
|
defineSandboxAgent,
|
|
154
|
-
|
|
156
|
+
agentBin,
|
|
155
157
|
} from "niceeval/adapter";
|
|
156
158
|
|
|
157
159
|
const { ensure, installer } = createNpmCliInstaller({
|
|
@@ -167,8 +169,12 @@ export default defineSandboxAgent({
|
|
|
167
169
|
installers: [installer],
|
|
168
170
|
async send(input, ctx) {
|
|
169
171
|
ctx.progress({ message: "运行 my-agent CLI" });
|
|
170
|
-
|
|
171
|
-
|
|
172
|
+
await ctx.sandbox.runCommand("sh", [
|
|
173
|
+
"-lc",
|
|
174
|
+
`exec ${agentBin("my-agent")} run "$1" --json-out agent-events.json`,
|
|
175
|
+
"my-agent",
|
|
176
|
+
input.text,
|
|
177
|
+
]);
|
|
172
178
|
const transcript = await ctx.sandbox.readText("agent-events.json");
|
|
173
179
|
if (transcript.trim() === "") {
|
|
174
180
|
ctx.diagnostic({
|
|
@@ -185,7 +191,7 @@ export default defineSandboxAgent({
|
|
|
185
191
|
});
|
|
186
192
|
```
|
|
187
193
|
|
|
188
|
-
`createNpmCliInstaller` 会在宿主机准备 npm
|
|
194
|
+
`createNpmCliInstaller` 会在宿主机准备 npm 包、送入 Sandbox,再用 npm 安装普通包。这类 Sandbox 需要 Node.js 与 npm;只有自包含的 `platformPackage` 才能省掉它们。完整步骤见[为自定义 Sandbox Agent 安装 CLI](/zh/tutorials/install-custom-sandbox-agent)。
|
|
189
195
|
|
|
190
196
|
`setup`、每次 `send` 和 `teardown` 都拿到各自作用域的反馈方法:
|
|
191
197
|
|
|
@@ -42,7 +42,7 @@ export default defineExperiment({
|
|
|
42
42
|
});
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
评估用例与 Experiment 都没声明 template-bearing layer 时,link planning 会在创建任何 Sandbox 前失败,而不会猜一个 provider。
|
|
46
46
|
|
|
47
47
|
三个内置 provider 的 SDK 不随 NiceEval 一起安装——用哪个就装哪个,避免把用不到的依赖(以及它们的原生构建脚本)带进你的项目:
|
|
48
48
|
|
|
@@ -70,11 +70,11 @@ sandbox: dockerComposeSandbox({
|
|
|
70
70
|
|
|
71
71
|
`workspaceService` 指定 Compose 文件里哪个 service 是主 Sandbox。Agent、`t.sandbox` 的命令与文件操作、`workdir`、变更 diff,全部只落在这一个容器上。Compose 文件里的其它 service(数据库、mock server 之类)是伴随资源,不经过 `Sandbox` 接口——不能对它们 `runCommand`、上传或读写文件,也看不到它们的 diff。要用到这些伴随 service,只能靠题目自己的网络访问,例如从 `client` 容器里用 Compose 内置 DNS 访问 `db:5432`。
|
|
72
72
|
|
|
73
|
-
### 让 Agent自己运行 Docker
|
|
73
|
+
### 让 Agent 自己运行 Docker
|
|
74
74
|
|
|
75
|
-
如果 Agent需要执行 `docker build`、`docker run
|
|
76
|
-
也可以选择 raw privileged或 managed rootless Docker-in-Docker。三种模式的适用场景、Dockerfile和
|
|
77
|
-
完整配置见[让 Sandbox使用 Docker](/zh/tutorials/docker-in-docker)。
|
|
75
|
+
如果 Agent 需要执行 `docker build`、`docker run` 或 `docker compose`,可以显式挂已有 Unix socket,
|
|
76
|
+
也可以选择 raw privileged 或 managed rootless Docker-in-Docker。三种模式的适用场景、Dockerfile 和
|
|
77
|
+
完整配置见[让 Sandbox 使用 Docker](/zh/tutorials/docker-in-docker)。
|
|
78
78
|
|
|
79
79
|
## 生命周期
|
|
80
80
|
|
|
@@ -88,7 +88,7 @@ sandbox: dockerComposeSandbox({
|
|
|
88
88
|
import type { SandboxHook, SandboxHookContext } from "niceeval/sandbox";
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
稳定且体积大的依赖不要在这里重复安装。系统包、Agent CLI、编译好的二进制和大模型缓存应该先做进 Docker image、Vercel
|
|
91
|
+
稳定且体积大的依赖不要在这里重复安装。系统包、Agent CLI、编译好的二进制和大模型缓存应该先做进 Docker image、Vercel Sandbox 快照或 E2B template。每个 Attempt 从预制环境启动,`.setup()` 只做薄薄的一层动态配置和 fail-fast 检查。
|
|
92
92
|
|
|
93
93
|
```ts
|
|
94
94
|
export default defineExperiment({
|
|
@@ -97,6 +97,7 @@ export default defineExperiment({
|
|
|
97
97
|
.setup(mempalSetup("codex")) // 预检、写 hook、载入状态
|
|
98
98
|
.teardown(mempalTeardown("codex")), // 回存状态
|
|
99
99
|
maxConcurrency: 1, // 载入和回存之间不能并发,声明串行
|
|
100
|
+
sharedState: { key: "mempal/codex/cohort-a" },
|
|
100
101
|
});
|
|
101
102
|
```
|
|
102
103
|
|
|
@@ -176,17 +177,19 @@ vercelSandbox({ snapshotId: "snap_abc123" })
|
|
|
176
177
|
e2bSandbox({ template: "my-evals" })
|
|
177
178
|
```
|
|
178
179
|
|
|
179
|
-
Docker image、Vercel
|
|
180
|
+
Docker image、Vercel Sandbox 快照和 E2B template 的凭据、构建上下文、发布和过期方式不同。项目应使用 provider 的官方工具维护构建脚本,把最终 ID 或名字放进 experiment。适合预制的判断很简单:如果所有 Attempt 都要下载或安装同一份内容,而且它稳定、昂贵或体积大,就把它移到预制环境。
|
|
180
181
|
|
|
181
182
|
### 从官方基线继续构建以提速
|
|
182
183
|
|
|
183
184
|
稳定、体积大、每个 Attempt 都相同的内容——系统包、Agent CLI、编译好的二进制、大模型缓存——应在跑评估用例之前烘焙进 provider 的可发布构建输出,让每个 Attempt 从预制环境启动、跳过运行时安装。三个内置 provider 都能从官方基线继续派生,不必从空白环境装 Agent。但它们的构建工具、凭据和发布语义不同,NiceEval 只统一**消费**产物 ID(`image` / `snapshotId` / `template`),不伪造跨 provider 的构建 DSL。
|
|
184
185
|
|
|
185
|
-
Adapter 与 Sandbox 不互相猜配置:Adapter 负责检查所需 CLI,Sandbox spec 负责选择 provider 和构建输出。Claude Code 与 Codex 缺少 CLI 时会回退到运行时安装(构建输出在题面网络之外准备,经文件 API 送入),所以烘焙纯粹是提速。Codex 送进去的是该平台自带运行时的原生包,任务镜像不带 Node 也能装,Claude Code 仍要求镜像里有 npm。
|
|
186
|
+
Adapter 与 Sandbox 不互相猜配置:Adapter 负责检查所需 CLI,Sandbox spec 负责选择 provider 和构建输出。Claude Code 与 Codex 缺少 CLI 时会回退到运行时安装(构建输出在题面网络之外准备,经文件 API 送入),所以烘焙纯粹是提速。Codex 送进去的是该平台自带运行时的原生包,任务镜像不带 Node 也能装,Claude Code 仍要求镜像里有 npm。
|
|
187
|
+
|
|
188
|
+
默认 Bub 0.4.0 配方除 OTel 插件外,还固定 `any-llm-sdk==1.17.0` 和 `openai==2.31.0`。安装指纹同时覆盖 Bub requirement、这两个 client override、OTel 插件和规范化后的 Python 插件集,不能仅凭 `command -v bub` 跳过安装。旧 marker 的预制环境会重装一次;显式选择其它 Bub 版本时,传递依赖闭包仍由调用方负责。三个 provider 的构建都只在环境依赖变化时跑一次,产物换一个版本化名字,不要写入每个 Attempt 的 `.setup()`。
|
|
186
189
|
|
|
187
190
|
#### E2B:从官方与公共模板派生
|
|
188
191
|
|
|
189
|
-
E2B 已提供 Claude Code 的 `claude` template 和 Codex 的 `codex` template。NiceEval 提供一个 E2B 专属的薄封装,让你从这两个官方起点继续链原生 E2B API。E2B 暂无 Bub 官方 template
|
|
192
|
+
E2B 已提供 Claude Code 的 `claude` template 和 Codex 的 `codex` template。NiceEval 提供一个 E2B 专属的薄封装,让你从这两个官方起点继续链原生 E2B API。E2B 暂无 Bub 官方 template,因此默认 Bub 分支与 `bubAgent()` 使用同一份完整 client 闭包和 OTel 插件:
|
|
190
193
|
|
|
191
194
|
NiceEval 同时发布了三份任何 E2B Team 都能引用的公共模板。完整 namespace 与版本由 NiceEval 自己维护,
|
|
192
195
|
下游直接取完整引用:
|
|
@@ -203,7 +206,7 @@ e2bSandbox({ template: NICEEVAL_CODEX_E2B_TEMPLATE })
|
|
|
203
206
|
e2bSandbox({ template: NICEEVAL_BUB_E2B_TEMPLATE })
|
|
204
207
|
```
|
|
205
208
|
|
|
206
|
-
这些基线都实际启动验证过:Claude Code `2.1.207`、Codex `0.144.1`、Bub `0.4.0
|
|
209
|
+
这些基线都实际启动验证过:Claude Code `2.1.207`、Codex `0.144.1`、Bub `0.4.0`(安装指纹随 Bub requirement、client override、OTel 插件和 Python 插件 pin 一起变)。模板的版本号跟着它装的那个 Agent 走(形如 `0.144.1-r1`:Agent 版本 + NiceEval 配方修订号),三个 Agent 各自独立发版,NiceEval 库自己的版本不参与命名。所以业务仓库直接用常量,不复制这些字符串、也不跟踪版本。派生模板需要记录 base 身份时,同样用常量的值。
|
|
207
210
|
|
|
208
211
|
当前这批公共模板中,Claude Code 模板沿用 E2B 官方 `/usr` npm prefix,普通用户不能直接写全局模块。需要在运行时追加 pnpm、yarn 等全局 Node 工具时,显式把它们装到两个模板都已加入 PATH 的 `/usr/local`:
|
|
209
212
|
|
|
@@ -315,7 +318,7 @@ Docker Sandbox 沿用镜像自己声明的执行身份:上面这份 Dockerfile
|
|
|
315
318
|
|
|
316
319
|
#### Vercel:从官方 runtime 拍快照
|
|
317
320
|
|
|
318
|
-
Vercel 没有 E2B 式的 template registry,也没有 Dockerfile
|
|
321
|
+
Vercel 没有 E2B 式的 template registry,也没有 Dockerfile。Sandbox 快照是从一台跑起来的 microVM 拍出来的。用 Vercel SDK 从官方 runtime(`node24`)起一台 Sandbox,装好 Agent CLI,调 `.snapshot()` 拿到 `snap_...`,再把它交给 `vercelSandbox({ snapshotId })`:
|
|
319
322
|
|
|
320
323
|
```ts title="scripts/build-vercel-snapshot.ts"
|
|
321
324
|
import { Sandbox } from "@vercel/sandbox";
|
|
@@ -359,7 +362,8 @@ await restoreCheckpoint(nextSandbox, data);
|
|
|
359
362
|
这适合运行时缓存,不会创建可发布的 image/template/snapshot,也不管理共享、版本和过期。归档或恢复失败会直接抛错。
|
|
360
363
|
|
|
361
364
|
如果这些目录或快照要跨 Attempt 延续,把 `restoreCheckpoint()` 放进 `SandboxLayer.setup()`,把 `createCheckpoint()` 放进配对的 `teardown()`。`setup()` 在实际 Sandbox 创建后恢复,因此新 run 也走同一边界。`teardown()` 在实例退休、Provider finalizer 前回存。
|
|
362
|
-
|
|
365
|
+
|
|
366
|
+
`sandboxReuse: true` 只让同一个物理实例在本 Invocation 内继续存在。多个 Invocation 会读写同一 checkpoint 时,在 Experiment 顶层声明 `sharedState: { key }`。NiceEval 在 Experiment setup 或创建 Sandbox 前取得租约,等 checkpoint 回存、Provider finalizer 与 Experiment teardown 完成后释放。它只提供互斥,不负责 checkpoint 存储、事务恢复或跨机器协调。
|
|
363
367
|
|
|
364
368
|
## 瞬时错误重试
|
|
365
369
|
|
|
@@ -405,7 +409,7 @@ NiceEval 只观察、不还原:Agent 改了什么会真实落在你的工作
|
|
|
405
409
|
|
|
406
410
|
## 自定义 Provider
|
|
407
411
|
|
|
408
|
-
用 `defineSandbox` 接入其它服务。`create` 的 `feedback` 已绑定到 `sandbox.create`
|
|
412
|
+
用 `defineSandbox` 接入其它服务。`create` 的 `feedback` 已绑定到 `sandbox.create` 阶段,可以报告分配实例、拉镜像或恢复 Sandbox 快照的状态:
|
|
409
413
|
|
|
410
414
|
```ts
|
|
411
415
|
import { defineSandbox } from "niceeval/sandbox";
|