niceeval 0.15.1-canary.76 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INDEX.md +45 -40
- package/dist/adapter-execution-trace.cjs.map +1 -1
- package/dist/adapter-execution-trace.d.cts +26 -0
- package/dist/adapter-execution-trace.d.mts +26 -0
- package/dist/adapter-execution-trace.d.ts +26 -0
- package/dist/adapter-usage.cjs.map +1 -1
- package/dist/adapter-usage.d.cts +9 -0
- package/dist/adapter-usage.d.mts +9 -0
- package/dist/adapter-usage.d.ts +9 -0
- package/dist/adapter.cjs +19 -4
- package/dist/adapter.cjs.map +1 -1
- package/dist/adapter.d.cts +37 -12
- package/dist/adapter.d.mts +37 -12
- package/dist/adapter.d.ts +37 -12
- package/dist/agents/ai-sdk.cjs +3 -0
- package/dist/agents/ai-sdk.cjs.map +1 -1
- package/dist/agents/bub.cjs +3 -0
- package/dist/agents/bub.cjs.map +1 -1
- package/dist/agents/claude-code-native.cjs +28 -2
- package/dist/agents/claude-code-native.cjs.map +1 -1
- package/dist/agents/claude-code.cjs +3 -0
- package/dist/agents/claude-code.cjs.map +1 -1
- package/dist/agents/codex.cjs +3 -0
- package/dist/agents/codex.cjs.map +1 -1
- package/dist/agents/coding-cli-versions.cjs +9 -10
- package/dist/agents/coding-cli-versions.cjs.map +1 -1
- package/dist/agents/coding-cli-versions.d.cts +1 -1
- package/dist/agents/coding-cli-versions.d.mts +1 -1
- package/dist/agents/coding-cli-versions.d.ts +1 -1
- package/dist/agents/deepseek-harness.cjs +3 -0
- package/dist/agents/deepseek-harness.cjs.map +1 -1
- package/dist/agents/hermes.cjs +3 -0
- package/dist/agents/hermes.cjs.map +1 -1
- package/dist/agents/index.cjs.map +1 -1
- package/dist/agents/index.d.cts +3 -2
- package/dist/agents/index.d.mts +3 -2
- package/dist/agents/index.d.ts +3 -2
- package/dist/agents/omp.cjs +3 -0
- package/dist/agents/omp.cjs.map +1 -1
- package/dist/agents/openai-compat.cjs +6 -0
- package/dist/agents/openai-compat.cjs.map +1 -1
- package/dist/agents/openclaw.cjs +3 -0
- package/dist/agents/openclaw.cjs.map +1 -1
- package/dist/agents/opencode.cjs +3 -0
- package/dist/agents/opencode.cjs.map +1 -1
- package/dist/agents/sdk-streams.cjs +9 -0
- package/dist/agents/sdk-streams.cjs.map +1 -1
- package/dist/agents/ui-message-stream.cjs +3 -0
- package/dist/agents/ui-message-stream.cjs.map +1 -1
- package/dist/assertions/api.cjs.map +1 -1
- package/dist/assertions/api.d.cts +27 -5
- package/dist/assertions/api.d.mts +27 -5
- package/dist/assertions/api.d.ts +27 -5
- package/dist/assertions/collection.cjs +6 -0
- package/dist/assertions/collection.cjs.map +1 -1
- package/dist/assertions/collection.d.cts +4 -2
- package/dist/assertions/collection.d.mts +4 -2
- package/dist/assertions/collection.d.ts +4 -2
- package/dist/assertions/collection.js +12 -8
- package/dist/assertions/context-match.cjs +70 -0
- package/dist/assertions/context-match.cjs.map +1 -0
- package/dist/assertions/context-match.d.cts +107 -0
- package/dist/assertions/context-match.d.mts +107 -0
- package/dist/assertions/context-match.d.ts +107 -0
- package/dist/assertions/context-match.js +12 -0
- package/dist/assertions/context-match.js.map +1 -0
- package/dist/assertions/full-content.cjs +109 -0
- package/dist/assertions/full-content.cjs.map +1 -0
- package/dist/assertions/full-content.d.cts +6 -0
- package/dist/assertions/full-content.d.mts +6 -0
- package/dist/assertions/full-content.d.ts +6 -0
- package/dist/assertions/full-content.js +12 -0
- package/dist/assertions/full-content.js.map +1 -0
- package/dist/assertions/judge-presets.cjs +2 -34
- package/dist/assertions/judge-presets.cjs.map +1 -1
- package/dist/assertions/judge-presets.d.cts +6 -9
- package/dist/assertions/judge-presets.d.mts +6 -9
- package/dist/assertions/judge-presets.d.ts +6 -9
- package/dist/assertions/judge-presets.js +8 -8
- package/dist/assertions/judge.cjs +107 -29
- package/dist/assertions/judge.cjs.map +1 -1
- package/dist/assertions/judge.d.cts +2 -0
- package/dist/assertions/judge.d.mts +2 -0
- package/dist/assertions/judge.d.ts +2 -0
- package/dist/assertions/match.cjs +244 -5
- package/dist/assertions/match.cjs.map +1 -1
- package/dist/assertions/match.d.cts +43 -3
- package/dist/assertions/match.d.mts +43 -3
- package/dist/assertions/match.d.ts +43 -3
- package/dist/assertions/match.js +88 -78
- package/dist/assertions/material.cjs +520 -0
- package/dist/assertions/material.cjs.map +1 -0
- package/dist/assertions/material.d.cts +56 -0
- package/dist/assertions/material.d.mts +56 -0
- package/dist/assertions/material.d.ts +56 -0
- package/dist/assertions/material.js +20 -0
- package/dist/assertions/material.js.map +1 -0
- package/dist/assertions/record/attachment.cjs +5 -2
- package/dist/assertions/record/attachment.cjs.map +1 -1
- package/dist/assertions/record/codec.cjs +2 -1
- package/dist/assertions/record/codec.cjs.map +1 -1
- package/dist/assertions/record/model.cjs.map +1 -1
- package/dist/assertions/record/model.d.cts +6 -1
- package/dist/assertions/record/model.d.mts +6 -1
- package/dist/assertions/record/model.d.ts +6 -1
- package/dist/assertions/runtime.cjs +207 -14
- package/dist/assertions/runtime.cjs.map +1 -1
- package/dist/assertions/runtime.d.cts +9 -0
- package/dist/assertions/runtime.d.mts +9 -0
- package/dist/assertions/runtime.d.ts +9 -0
- package/dist/assertions/runtime.js +14 -8
- package/dist/assertions/score-match-audit.cjs +18 -8
- package/dist/assertions/score-match-audit.cjs.map +1 -1
- package/dist/assertions/score-match-gateway.cjs +83 -25
- package/dist/assertions/score-match-gateway.cjs.map +1 -1
- package/dist/assertions/score-match-gateway.d.cts +2 -0
- package/dist/assertions/score-match-gateway.d.mts +2 -0
- package/dist/assertions/score-match-gateway.d.ts +2 -0
- package/dist/assertions/value-composition.test-d.cjs +77 -0
- package/dist/assertions/value-composition.test-d.cjs.map +1 -0
- package/dist/assertions/value-composition.test-d.d.cts +1 -0
- package/dist/assertions/value-composition.test-d.d.mts +1 -0
- package/dist/assertions/value-composition.test-d.d.ts +1 -0
- package/dist/assertions/value-composition.test-d.js +4 -0
- package/dist/assertions/value-composition.test-d.js.map +1 -0
- package/dist/context/assert-first.cjs +207 -213
- package/dist/context/assert-first.cjs.map +1 -1
- package/dist/context/assert-first.d.cts +49 -23
- package/dist/context/assert-first.d.mts +49 -23
- package/dist/context/assert-first.d.ts +49 -23
- package/dist/context/session.cjs +111 -9
- package/dist/context/session.cjs.map +1 -1
- package/dist/context/session.d.cts +18 -0
- package/dist/context/session.d.mts +18 -0
- package/dist/context/session.d.ts +18 -0
- package/dist/define.cjs +17 -1
- package/dist/define.cjs.map +1 -1
- package/dist/eval/cli/contribution.cjs +2 -0
- package/dist/eval/cli/contribution.cjs.map +1 -1
- package/dist/eval/host/index.cjs +2 -0
- package/dist/eval/host/index.cjs.map +1 -1
- package/dist/eval/record/evaluation.cjs +3 -0
- package/dist/eval/record/evaluation.cjs.map +1 -1
- package/dist/eval/record/membership-provenance.d.cts +15 -15
- package/dist/eval/record/membership-provenance.d.mts +15 -15
- package/dist/eval/record/membership-provenance.d.ts +15 -15
- package/dist/eval/record/score.cjs +7 -0
- package/dist/eval/record/score.cjs.map +1 -1
- package/dist/eval/record/sealed-assertion.cjs +3 -0
- package/dist/eval/record/sealed-assertion.cjs.map +1 -1
- package/dist/eval/record/verdict.cjs +7 -0
- package/dist/eval/record/verdict.cjs.map +1 -1
- package/dist/expect/index.cjs +8 -2
- package/dist/expect/index.cjs.map +1 -1
- package/dist/expect/index.d.cts +9 -4
- package/dist/expect/index.d.mts +9 -4
- package/dist/expect/index.d.ts +9 -4
- package/dist/expect/index.js +72 -62
- package/dist/expect/index.mjs +72 -62
- package/dist/experiment/host/cli/contribution.cjs +37 -23
- package/dist/experiment/host/cli/contribution.cjs.map +1 -1
- package/dist/experiment/host/cli/contribution.d.cts +9 -1
- package/dist/experiment/host/cli/contribution.d.mts +9 -1
- package/dist/experiment/host/cli/contribution.d.ts +9 -1
- package/dist/experiment/host/current.cjs +74 -0
- package/dist/experiment/host/current.cjs.map +1 -0
- package/dist/experiment/host/current.d.cts +33 -0
- package/dist/experiment/host/current.d.mts +33 -0
- package/dist/experiment/host/current.d.ts +33 -0
- package/dist/experiment/host/current.js +10 -0
- package/dist/experiment/host/current.js.map +1 -0
- package/dist/experiment/host/index.cjs +17 -174
- package/dist/experiment/host/index.cjs.map +1 -1
- package/dist/experiment/host/index.d.cts +8 -54
- package/dist/experiment/host/index.d.mts +8 -54
- package/dist/experiment/host/index.d.ts +8 -54
- package/dist/experiment/host/operations.cjs +33 -10
- package/dist/experiment/host/operations.cjs.map +1 -1
- package/dist/experiment/host/operations.d.cts +29 -1
- package/dist/experiment/host/operations.d.mts +29 -1
- package/dist/experiment/host/operations.d.ts +29 -1
- package/dist/experiment/host/operations.js +6 -4
- package/dist/experiment/host/requirements.cjs +3 -0
- package/dist/experiment/host/requirements.cjs.map +1 -0
- package/dist/experiment/host/requirements.d.cts +3 -0
- package/dist/experiment/host/requirements.d.mts +3 -0
- package/dist/experiment/host/requirements.d.ts +3 -0
- package/dist/experiment/host/requirements.js +4 -0
- package/dist/experiment/host/requirements.js.map +1 -0
- package/dist/experiment/host/runtime.cjs +179 -0
- package/dist/experiment/host/runtime.cjs.map +1 -0
- package/dist/experiment/host/runtime.d.cts +79 -0
- package/dist/experiment/host/runtime.d.mts +79 -0
- package/dist/experiment/host/runtime.d.ts +79 -0
- package/dist/experiment/host/runtime.js +6 -0
- package/dist/experiment/host/runtime.js.map +1 -0
- package/dist/experiment/host/types.cjs.map +1 -1
- package/dist/experiment/host/types.d.cts +17 -16
- package/dist/experiment/host/types.d.mts +17 -16
- package/dist/experiment/host/types.d.ts +17 -16
- package/dist/fresh-import.cjs +2 -1
- package/dist/fresh-import.cjs.map +1 -1
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -6
- package/dist/index.d.mts +12 -6
- package/dist/index.d.ts +12 -6
- package/dist/index.js +32 -30
- package/dist/index.mjs +32 -30
- package/dist/inspection/artifacts.cjs +83 -54
- package/dist/inspection/artifacts.cjs.map +1 -1
- package/dist/inspection/artifacts.d.cts +8 -0
- package/dist/inspection/artifacts.d.mts +8 -0
- package/dist/inspection/artifacts.d.ts +8 -0
- package/dist/inspection/artifacts.js +2 -0
- package/dist/inspection/assertions.cjs +4 -1
- package/dist/inspection/assertions.cjs.map +1 -1
- package/dist/inspection/cli/contribution.cjs +27 -4
- package/dist/inspection/cli/contribution.cjs.map +1 -1
- package/dist/inspection/cli/contribution.d.cts +2 -1
- package/dist/inspection/cli/contribution.d.mts +2 -1
- package/dist/inspection/cli/contribution.d.ts +2 -1
- package/dist/inspection/execution-traces.cjs +114 -8
- package/dist/inspection/execution-traces.cjs.map +1 -1
- package/dist/inspection/execution-traces.d.cts +38 -0
- package/dist/inspection/execution-traces.d.mts +38 -0
- package/dist/inspection/execution-traces.d.ts +38 -0
- package/dist/inspection/facts.cjs +12 -0
- package/dist/inspection/facts.cjs.map +1 -1
- package/dist/inspection/limits.cjs +5 -1
- package/dist/inspection/limits.cjs.map +1 -1
- package/dist/inspection/limits.d.cts +4 -0
- package/dist/inspection/limits.d.mts +4 -0
- package/dist/inspection/limits.d.ts +4 -0
- package/dist/inspection/limits.js +6 -2
- package/dist/inspection/overview.cjs +74 -33
- package/dist/inspection/overview.cjs.map +1 -1
- package/dist/inspection/overview.d.cts +19 -1
- package/dist/inspection/overview.d.mts +19 -1
- package/dist/inspection/overview.d.ts +19 -1
- package/dist/inspection/overview.js +4 -2
- package/dist/inspection/project-input.cjs +9 -0
- package/dist/inspection/project-input.cjs.map +1 -0
- package/dist/inspection/project-input.d.cts +20 -0
- package/dist/inspection/project-input.d.mts +20 -0
- package/dist/inspection/project-input.d.ts +20 -0
- package/dist/inspection/project-input.js +8 -0
- package/dist/inspection/project-input.js.map +1 -0
- package/dist/inspection/project-result.cjs +60 -0
- package/dist/inspection/project-result.cjs.map +1 -0
- package/dist/inspection/project-result.d.cts +1264 -0
- package/dist/inspection/project-result.d.mts +1264 -0
- package/dist/inspection/project-result.d.ts +1264 -0
- package/dist/inspection/project-result.js +10 -0
- package/dist/inspection/project-result.js.map +1 -0
- package/dist/inspection/project-source.cjs +109 -0
- package/dist/inspection/project-source.cjs.map +1 -0
- package/dist/inspection/project-source.d.cts +10 -0
- package/dist/inspection/project-source.d.mts +10 -0
- package/dist/inspection/project-source.d.ts +10 -0
- package/dist/inspection/project-source.js +6 -0
- package/dist/inspection/project-source.js.map +1 -0
- package/dist/inspection/project.cjs +100 -0
- package/dist/inspection/project.cjs.map +1 -0
- package/dist/inspection/project.d.cts +3 -0
- package/dist/inspection/project.d.mts +3 -0
- package/dist/inspection/project.d.ts +3 -0
- package/dist/inspection/project.js +6 -0
- package/dist/inspection/project.js.map +1 -0
- package/dist/inspection/protocol.cjs +19 -9
- package/dist/inspection/protocol.cjs.map +1 -1
- package/dist/inspection/protocol.d.cts +5506 -38189
- package/dist/inspection/protocol.d.mts +5506 -38189
- package/dist/inspection/protocol.d.ts +5506 -38189
- package/dist/inspection/public.mjs +896 -84
- package/dist/inspection/query.cjs +2 -0
- package/dist/inspection/query.cjs.map +1 -1
- package/dist/inspection/results.cjs +234 -29
- package/dist/inspection/results.cjs.map +1 -1
- package/dist/inspection/results.d.cts +870 -13
- package/dist/inspection/results.d.mts +870 -13
- package/dist/inspection/results.d.ts +870 -13
- package/dist/inspection/results.js +36 -34
- package/dist/inspection/select.cjs +126 -14
- package/dist/inspection/select.cjs.map +1 -1
- package/dist/inspection/select.d.cts +1 -1
- package/dist/inspection/select.d.mts +1 -1
- package/dist/inspection/select.d.ts +1 -1
- package/dist/inspection/source.cjs +4 -0
- package/dist/inspection/source.cjs.map +1 -1
- package/dist/inspection/sources.cjs +5 -0
- package/dist/inspection/sources.cjs.map +1 -1
- package/dist/inspection/trace.cjs +82 -84
- package/dist/inspection/trace.cjs.map +1 -1
- package/dist/inspection/trace.d.cts +7 -2
- package/dist/inspection/trace.d.mts +7 -2
- package/dist/inspection/trace.d.ts +7 -2
- package/dist/model-slots.cjs +35 -0
- package/dist/model-slots.cjs.map +1 -0
- package/dist/model-slots.d.cts +19 -0
- package/dist/model-slots.d.mts +19 -0
- package/dist/model-slots.d.ts +19 -0
- package/dist/model-slots.js +8 -0
- package/dist/model-slots.js.map +1 -0
- package/dist/o11y/adapter-call-price.cjs +4 -0
- package/dist/o11y/adapter-call-price.cjs.map +1 -1
- package/dist/o11y/adapter-call-price.d.cts +24 -0
- package/dist/o11y/adapter-call-price.d.mts +24 -0
- package/dist/o11y/adapter-call-price.d.ts +24 -0
- package/dist/o11y/adapter-call-price.js +6 -2
- package/dist/o11y/adapter-usage-projection.cjs +158 -0
- package/dist/o11y/adapter-usage-projection.cjs.map +1 -0
- package/dist/o11y/adapter-usage-projection.d.cts +141 -0
- package/dist/o11y/adapter-usage-projection.d.mts +141 -0
- package/dist/o11y/adapter-usage-projection.d.ts +141 -0
- package/dist/o11y/adapter-usage-projection.js +20 -0
- package/dist/o11y/adapter-usage-projection.js.map +1 -0
- package/dist/o11y/eval-usage.cjs +149 -0
- package/dist/o11y/eval-usage.cjs.map +1 -0
- package/dist/o11y/eval-usage.d.cts +46 -0
- package/dist/o11y/eval-usage.d.mts +46 -0
- package/dist/o11y/eval-usage.d.ts +46 -0
- package/dist/o11y/eval-usage.js +8 -0
- package/dist/o11y/eval-usage.js.map +1 -0
- package/dist/o11y/judge-call-price.cjs +62 -0
- package/dist/o11y/judge-call-price.cjs.map +1 -0
- package/dist/o11y/judge-call-price.d.cts +3 -0
- package/dist/o11y/judge-call-price.d.mts +3 -0
- package/dist/o11y/judge-call-price.d.ts +3 -0
- package/dist/o11y/judge-call-price.js +6 -0
- package/dist/o11y/judge-call-price.js.map +1 -0
- package/dist/o11y/judge-usage-projection.cjs +134 -0
- package/dist/o11y/judge-usage-projection.cjs.map +1 -0
- package/dist/o11y/judge-usage-projection.d.cts +18 -0
- package/dist/o11y/judge-usage-projection.d.mts +18 -0
- package/dist/o11y/judge-usage-projection.d.ts +18 -0
- package/dist/o11y/judge-usage-projection.js +20 -0
- package/dist/o11y/judge-usage-projection.js.map +1 -0
- package/dist/o11y/judge-usage-receipt.cjs +135 -0
- package/dist/o11y/judge-usage-receipt.cjs.map +1 -0
- package/dist/o11y/judge-usage-receipt.d.cts +5 -0
- package/dist/o11y/judge-usage-receipt.d.mts +5 -0
- package/dist/o11y/judge-usage-receipt.d.ts +5 -0
- package/dist/o11y/judge-usage-receipt.js +6 -0
- package/dist/o11y/judge-usage-receipt.js.map +1 -0
- package/dist/o11y/judge-usage.cjs +171 -0
- package/dist/o11y/judge-usage.cjs.map +1 -0
- package/dist/o11y/judge-usage.d.cts +35 -0
- package/dist/o11y/judge-usage.d.mts +35 -0
- package/dist/o11y/judge-usage.d.ts +35 -0
- package/dist/o11y/judge-usage.js +6 -0
- package/dist/o11y/judge-usage.js.map +1 -0
- package/dist/plugin/contracts.cjs +2 -0
- package/dist/plugin/contracts.cjs.map +1 -1
- package/dist/plugin/link.cjs +7 -0
- package/dist/plugin/link.cjs.map +1 -1
- package/dist/record/attachment/protocol.cjs +8 -6
- package/dist/record/attachment/protocol.cjs.map +1 -1
- package/dist/record/attachment/protocol.d.cts +10 -0
- package/dist/record/attachment/protocol.d.mts +10 -0
- package/dist/record/attachment/protocol.d.ts +10 -0
- package/dist/record/attachment/protocol.js +38 -36
- package/dist/record/codec/seal-manifest.d.cts +3 -3
- package/dist/record/codec/seal-manifest.d.mts +3 -3
- package/dist/record/codec/seal-manifest.d.ts +3 -3
- package/dist/record/family/adapter-usage/definition.d.cts +1 -0
- package/dist/record/family/adapter-usage/definition.d.mts +1 -0
- package/dist/record/family/adapter-usage/definition.d.ts +1 -0
- package/dist/record/family/adapter-usage/persistence.cjs +1 -1
- package/dist/record/family/adapter-usage/persistence.cjs.map +1 -1
- package/dist/record/family/adapter-usage/persistence.d.cts +2 -1
- package/dist/record/family/adapter-usage/persistence.d.mts +2 -1
- package/dist/record/family/adapter-usage/persistence.d.ts +2 -1
- package/dist/record/family/adapter-usage/schema.cjs +21 -2
- package/dist/record/family/adapter-usage/schema.cjs.map +1 -1
- package/dist/record/family/adapter-usage/schema.d.cts +85 -0
- package/dist/record/family/adapter-usage/schema.d.mts +85 -0
- package/dist/record/family/adapter-usage/schema.d.ts +85 -0
- package/dist/record/family/adapter-usage/schema.js +18 -12
- package/dist/record/family/catalog.cjs +31 -27
- package/dist/record/family/catalog.cjs.map +1 -1
- package/dist/record/family/catalog.d.cts +94 -3
- package/dist/record/family/catalog.d.mts +94 -3
- package/dist/record/family/catalog.d.ts +94 -3
- package/dist/record/family/current.cjs +45 -42
- package/dist/record/family/current.cjs.map +1 -1
- package/dist/record/family/current.d.cts +240 -1
- package/dist/record/family/current.d.mts +240 -1
- package/dist/record/family/current.d.ts +240 -1
- package/dist/record/family/execution-traces/definition.d.cts +26 -0
- package/dist/record/family/execution-traces/definition.d.mts +26 -0
- package/dist/record/family/execution-traces/definition.d.ts +26 -0
- package/dist/record/family/execution-traces/definition.js +20 -14
- package/dist/record/family/execution-traces/schema.cjs +57 -1
- package/dist/record/family/execution-traces/schema.cjs.map +1 -1
- package/dist/record/family/execution-traces/schema.d.cts +114 -0
- package/dist/record/family/execution-traces/schema.d.mts +114 -0
- package/dist/record/family/execution-traces/schema.d.ts +114 -0
- package/dist/record/family/execution-traces/schema.js +18 -12
- package/dist/record/family/judge-usage/definition.cjs +12 -0
- package/dist/record/family/judge-usage/definition.cjs.map +1 -0
- package/dist/record/family/judge-usage/definition.d.cts +91 -0
- package/dist/record/family/judge-usage/definition.d.mts +91 -0
- package/dist/record/family/judge-usage/definition.d.ts +91 -0
- package/dist/record/family/judge-usage/definition.js +6 -0
- package/dist/record/family/judge-usage/definition.js.map +1 -0
- package/dist/record/family/judge-usage/persistence.cjs +10 -0
- package/dist/record/family/judge-usage/persistence.cjs.map +1 -0
- package/dist/record/family/judge-usage/persistence.d.cts +91 -0
- package/dist/record/family/judge-usage/persistence.d.mts +91 -0
- package/dist/record/family/judge-usage/persistence.d.ts +91 -0
- package/dist/record/family/judge-usage/persistence.js +6 -0
- package/dist/record/family/judge-usage/persistence.js.map +1 -0
- package/dist/record/family/judge-usage/schema.cjs +307 -0
- package/dist/record/family/judge-usage/schema.cjs.map +1 -0
- package/dist/record/family/judge-usage/schema.d.cts +351 -0
- package/dist/record/family/judge-usage/schema.d.mts +351 -0
- package/dist/record/family/judge-usage/schema.d.ts +351 -0
- package/dist/record/family/judge-usage/schema.js +18 -0
- package/dist/record/family/judge-usage/schema.js.map +1 -0
- package/dist/record/host/sqlite-host.cjs +55 -9
- package/dist/record/host/sqlite-host.cjs.map +1 -1
- package/dist/record/host/types.cjs.map +1 -1
- package/dist/record/host/types.d.cts +7 -0
- package/dist/record/host/types.d.mts +7 -0
- package/dist/record/host/types.d.ts +7 -0
- package/dist/record/model/run-context.cjs +7 -1
- package/dist/record/model/run-context.cjs.map +1 -1
- package/dist/record/model/run-context.d.cts +4 -0
- package/dist/record/model/run-context.d.mts +4 -0
- package/dist/record/model/run-context.d.ts +4 -0
- package/dist/record/model/seal-manifest.d.cts +1 -1
- package/dist/record/model/seal-manifest.d.mts +1 -1
- package/dist/record/model/seal-manifest.d.ts +1 -1
- package/dist/record/sqlite/client.cjs +18 -5
- package/dist/record/sqlite/client.cjs.map +1 -1
- package/dist/record/sqlite/client.d.cts +1 -1
- package/dist/record/sqlite/client.d.mts +1 -1
- package/dist/record/sqlite/client.d.ts +1 -1
- package/dist/record/sqlite/project-state-database.cjs +29 -8
- package/dist/record/sqlite/project-state-database.cjs.map +1 -1
- package/dist/run/host/runtime.cjs +4 -0
- package/dist/run/host/runtime.cjs.map +1 -1
- package/dist/run/storage/sqlite.cjs +20 -0
- package/dist/run/storage/sqlite.cjs.map +1 -1
- package/dist/runner/adapter-execution-trace.cjs +125 -2
- package/dist/runner/adapter-execution-trace.cjs.map +1 -1
- package/dist/runner/adapter-execution-trace.d.cts +1 -1
- package/dist/runner/adapter-execution-trace.d.mts +1 -1
- package/dist/runner/adapter-execution-trace.d.ts +1 -1
- package/dist/runner/adapter-usage.cjs +55 -7
- package/dist/runner/adapter-usage.cjs.map +1 -1
- package/dist/runner/adapter-usage.d.cts +9 -2
- package/dist/runner/adapter-usage.d.mts +9 -2
- package/dist/runner/adapter-usage.d.ts +9 -2
- package/dist/runner/adoption.cjs +9 -0
- package/dist/runner/adoption.cjs.map +1 -1
- package/dist/runner/attempt-cancellation.cjs +12 -0
- package/dist/runner/attempt-cancellation.cjs.map +1 -0
- package/dist/runner/attempt-cancellation.d.cts +6 -0
- package/dist/runner/attempt-cancellation.d.mts +6 -0
- package/dist/runner/attempt-cancellation.d.ts +6 -0
- package/dist/runner/attempt-cancellation.js +6 -0
- package/dist/runner/attempt-cancellation.js.map +1 -0
- package/dist/runner/attempt-resources.cjs +10 -4
- package/dist/runner/attempt-resources.cjs.map +1 -1
- package/dist/runner/attempt-resources.d.cts +2 -1
- package/dist/runner/attempt-resources.d.mts +2 -1
- package/dist/runner/attempt-resources.d.ts +2 -1
- package/dist/runner/attempt.cjs +1177 -1139
- package/dist/runner/attempt.cjs.map +1 -1
- package/dist/runner/config-identity.cjs +20 -1
- package/dist/runner/config-identity.cjs.map +1 -1
- package/dist/runner/config-identity.d.cts +5 -0
- package/dist/runner/config-identity.d.mts +5 -0
- package/dist/runner/config-identity.d.ts +5 -0
- package/dist/runner/discover.cjs +14 -0
- package/dist/runner/discover.cjs.map +1 -1
- package/dist/runner/discover.d.cts +3 -0
- package/dist/runner/discover.d.mts +3 -0
- package/dist/runner/discover.d.ts +3 -0
- package/dist/runner/feedback/human.cjs +9 -4
- package/dist/runner/feedback/human.cjs.map +1 -1
- package/dist/runner/fingerprint.cjs +1 -0
- package/dist/runner/fingerprint.cjs.map +1 -1
- package/dist/runner/judge-usage.cjs +18 -0
- package/dist/runner/judge-usage.cjs.map +1 -0
- package/dist/runner/judge-usage.d.cts +5 -0
- package/dist/runner/judge-usage.d.mts +5 -0
- package/dist/runner/judge-usage.d.ts +5 -0
- package/dist/runner/judge-usage.js +8 -0
- package/dist/runner/judge-usage.js.map +1 -0
- package/dist/runner/project-target.cjs.map +1 -1
- package/dist/runner/project-target.d.cts +2 -0
- package/dist/runner/project-target.d.mts +2 -0
- package/dist/runner/project-target.d.ts +2 -0
- package/dist/runner/record/planning.cjs +1 -0
- package/dist/runner/record/planning.cjs.map +1 -1
- package/dist/runner/record.cjs +4 -0
- package/dist/runner/record.cjs.map +1 -1
- package/dist/runner/reporters/braintrust.cjs +2 -0
- package/dist/runner/reporters/braintrust.cjs.map +1 -1
- package/dist/runner/reuse-diagnostics.cjs +9 -10
- package/dist/runner/reuse-diagnostics.cjs.map +1 -1
- package/dist/runner/reuse-diagnostics.d.cts +5 -6
- package/dist/runner/reuse-diagnostics.d.mts +5 -6
- package/dist/runner/reuse-diagnostics.d.ts +5 -6
- package/dist/runner/reuse-diagnostics.js +4 -4
- package/dist/runner/reuse-plan.cjs +100 -48
- package/dist/runner/reuse-plan.cjs.map +1 -1
- package/dist/runner/reuse-plan.d.cts +60 -3
- package/dist/runner/reuse-plan.d.mts +60 -3
- package/dist/runner/reuse-plan.d.ts +60 -3
- package/dist/runner/reuse-plan.js +14 -10
- package/dist/runner/run.cjs +8 -6
- package/dist/runner/run.cjs.map +1 -1
- package/dist/runner/session.cjs +1 -1
- package/dist/runner/session.cjs.map +1 -1
- package/dist/runner/session.d.cts +1 -1
- package/dist/runner/session.d.mts +1 -1
- package/dist/runner/session.d.ts +1 -1
- package/dist/runner/source-producer.cjs +3 -1
- package/dist/runner/source-producer.cjs.map +1 -1
- package/dist/runner/types.cjs.map +1 -1
- package/dist/runner/types.d.cts +26 -5
- package/dist/runner/types.d.mts +26 -5
- package/dist/runner/types.d.ts +26 -5
- package/dist/sandbox/action.cjs +3 -0
- package/dist/sandbox/action.cjs.map +1 -1
- package/dist/sandbox/commands.cjs +3 -0
- package/dist/sandbox/commands.cjs.map +1 -1
- package/dist/sandbox/compose.cjs +6 -0
- package/dist/sandbox/compose.cjs.map +1 -1
- package/dist/sandbox/docker-profile/registry.cjs +7 -0
- package/dist/sandbox/docker-profile/registry.cjs.map +1 -1
- package/dist/sandbox/docker-profile/runtime.cjs +3 -0
- package/dist/sandbox/docker-profile/runtime.cjs.map +1 -1
- package/dist/sandbox/docker-profile/schema.cjs +7 -0
- package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
- package/dist/sandbox/incus.cjs +7 -0
- package/dist/sandbox/incus.cjs.map +1 -1
- package/dist/sandbox/layer.cjs +12 -0
- package/dist/sandbox/layer.cjs.map +1 -1
- package/dist/shared/adapter-cleanup.cjs +18 -0
- package/dist/shared/adapter-cleanup.cjs.map +1 -0
- package/dist/shared/adapter-cleanup.d.cts +4 -0
- package/dist/shared/adapter-cleanup.d.mts +4 -0
- package/dist/shared/adapter-cleanup.d.ts +4 -0
- package/dist/shared/adapter-cleanup.js +10 -0
- package/dist/shared/adapter-cleanup.js.map +1 -0
- package/dist/shared/attempt-lifecycle.cjs +3 -0
- package/dist/shared/attempt-lifecycle.cjs.map +1 -0
- package/dist/shared/attempt-lifecycle.d.cts +13 -0
- package/dist/shared/attempt-lifecycle.d.mts +13 -0
- package/dist/shared/attempt-lifecycle.d.ts +13 -0
- package/dist/shared/attempt-lifecycle.js +4 -0
- package/dist/shared/attempt-lifecycle.js.map +1 -0
- package/dist/show/contribution.cjs +52 -14
- package/dist/show/contribution.cjs.map +1 -1
- package/dist/show/contribution.d.cts +23 -1
- package/dist/show/contribution.d.mts +23 -1
- package/dist/show/contribution.d.ts +23 -1
- package/dist/show/model.cjs +8 -1
- package/dist/show/model.cjs.map +1 -1
- package/dist/show/model.d.cts +10 -1
- package/dist/show/model.d.mts +10 -1
- package/dist/show/model.d.ts +10 -1
- package/dist/show/render.cjs +287 -49
- package/dist/show/render.cjs.map +1 -1
- package/dist/show/render.d.cts +3 -0
- package/dist/show/render.d.mts +3 -0
- package/dist/show/render.d.ts +3 -0
- package/dist/sources/projector.cjs +3 -0
- package/dist/sources/projector.cjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/view/app-dist/.vite/manifest.json +2 -2
- package/dist/view/app-dist/assets/index-CmVoXbwG.js +63 -0
- package/dist/view/app-dist/assets/{quality-cost-scatter-CFB3wnkN.js → quality-cost-scatter-BuLISaH4.js} +1 -1
- package/dist/view/app-dist/index.html +1 -1
- package/dist/view/cli/contribution.cjs +54 -21
- package/dist/view/cli/contribution.cjs.map +1 -1
- package/dist/view/cli/contribution.d.cts +2 -1
- package/dist/view/cli/contribution.d.mts +2 -1
- package/dist/view/cli/contribution.d.ts +2 -1
- package/dist/view/function-runtime.mjs +13231 -11647
- package/dist/view/http-protocol.cjs +3 -0
- package/dist/view/http-protocol.cjs.map +1 -1
- package/dist/view/http-protocol.d.cts +8 -0
- package/dist/view/http-protocol.d.mts +8 -0
- package/dist/view/http-protocol.d.ts +8 -0
- package/dist/view/inspection-host.cjs +17 -1
- package/dist/view/inspection-host.cjs.map +1 -1
- package/dist/view/render.cjs +1 -0
- package/dist/view/render.cjs.map +1 -1
- package/dist/view/render.d.cts +2 -1
- package/dist/view/render.d.mts +2 -1
- package/dist/view/render.d.ts +2 -1
- package/dist/view/revision.cjs.map +1 -1
- package/dist/view/revision.d.cts +12 -0
- package/dist/view/revision.d.mts +12 -0
- package/dist/view/revision.d.ts +12 -0
- package/dist/view/server.cjs +10 -9
- package/dist/view/server.cjs.map +1 -1
- package/docs-site/zh/examples/ai-agent-application.mdx +1 -1
- package/docs-site/zh/explanation/adapter.mdx +2 -2
- package/docs-site/zh/explanation/assert.mdx +60 -24
- package/docs-site/zh/explanation/drive.mdx +1 -1
- package/docs-site/zh/explanation/evals.mdx +31 -29
- package/docs-site/zh/explanation/experiment.mdx +15 -15
- package/docs-site/zh/explanation/judge.mdx +23 -15
- package/docs-site/zh/explanation/overview.mdx +44 -21
- package/docs-site/zh/explanation/record.mdx +28 -13
- package/docs-site/zh/explanation/results-flow.mdx +37 -0
- package/docs-site/zh/explanation/runner.mdx +27 -6
- package/docs-site/zh/index.mdx +22 -115
- package/docs-site/zh/introduction.mdx +89 -61
- package/docs-site/zh/reference/cli.mdx +50 -26
- package/docs-site/zh/reference/define-agent.mdx +37 -5
- package/docs-site/zh/reference/define-eval.mdx +130 -29
- package/docs-site/zh/reference/define-experiment.mdx +251 -0
- package/docs-site/zh/reference/events.mdx +34 -30
- package/docs-site/zh/reference/expect.mdx +77 -2
- package/docs-site/zh/reference/official-adapters.mdx +2 -2
- package/docs-site/zh/troubleshooting/debug-sandbox.mdx +43 -24
- package/docs-site/zh/troubleshooting/debugging.mdx +65 -42
- package/docs-site/zh/troubleshooting/recover-after-kill.mdx +35 -28
- package/docs-site/zh/tutorials/accept-results.mdx +34 -24
- package/docs-site/zh/tutorials/agent-feedback-loop.mdx +74 -43
- package/docs-site/zh/tutorials/agent-onboarding.mdx +27 -20
- package/docs-site/zh/tutorials/authoring.mdx +138 -121
- package/docs-site/zh/tutorials/ci-integration.mdx +46 -22
- package/docs-site/zh/tutorials/compare-runs.mdx +40 -13
- package/docs-site/zh/tutorials/concurrency.mdx +66 -62
- package/docs-site/zh/tutorials/configuration.mdx +17 -17
- package/docs-site/zh/tutorials/connect-otel.mdx +48 -37
- package/docs-site/zh/tutorials/connect-your-agent.mdx +80 -173
- package/docs-site/zh/tutorials/control-run-cost.mdx +63 -12
- package/docs-site/zh/tutorials/criteria-files.mdx +28 -21
- package/docs-site/zh/tutorials/custom-application.mdx +75 -55
- package/docs-site/zh/tutorials/dataset-fanout.mdx +32 -22
- package/docs-site/zh/tutorials/debug-lifecycle-plan.mdx +38 -31
- package/docs-site/zh/tutorials/docker-in-docker.mdx +83 -89
- package/docs-site/zh/tutorials/eval-groups.mdx +70 -89
- package/docs-site/zh/tutorials/evaluation-kinds.mdx +12 -5
- package/docs-site/zh/tutorials/experiment-services.mdx +243 -0
- package/docs-site/zh/tutorials/fixtures.mdx +42 -26
- package/docs-site/zh/tutorials/handle-execution-failures.mdx +41 -19
- package/docs-site/zh/tutorials/install-custom-sandbox-agent.mdx +21 -16
- package/docs-site/zh/tutorials/niceeval-taste-application.mdx +394 -0
- package/docs-site/zh/tutorials/niceeval-taste.mdx +190 -0
- package/docs-site/zh/tutorials/nixos-managed-dind.mdx +51 -39
- package/docs-site/zh/tutorials/plugins.mdx +55 -31
- package/docs-site/zh/tutorials/prebuilt-sandbox.mdx +204 -0
- package/docs-site/zh/tutorials/quickstart.mdx +91 -47
- package/docs-site/zh/tutorials/reporters.mdx +45 -30
- package/docs-site/zh/tutorials/rerun-and-cache.mdx +39 -40
- package/docs-site/zh/tutorials/sandbox-agent.mdx +65 -40
- package/docs-site/zh/tutorials/sandbox-providers.mdx +104 -282
- package/docs-site/zh/tutorials/sandbox-reuse.mdx +65 -97
- package/docs-site/zh/tutorials/select-and-preview.mdx +25 -20
- package/docs-site/zh/tutorials/verify-judge.mdx +49 -26
- package/docs-site/zh/tutorials/viewing-results.mdx +130 -80
- package/docs-site/zh/tutorials/write-experiment.mdx +116 -298
- package/docs-site/zh/tutorials/write-send.mdx +53 -52
- package/node_modules/undici/docs/docs/api/Agent.md +8 -8
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
- package/node_modules/undici/docs/docs/api/Errors.md +25 -0
- package/node_modules/undici/docs/docs/api/Interceptors.md +4 -3
- package/node_modules/undici/docs/docs/api/Pool.md +5 -6
- package/node_modules/undici/lib/api/readable.js +1 -2
- package/node_modules/undici/lib/core/request.js +23 -2
- package/node_modules/undici/lib/core/util.js +0 -39
- package/node_modules/undici/lib/dispatcher/client-h1.js +11 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +52 -8
- package/node_modules/undici/lib/dispatcher/client.js +1 -1
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -2
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
- package/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
- package/node_modules/undici/lib/dispatcher/pool.js +90 -7
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +16 -3
- package/node_modules/undici/lib/handler/deduplication-handler.js +24 -11
- package/node_modules/undici/lib/handler/redirect-handler.js +5 -0
- package/node_modules/undici/lib/handler/retry-handler.js +72 -13
- package/node_modules/undici/lib/interceptor/cache.js +4 -1
- package/node_modules/undici/lib/interceptor/decompress.js +236 -69
- package/node_modules/undici/lib/web/cache/cache.js +17 -8
- package/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
- package/node_modules/undici/lib/web/cookies/index.js +19 -7
- package/node_modules/undici/lib/web/cookies/util.js +3 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -1
- package/node_modules/undici/lib/web/fetch/body.js +22 -15
- package/node_modules/undici/lib/web/fetch/data-url.js +6 -6
- package/node_modules/undici/lib/web/fetch/formdata.js +30 -36
- package/node_modules/undici/lib/web/fetch/headers.js +34 -31
- package/node_modules/undici/lib/web/fetch/index.js +38 -14
- package/node_modules/undici/lib/web/fetch/request.js +74 -79
- package/node_modules/undici/lib/web/fetch/response.js +43 -44
- package/node_modules/undici/lib/web/fetch/util.js +7 -7
- package/node_modules/undici/lib/web/infra/index.js +16 -1
- package/node_modules/undici/lib/web/webidl/index.js +2 -14
- package/node_modules/undici/lib/web/websocket/events.js +43 -26
- package/node_modules/undici/lib/web/websocket/receiver.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
- package/node_modules/undici/lib/web/websocket/websocket.js +44 -41
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/diagnostics-channel.d.ts +2 -1
- package/node_modules/undici/types/interceptors.d.ts +1 -1
- package/node_modules/undici/types/webidl.d.ts +13 -7
- package/package.json +4 -4
- package/dist/view/app-dist/assets/index-DFzw1L97.js +0 -63
- package/docs-site/zh/tutorials/experiments.mdx +0 -101
|
@@ -89,22 +89,20 @@ NiceEval 和对应的 Linux 宿主服务;Apple `container` 当前需要独立
|
|
|
89
89
|
}
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
的硬上限,`dockerDataAllocationCount` 是 profile 可同时授予的 Docker data allocation 数量。`aggregate` 是 daemon、构建进程、
|
|
94
|
-
watchdog 和评估容器共同受到的硬限制,因此每一项都不能小于 `capacity`。两者之间的余量留给宿主侧开销。
|
|
92
|
+
几组数字各管一件事:
|
|
95
93
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
`
|
|
94
|
+
- `capacity`:NiceEval 可以分给评估任务的总量。
|
|
95
|
+
- `ephemeralDiskBytes`:每个 Sandbox 的 Docker 数据最多占多少磁盘。
|
|
96
|
+
- `dockerDataAllocationCount`:最多同时有几个 Sandbox 拿到 Docker 数据空间。
|
|
97
|
+
- `aggregate`:Docker daemon、构建进程、宿主服务和评估容器加起来的硬上限,每一项都不能小于 `capacity`。两者之间的差额留给宿主侧的开销。
|
|
99
98
|
|
|
100
|
-
|
|
101
|
-
`sandboxState.dockerData` 覆盖范围。`niceeval debug` 会把它显示为 `Unsupported`,并让 Action
|
|
102
|
-
真实执行。只有 Host 另外具备独立、完整预分配、固定大小的 image slot 与 immutable seed 时,才可能发布
|
|
103
|
-
这项覆盖范围;详见[选择 Sandbox Provider](/zh/tutorials/sandbox-providers)。
|
|
99
|
+
`backing = "loop-ext4"` 会在 `/var/lib/niceeval/docker-profiles/default.img` 创建一个独立的 ext4 文件系统,并按目录限制磁盘用量。宿主服务从里面给每个 Sandbox 分一个专用目录,挂到 Sandbox 的 `/var/lib/docker`。不要再给这个路径声明 `tmpfs`:Sandbox 里的 Docker image 和 BuildKit 缓存应该占磁盘,不应计入宿主机的 `Shmem`。
|
|
104
100
|
|
|
105
|
-
|
|
101
|
+
这种共享 loop 文件系统只负责运行时的磁盘限额和隔离,不能保存准备步骤的结果。写了 `sandboxState.dockerData` 的准备步骤,在 `niceeval debug` 里会显示 `Unsupported`,每次都真实执行。想让这类步骤下次直接沿用,需要下一节的固定存储配置;准备步骤的缓存规则见[选择并配置 Sandbox](/zh/tutorials/sandbox-providers)。
|
|
106
102
|
|
|
107
|
-
|
|
103
|
+
## 让 Docker 准备步骤下次直接沿用
|
|
104
|
+
|
|
105
|
+
`docker load` 这类准备步骤很慢时,你可能希望 Sandbox 里的 Docker image 和 volume 下次直接沿用。这需要另建一个 raw profile,并改用固定大小的存储:
|
|
108
106
|
|
|
109
107
|
```nix title="configuration.nix"
|
|
110
108
|
services.niceeval.dockerProfiles.harness-raw = {
|
|
@@ -128,30 +126,45 @@ services.niceeval.dockerProfiles.harness-raw = {
|
|
|
128
126
|
};
|
|
129
127
|
```
|
|
130
128
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
### 估算磁盘空间
|
|
130
|
+
|
|
131
|
+
这份配置预先分配:
|
|
132
|
+
|
|
133
|
+
- 2 个 4 GiB 的运行空间(对应 `dockerDataAllocationCount = 2`);
|
|
134
|
+
- 10 份 4 GiB 的只读种子数据(`seedCount = 10`),用来保存准备好的 Docker 状态;
|
|
135
|
+
- 2 份最坏情况下的临时副本。
|
|
136
|
+
|
|
137
|
+
合计 56 GiB。`storage.size = "80G"` 在扣除 ext4 元数据和保留块后,剩余可用空间(`f_bavail`)还要够故障恢复使用。
|
|
138
|
+
|
|
139
|
+
种子数据不会自动清理。10 份用完后,profile 拒绝保存新的准备结果,也不会覆盖旧的种子。
|
|
140
|
+
|
|
141
|
+
`fixed-image-ext4` 只能用于 raw profile。它继续使用现有 daemon 的 `DockerRootDir`,但把固定存储、宿主配置和日志放在单独的 `fixed-image-v1` 路径下。`rootDir` 必须是非根目录的绝对路径,挂载依赖、清单和可写路径都从它推出。
|
|
142
|
+
|
|
143
|
+
### 切换到固定存储
|
|
144
|
+
|
|
145
|
+
切换前,先让这个 profile 完全空闲:
|
|
134
146
|
|
|
135
|
-
|
|
136
|
-
|
|
147
|
+
- 没有正在运行或排队的 Attempt、构建和容器;
|
|
148
|
+
- 默认 daemon 上没有 NiceEval 的代理容器和 Attempt 网络。
|
|
137
149
|
|
|
138
|
-
|
|
139
|
-
container 和 Attempt network 也必须清零。
|
|
140
|
-
部署不会改写旧 `loop-ext4` image;旧 image、config 与 journal 会保留,供 cold rollback 使用。`rootDir`
|
|
141
|
-
必须是非根绝对路径;module 从它统一派生 mount dependency、manifest 与 write paths。
|
|
150
|
+
部署不会改写旧的 `loop-ext4` 镜像文件。旧镜像、配置和日志都会保留,需要时可以停机回退。
|
|
142
151
|
|
|
143
|
-
|
|
144
|
-
保存只读 capsule,`current` pointer 的原子替换是唯一 commit 点。先启动
|
|
145
|
-
`niceeval-docker-profile-fixed-activation-harness-raw.service`。成功后再启动或重启
|
|
146
|
-
`niceeval-docker-profile-fixed-watchdog-harness-raw.service`。
|
|
152
|
+
启用固定存储是一次单独的部署操作,不会随 `nixos-rebuild switch` 或开机自动完成。按顺序启动两个服务:
|
|
147
153
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
154
|
+
```bash
|
|
155
|
+
sudo systemctl start niceeval-docker-profile-fixed-activation-harness-raw.service
|
|
156
|
+
sudo systemctl restart niceeval-docker-profile-fixed-watchdog-harness-raw.service
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
第一个服务成功后,再启动或重启第二个。每次成功启用都会保存一个只读的版本快照,`current` 指针原子地切换到新版本。
|
|
160
|
+
|
|
161
|
+
正常开机时,宿主服务会根据 `current` 指针找到当前版本,核对 `rootDir` 所在挂载、外层 ext4、种子登记和校验值,再恢复数据挂载。任何一项对不上时,宿主服务不会开始接收 Attempt。数据盘不存在时,它也不会在根盘上建一个同名目录继续运行。
|
|
151
162
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
163
|
+
### 种子用完之前
|
|
164
|
+
|
|
165
|
+
种子快用完时,先查看启用服务的状态,里面列出当前可用、保留中、可退役和可回收的容量。更换种子需要手动操作:先停止接收新 Attempt、等现有任务跑完,并在独占锁下发布新版本。
|
|
166
|
+
|
|
167
|
+
旧版本要先显式退役,才能回收它占的空间。只有既不是当前版本、也不是上一个版本的才能退役。回收之后,这个版本就不能再用来回退。
|
|
155
168
|
|
|
156
169
|
## 应用系统配置
|
|
157
170
|
|
|
@@ -188,9 +201,9 @@ pnpm exec niceeval docker profile list
|
|
|
188
201
|
pnpm exec niceeval docker profile doctor default
|
|
189
202
|
```
|
|
190
203
|
|
|
191
|
-
`list`
|
|
192
|
-
|
|
193
|
-
|
|
204
|
+
`list` 应该列出 `default`。`doctor` 依次检查 profile 描述文件、Unix socket、cgroup、容量、宿主服务、离线资源和一次冷构建,然后启动一个受限的外层容器,并在里面再跑一个 Alpine 容器。全部通过后,这个 profile 才能用于正式评估。
|
|
205
|
+
|
|
206
|
+
某一项失败时,`doctor` 会指出是哪一项。先按上一节查看对应服务的日志。
|
|
194
207
|
|
|
195
208
|
不要用 `sudo pnpm exec niceeval ...` 绕过权限错误。日常用户无法访问 profile 时,先确认用户名已经写入
|
|
196
209
|
`accessUsers`,再重新登录并重跑 doctor。
|
|
@@ -207,9 +220,9 @@ dockerAccess: {
|
|
|
207
220
|
},
|
|
208
221
|
```
|
|
209
222
|
|
|
210
|
-
Experiment
|
|
211
|
-
|
|
212
|
-
`maxConcurrency`
|
|
223
|
+
Experiment 还必须声明每个 Sandbox 的 CPU、内存、进程数、`dockerDataBytes`、只读根文件系统,以及其余可写路径的 tmpfs。完整配置见[让 Sandbox 使用 Docker](/zh/tutorials/docker-in-docker#managed-rootless-dind)。
|
|
224
|
+
|
|
225
|
+
先用较小的 `maxConcurrency` 跑一次,再根据 profile 的 `capacity` 调高并发。跑完后用 `pnpm exec niceeval show` 在终端查看结果,或用 `pnpm exec niceeval view` 在浏览器里查看。
|
|
213
226
|
|
|
214
227
|
## 更新 module
|
|
215
228
|
|
|
@@ -221,5 +234,4 @@ nix flake check
|
|
|
221
234
|
sudo nixos-rebuild switch --flake .#my-host
|
|
222
235
|
```
|
|
223
236
|
|
|
224
|
-
|
|
225
|
-
通过后再清理 NixOS generation。
|
|
237
|
+
更新会改变宿主服务,只更新评估项目里的 npm 依赖是不够的。保留旧的 NixOS generation,确认 `doctor` 和实际评估都通过后,再清理旧 generation。
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "用 Plugin
|
|
2
|
+
title: "用 Plugin 复用一整套运行条件"
|
|
3
3
|
sidebarTitle: "Plugin"
|
|
4
|
-
description: "
|
|
4
|
+
description: "同一套“先在宿主机起服务、再在 Sandbox 里准备环境”的条件要在多个 Experiment、评估组或评估用例里用时,用 definePlugin 写一次,到处挂载。"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
你的几个对比实验都要接同一个记忆服务:在宿主机上开一条隧道,再在 Sandbox 里写入连接配置、装好命令行工具。把这些代码复制到每个 Experiment 里,改一处就要改好几处。
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Plugin 把这样一整套条件写在一起:它叫什么、宿主机上要起停什么、Sandbox 里要执行哪些准备命令。写好后挂到 Experiment、评估组或评估用例上就能复用。
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Plugin 只负责条件本身,不负责选环境:用哪个 Docker 镜像、E2B template 或 Vercel snapshot,仍由 `sandbox` 字段决定。
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Agent 自己的 Skill、MCP server 和原生 Plugin 也不归这里管,它们仍传给 Agent factory,例如 `codexAgent({ plugins: [...] })`。
|
|
14
|
+
|
|
15
|
+
## 第 1 步:写一个 Plugin
|
|
16
|
+
|
|
17
|
+
把这套条件写成一个 Plugin,放在几个 Experiment 都能导入的位置。所有 Plugin API 从 `niceeval/plugin` 导入。
|
|
18
|
+
|
|
19
|
+
下面这个例子在宿主机上起停记忆服务,并在 Sandbox 里上传插件文件、写入连接配置:
|
|
14
20
|
|
|
15
21
|
```ts
|
|
16
22
|
// experiments/shared/memory.ts
|
|
@@ -57,17 +63,23 @@ export const memory = definePlugin<MemoryOptions>({
|
|
|
57
63
|
});
|
|
58
64
|
```
|
|
59
65
|
|
|
60
|
-
|
|
66
|
+
几个字段各管一件事:
|
|
67
|
+
|
|
68
|
+
- `name` 和 `instanceKey` 一起区分同一个 Plugin 的不同实例,这里按 `model` 区分。
|
|
69
|
+
- `experiment` 里的 `setup` / `teardown` 在宿主机上运行,适合起停服务、开隧道。
|
|
70
|
+
- `sandbox` 返回一个 `sandboxLayer()`,里面用和普通代码相同的 `.before()` / `.after()` 准备 Sandbox。
|
|
71
|
+
|
|
72
|
+
Sandbox 里的准备步骤用内置的 `uploadDirectory()`、`writeText()`、`gitCheckout()`、`shell()` 等函数写。它们和 Experiment、评估用例里的准备步骤一起排序,没变的步骤在 Docker 上可以直接沿用上次的准备结果。Plugin 不需要自己处理上传或 clone。
|
|
61
73
|
|
|
62
|
-
|
|
74
|
+
需要运行时才能决定的分支,可以在返回的 layer 里写 `.before(async (sandbox, context) => ...)`。这种回调每次都真实执行,它后面的准备步骤也不再沿用缓存。成功取得资源后,立即用 `context.onCleanup()` 登记释放。
|
|
63
75
|
|
|
64
76
|
<Warning>
|
|
65
|
-
`sandbox`
|
|
77
|
+
`sandbox` 必须返回 `sandboxLayer()`。返回 `dockerSandbox()`、`e2bSandbox()` 这类选择了镜像或 template 的 layer,会在加载定义时报错。Plugin 不能替换调用方选择的 Provider。
|
|
66
78
|
</Warning>
|
|
67
79
|
|
|
68
|
-
|
|
80
|
+
### 从 Git 仓库取 Plugin 源码
|
|
69
81
|
|
|
70
|
-
|
|
82
|
+
Plugin 源码在一个能 clone 的仓库里时,用 `gitCheckout()`,`ref` 填完整的 commit ID。branch 或 tag 会移动,NiceEval 无法据此判断内容变没变,所以不接受:
|
|
71
83
|
|
|
72
84
|
```ts
|
|
73
85
|
import {
|
|
@@ -83,11 +95,11 @@ const pluginSource = sandboxLayer().before(gitCheckout({
|
|
|
83
95
|
}));
|
|
84
96
|
```
|
|
85
97
|
|
|
86
|
-
|
|
98
|
+
源码在本地目录时用 `uploadDirectory()`,`source` 写成相对当前文件的 `new URL("...", import.meta.url)`。目录里的文件内容、权限和 symlink 变化都会被自动发现:改一个文件,只有上传这个目录的步骤和它后面的步骤会重新执行。
|
|
87
99
|
|
|
88
|
-
##
|
|
100
|
+
## 第 2 步:挂到 Experiment、评估组或评估用例
|
|
89
101
|
|
|
90
|
-
|
|
102
|
+
只用一两个 Plugin 时,直接传数组:
|
|
91
103
|
|
|
92
104
|
```ts
|
|
93
105
|
export default defineExperiment({
|
|
@@ -99,7 +111,7 @@ export default defineExperiment({
|
|
|
99
111
|
});
|
|
100
112
|
```
|
|
101
113
|
|
|
102
|
-
|
|
114
|
+
几个 Experiment 共用一组 Plugin、又各自再加几个时,用 `pluginStack()` 组合。`.use()` 追加一个 Plugin,`.concat()` 合并两组。每次调用都返回新值,原来那组不变,可以放心从同一个基础上分叉:
|
|
103
115
|
|
|
104
116
|
```ts
|
|
105
117
|
import { pluginStack } from "niceeval/plugin";
|
|
@@ -116,37 +128,49 @@ export default defineExperiment({
|
|
|
116
128
|
});
|
|
117
129
|
```
|
|
118
130
|
|
|
119
|
-
|
|
131
|
+
类型检查会拦住挂错位置的 Plugin:只支持评估用例的 Plugin 不能放进 Experiment 的组合里,没有共同可挂位置的两组也不能合并。空的 `pluginStack()` 和不写 `plugins` 效果相同。
|
|
120
132
|
|
|
121
|
-
|
|
133
|
+
组合不会自动去重。同一个位置出现两个 `name` 和 `instanceKey` 都相同的 Plugin 时,运行会在创建 Sandbox 前报错。删掉重复的那个,或者给它不同的 `instanceKey`。
|
|
122
134
|
|
|
123
|
-
##
|
|
135
|
+
## 宿主机上的准备每次跑几回
|
|
124
136
|
|
|
125
|
-
Plugin
|
|
137
|
+
Plugin 可以在三个层级声明宿主机上的 `setup` / `teardown`:
|
|
126
138
|
|
|
127
|
-
|
|
|
139
|
+
| 写在 | 运行次数 |
|
|
128
140
|
| --- | --- |
|
|
129
|
-
| `experiment(options)` |
|
|
130
|
-
| `group(options)` | 每个 Experiment
|
|
131
|
-
| `eval(options)` |
|
|
141
|
+
| `experiment(options)` | 每个这次确实要跑的 Experiment 一次 |
|
|
142
|
+
| `group(options)` | 每个 Experiment 和评估组的组合一次 |
|
|
143
|
+
| `eval(options)` | 每个确实要跑的 Attempt 一次 |
|
|
132
144
|
|
|
133
|
-
|
|
145
|
+
每一层至少写 `setup` 或 `teardown` 之一,可以带 `identity`。多个 Plugin 的 `setup` 按挂载顺序运行,`teardown` 按相反顺序运行。整道题都沿用上次结果、不需要重跑时,这些回调不会运行。
|
|
134
146
|
|
|
135
|
-
`sandbox(options)`
|
|
147
|
+
`sandbox(options)` 不是第四个层级。它只定义一次 Sandbox 准备步骤,NiceEval 把这些步骤放进 Plugin 所挂位置的 Sandbox 准备里。你不需要在 `.before()` 里再传一次 Plugin。
|
|
136
148
|
|
|
137
|
-
|
|
149
|
+
## 修改 Plugin 后让旧结果失效
|
|
138
150
|
|
|
139
|
-
|
|
151
|
+
Plugin 的行为变了,沿用上次的结果就不再可信。NiceEval 能看到一部分变化,另一部分要你告诉它:
|
|
152
|
+
|
|
153
|
+
- 改了宿主机 `setup` / `teardown` 的行为时,把 `behaviorRevision` 加一。NiceEval 看不到函数体的变化。
|
|
154
|
+
- 改了 Sandbox 里的内置准备步骤(命令、文件、commit)时,不用做任何事,这些变化会被自动发现。
|
|
155
|
+
- 自定义的准备步骤只在 NiceEval 观察不到的协议变化时,才补一个 `cache.fingerprint`。
|
|
156
|
+
|
|
157
|
+
改完后先用 `pnpm exec niceeval exp <experiment> --dry` 确认受影响的题会重跑。
|
|
158
|
+
|
|
159
|
+
## 运行前检查 Plugin 加进了哪些步骤
|
|
160
|
+
|
|
161
|
+
挂上 Plugin 后,先看它的准备步骤排在哪里,再花钱运行:
|
|
140
162
|
|
|
141
163
|
```bash
|
|
142
164
|
pnpm exec niceeval debug compare/codex memory/smoke
|
|
143
165
|
pnpm exec niceeval debug compare/codex memory/smoke --json
|
|
144
166
|
```
|
|
145
167
|
|
|
146
|
-
`debug`
|
|
168
|
+
`debug` 把 Plugin 加入的步骤和 Experiment、评估组、评估用例、Agent 的步骤放进同一份计划。终端里每一步显示它来自哪里、执行序号、`changeFrequency`、依赖和能否沿用缓存;`--json` 给出相同的结构。
|
|
169
|
+
|
|
170
|
+
Plugin 的步骤没出现在计划里时,先检查 `plugins` 是否挂在了你选中的 Experiment 或评估用例上。
|
|
147
171
|
|
|
148
172
|
## 接着看
|
|
149
173
|
|
|
150
|
-
- [Sandbox · 按顺序准备 Sandbox](/zh/tutorials/sandbox-providers#按顺序准备-sandbox)
|
|
151
|
-
- [评估组](/zh/tutorials/eval-groups)
|
|
152
|
-
- [运行前检查 Sandbox 计划](/zh/tutorials/debug-lifecycle-plan)——查看 Plugin
|
|
174
|
+
- [Sandbox · 按顺序准备 Sandbox](/zh/tutorials/sandbox-providers#按顺序准备-sandbox)——准备步骤、频率、缓存与收尾。
|
|
175
|
+
- [评估组](/zh/tutorials/eval-groups)——评估组的准备步骤怎样进入同一顺序。
|
|
176
|
+
- [运行前检查 Sandbox 计划](/zh/tutorials/debug-lifecycle-plan)——查看 Plugin 加入后的完整计划。
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "预制 Sandbox 环境:让每次评估更快开始"
|
|
3
|
+
sidebarTitle: "预制环境"
|
|
4
|
+
description: "把系统包、Agent CLI 和大缓存做进 Docker 镜像、Vercel 快照或 E2B template,从官方基线派生;运行时缓存用 checkpoint 在 Attempt 之间延续。"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
每个 Attempt 都从同一个起点开始。系统包、Agent CLI、编译好的二进制、大模型缓存这类内容稳定、体积大,每次都一样,与其每个 Attempt 重装一遍,不如在跑评估之前做进预制环境,让 Attempt 直接从装好的环境启动。
|
|
9
|
+
|
|
10
|
+
三种 Provider 引用预制环境的写法一致:
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
dockerSandbox({ source: { type: "image", image: "my-evals:node24" } })
|
|
14
|
+
vercelSandbox({ snapshotId: "snap_abc123" })
|
|
15
|
+
e2bSandbox({ template: "my-evals" })
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
NiceEval 只读取构建结果的 ID,不提供跨 Provider 的构建命令。Docker 镜像、Vercel 快照和 E2B template 的凭据、构建方式、发布和过期规则各不相同,构建脚本用 Provider 自己的官方工具维护,最后把 ID 或名字写进 Experiment。
|
|
19
|
+
|
|
20
|
+
## 不预制也能跑
|
|
21
|
+
|
|
22
|
+
预制只是为了更快。Adapter 和 Sandbox 各管一边:Sandbox 配置决定用哪个 Provider、从哪个预制环境启动;Adapter 检查需要的 CLI 在不在。Claude Code 和 Codex 缺少 CLI 时会在运行时安装:安装包在评估网络之外准备好,再通过文件接口送进 Sandbox。
|
|
23
|
+
|
|
24
|
+
- Codex 送进 Sandbox 的是自带运行时的原生安装包,镜像里没有 Node 也能装。
|
|
25
|
+
- Claude Code 要求镜像里有 npm。
|
|
26
|
+
- 默认的 Bub 0.4.0 除了 OTel 插件,还固定了 `any-llm-sdk==1.17.0` 和 `openai==2.31.0`。Bub 版本、这两个依赖、OTel 插件或 Python 插件列表任何一项变了,都会重新安装,不能只凭 `command -v bub` 判断已经装好。用旧安装标记做的预制环境会重装一次。你显式选了其它 Bub 版本时,它依赖的其它包由你自己负责。
|
|
27
|
+
|
|
28
|
+
## 从官方基线继续构建
|
|
29
|
+
|
|
30
|
+
三个内置 Provider 都可以从官方基线继续构建,不用从空白环境装 Agent。预制环境只在依赖变化时构建一次,每次构建换一个带版本号的名字。不要把构建放进每个 Attempt 都会执行的动态回调。
|
|
31
|
+
|
|
32
|
+
### E2B:从官方与公共模板派生
|
|
33
|
+
|
|
34
|
+
E2B 官方提供 Claude Code 的 `claude` template 和 Codex 的 `codex` template。NiceEval 提供一个 E2B 专用的薄封装,让你从这两个官方起点继续用 E2B 原生 API 构建。E2B 没有官方的 Bub template,所以 Bub 分支和 `bubAgent()` 使用同一套固定依赖和 OTel 插件。
|
|
35
|
+
|
|
36
|
+
NiceEval 还发布了三份任何 E2B Team 都能引用的公共模板。完整的名字和版本由 NiceEval 维护,直接用常量:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import {
|
|
40
|
+
NICEEVAL_CLAUDE_CODE_E2B_TEMPLATE,
|
|
41
|
+
NICEEVAL_CODEX_E2B_TEMPLATE,
|
|
42
|
+
NICEEVAL_BUB_E2B_TEMPLATE,
|
|
43
|
+
} from "niceeval/sandbox/e2b-template";
|
|
44
|
+
|
|
45
|
+
e2bSandbox({ template: NICEEVAL_CLAUDE_CODE_E2B_TEMPLATE })
|
|
46
|
+
e2bSandbox({ template: NICEEVAL_CODEX_E2B_TEMPLATE })
|
|
47
|
+
e2bSandbox({ template: NICEEVAL_BUB_E2B_TEMPLATE })
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
这些模板都实际启动验证过:Claude Code `2.1.207`、Codex `0.144.1`、Bub `0.4.0`。模板版本号跟着里面的 Agent 走,形如 `0.144.1-r1`,即 Agent 版本加 NiceEval 的构建修订号。三个 Agent 各自独立发版,和 NiceEval 库的版本无关。所以项目里直接用常量,不要复制这些字符串,也不用自己跟踪版本。派生模板需要记下基础模板时,同样用常量的值。
|
|
51
|
+
|
|
52
|
+
这批公共模板里,Claude Code 模板沿用 E2B 官方的 `/usr` npm prefix,普通用户不能直接写全局模块。运行时要再装 pnpm、yarn 等全局 Node 工具时,显式装到 `/usr/local`,两个模板都已经把它加进 PATH:
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
await t.sandbox.runCommand("npm", [
|
|
56
|
+
"install", "-g", "--prefix", "/usr/local", "pnpm@10.34.5",
|
|
57
|
+
]);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
不要改用 `sudo npm install -g`,模板里已有的 root 全局包可能产生文件冲突。NiceEval 会在之后发布的模板里统一这个默认 prefix;在发布说明明确新模板已经处理之前,继续保留 `--prefix /usr/local`。
|
|
61
|
+
|
|
62
|
+
从官方 Codex template 派生自己的模板:
|
|
63
|
+
|
|
64
|
+
```ts title="scripts/build-e2b-template.ts"
|
|
65
|
+
import { Template } from "e2b";
|
|
66
|
+
import { e2bCodingAgentTemplate } from "niceeval/sandbox/e2b-template";
|
|
67
|
+
|
|
68
|
+
const template = e2bCodingAgentTemplate("codex")
|
|
69
|
+
.aptInstall(["ripgrep", "jq"])
|
|
70
|
+
.runCmd("corepack enable && pnpm --version")
|
|
71
|
+
.copy("fixtures/toolchain.lock", "/opt/evals/toolchain.lock");
|
|
72
|
+
|
|
73
|
+
await Template.build(template, "acme-codex-evals:0.144.1-r1", {
|
|
74
|
+
cpuCount: 2,
|
|
75
|
+
memoryMB: 4096,
|
|
76
|
+
});
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
e2b auth login
|
|
81
|
+
pnpm tsx scripts/build-e2b-template.ts
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
然后在 Experiment 里只引用构建结果:
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
import { e2bSandbox } from "niceeval/sandbox";
|
|
88
|
+
|
|
89
|
+
sandbox: e2bSandbox({ template: "acme-codex-evals:0.144.1-r1" })
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
也可以直接从 NiceEval 公共模板继续派生,只为项目自己的依赖付构建时间:
|
|
93
|
+
|
|
94
|
+
```ts
|
|
95
|
+
import { NICEEVAL_CODEX_E2B_TEMPLATE } from "niceeval/sandbox/e2b-template";
|
|
96
|
+
|
|
97
|
+
const template = Template()
|
|
98
|
+
.fromTemplate(NICEEVAL_CODEX_E2B_TEMPLATE)
|
|
99
|
+
.aptInstall(["ripgrep", "jq"])
|
|
100
|
+
.runCmd("corepack enable");
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
`e2bCodingAgentTemplate("claude-code" | "codex" | "bub")` 返回 E2B 原生的 `TemplateBuilder`,可以继续用 `.aptInstall()`、`.runCmd()`、`.copy()` 等 E2B 能力。构建出的 alias 把官方起点和项目依赖固定在同一个可复现的结果里。依赖变了就重新构建,换一个带版本号的 alias。
|
|
104
|
+
|
|
105
|
+
Bub Adapter 配了 `pythonPlugins` 时,构建模板时要把同一组包传给 factory。这样运行时才会识别出插件已经预装:
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
e2bCodingAgentTemplate("bub", {
|
|
109
|
+
bubPythonPackages: ["bub-plugin-memory==1.3.0"],
|
|
110
|
+
})
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Docker:使用 NiceEval 维护的镜像,或从官方 node 基础镜像派生
|
|
114
|
+
|
|
115
|
+
要直接运行 NiceEval 内置的 `claude-code`、`codex` 或 `bub` Adapter,可以用对应的公开镜像:[`niceeval/claude-code`](https://hub.docker.com/r/niceeval/claude-code)、[`niceeval/codex`](https://hub.docker.com/r/niceeval/codex) 或 [`niceeval/bub`](https://hub.docker.com/r/niceeval/bub)。
|
|
116
|
+
|
|
117
|
+
每个镜像只装自己的 Agent CLI,同时提供 `linux/amd64` 和 `linux/arm64` 版本。tag 和对应的 E2B 公共模板同号,版本号是镜像里 Agent 的版本。稳定的 CI 用具名常量或 digest,不要用会变的 `latest`:
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
import { NICEEVAL_CODEX_DOCKER_IMAGE, dockerSandbox } from "niceeval/sandbox";
|
|
121
|
+
|
|
122
|
+
sandbox: dockerSandbox({ source: { type: "image", image: NICEEVAL_CODEX_DOCKER_IMAGE } })
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
这些是 NiceEval 维护的公开镜像,不是 Docker 的 `library/*` 官方镜像。Agent 版本或构建方式变化时才发布新 tag,和 NiceEval 库的发版节奏无关。
|
|
126
|
+
|
|
127
|
+
只需要一个 Agent,或者还要加项目自己的依赖时,写 Dockerfile 从 Docker 官方的 `node:24-slim` 派生:
|
|
128
|
+
|
|
129
|
+
```dockerfile title="Dockerfile"
|
|
130
|
+
FROM node:24-slim
|
|
131
|
+
# slim 镜像不带 ca-certificates / git,Agent 和 npm 都要用
|
|
132
|
+
RUN apt-get update \
|
|
133
|
+
&& apt-get install -y --no-install-recommends ca-certificates git \
|
|
134
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
135
|
+
# npm 全局装进 /usr/local/bin,正好在 Sandbox 的 PATH 上
|
|
136
|
+
RUN npm install -g @openai/codex@0.144.1
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
docker build -t acme-codex-evals:0.144.1-r1 .
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
然后在 Experiment 里只引用构建结果:
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
import { dockerSandbox } from "niceeval/sandbox";
|
|
147
|
+
|
|
148
|
+
sandbox: dockerSandbox({ source: { type: "image", image: "acme-codex-evals:0.144.1-r1" } })
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Docker Sandbox 用镜像自己声明的用户运行命令。上面的 Dockerfile 没写 `USER`,所以默认以 root 运行,`/usr/local/bin` 已经在 root 的 PATH 上,`npm install -g` 装的命令可以直接用。
|
|
152
|
+
|
|
153
|
+
需要非 root 用户时(比如 Claude Code 在 root 下会拒绝 `--dangerously-skip-permissions`),在 Dockerfile 里加一行 `USER node`,`node:24-slim` 自带这个用户。也可以用 `dockerSandbox({ source: { type: "image", image }, user: "node" })` 覆盖。
|
|
154
|
+
|
|
155
|
+
Agent 装到别处时(比如 `~/.local/bin`),记得把那个目录加进 PATH。`dockerSandbox` 必须写明 image,稳定的 CI 引用不会变的 tag。
|
|
156
|
+
|
|
157
|
+
### Vercel:从官方 runtime 拍快照
|
|
158
|
+
|
|
159
|
+
Vercel 没有 E2B 那样的 template 仓库,也不用 Dockerfile。Vercel 的快照是从一台运行中的 microVM 拍下来的:用 Vercel SDK 从官方 runtime(`node24`)启动一台 Sandbox,装好 Agent CLI,调用 `.snapshot()` 拿到 `snap_...`,再交给 `vercelSandbox({ snapshotId })`:
|
|
160
|
+
|
|
161
|
+
```ts title="scripts/build-vercel-snapshot.ts"
|
|
162
|
+
import { Sandbox } from "@vercel/sandbox";
|
|
163
|
+
|
|
164
|
+
const sandbox = await Sandbox.create({ runtime: "node24" }); // 从官方 runtime 启动 microVM
|
|
165
|
+
await sandbox.runCommand({
|
|
166
|
+
cmd: "npm",
|
|
167
|
+
args: ["install", "-g", "@openai/codex@0.144.1"],
|
|
168
|
+
sudo: true, // 全局装进 /usr/local/bin,正好在 Sandbox 的 PATH 上
|
|
169
|
+
});
|
|
170
|
+
const { snapshotId } = await sandbox.snapshot();
|
|
171
|
+
console.log(snapshotId); // snap_...
|
|
172
|
+
await sandbox.stop();
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
pnpm tsx scripts/build-vercel-snapshot.ts
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
然后在 Experiment 里引用打印出的 ID:
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
import { vercelSandbox } from "niceeval/sandbox";
|
|
183
|
+
|
|
184
|
+
sandbox: vercelSandbox({ snapshotId: "snap_xxx" })
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Vercel 快照不能像 E2B 那样公开发布。快照 ID 受创建它的 Team/Project 权限控制,同一个项目的成员可以复用,其他人要在自己的 Vercel Project 里重新拍一份。NiceEval 项目自己验证过、永不过期的快照是 `snap_7sIjfs71xfmVly0WEUTGhTBoMGeL`,但它不能跨账号使用。
|
|
188
|
+
|
|
189
|
+
## 运行时 checkpoint
|
|
190
|
+
|
|
191
|
+
`createCheckpoint()` / `restoreCheckpoint()` 解决的是另一件事:把 Sandbox 里指定的 Linux 路径打包成 `Buffer`,再恢复到另一台已经创建好的 Sandbox:
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
import { createCheckpoint, restoreCheckpoint } from "niceeval/sandbox";
|
|
195
|
+
|
|
196
|
+
const data = await createCheckpoint(sandbox, ["/home/user/.cache/tool"]);
|
|
197
|
+
await restoreCheckpoint(nextSandbox, data);
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
它适合运行时的缓存,不会产生可发布的 image、template 或快照,也不管共享、版本和过期。打包或恢复失败会直接抛错。
|
|
201
|
+
|
|
202
|
+
要让这些目录在 Attempt 之间延续,在动态 `.before()` 里调用 `restoreCheckpoint()`。恢复成功后,用 `context.onCleanup()` 登记 `createCheckpoint()`,这样回存会在 Sandbox 销毁之前完成。
|
|
203
|
+
|
|
204
|
+
`sandboxReuse: true` 只在一次 `niceeval exp` 命令内部保留同一台 Sandbox。几个终端同时运行、都要读写同一份 checkpoint 时,在 Experiment 顶层声明 `sharedState: { key }`。NiceEval 在 Experiment `setup` 和创建 Sandbox 之前取得这个 key 的租约,等 checkpoint 回存、Sandbox 销毁和 Experiment `teardown` 都完成后才释放。它只保证同一时刻只有一方在用,不负责保存 checkpoint、出错回滚或跨机器协调。
|