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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "标准事件流参考"
|
|
3
3
|
sidebarTitle: "事件流"
|
|
4
|
-
description: "StreamEvent
|
|
4
|
+
description: "StreamEvent 的十种事件:每种的字段、何时产出、哪些断言读取它。Adapter 的主要工作就是产出这条流。"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Adapter 的 `send` 返回一个 `Turn`,其中 `events: StreamEvent[]` 是本轮的标准事件流,事件断言都从这里读取事实。`turn.calledTool(...)`、`turn.toolOrder(...)`、`turn.event(...)` 和 `turn.succeeded()` 都根据本轮事件和其中的工具调用来判断,调用时直接登记一条断言。把 agent 这一轮做了什么如实翻译成这条流,事件断言就都能用。
|
|
8
8
|
|
|
9
9
|
## Turn:send 的返回值
|
|
10
10
|
|
|
@@ -17,7 +17,7 @@ interface Turn {
|
|
|
17
17
|
}
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
`data`
|
|
20
|
+
`data` 放本轮的结构化产物。只有应用的回答本身是结构化对象时才填,例如抽取、分类和表单填充,评估作者可以用 `t.check(turn.data, ...)` 比较它。只返回文本的应用不填 `data`。不要把原始响应 body 或 `message` 文本复制进去,也不要把结构化输出序列化后写进 `events`。`usage` 拿得到就填,拿不到就留空,不要估一个数字填进去。
|
|
21
21
|
|
|
22
22
|
`usage` 的完整字段(`Usage` 类型):
|
|
23
23
|
|
|
@@ -87,11 +87,13 @@ token 用量或 OTel span 反推得到)。与顶层 `estimatedCostUSD`(价目表
|
|
|
87
87
|
|
|
88
88
|
{/* GENERATED:END usage-fields */}
|
|
89
89
|
|
|
90
|
-
>
|
|
90
|
+
> 成本怎么算:`Usage.costUSD` 只记录 Provider 或 Adapter 实际返回的美元成本,不会由 token 数、模型目录或本地价目表推算。无论有没有这个值,Runner 都会根据 `model`、上报的 token 用量和配置里的价目表另算一份估算成本 `estimatedCostUSD`。
|
|
91
|
+
>
|
|
92
|
+
> Experiment 的预算和 `t.maxCost()` 看的是这份估算,不看 `Usage.costUSD`。报告里的成本只按你显式指定的 `PricingProfile` 和已记录的用量计算,也不读 Runner 的估算。
|
|
91
93
|
|
|
92
94
|
## StreamEvent 变体一览
|
|
93
95
|
|
|
94
|
-
`StreamEvent`
|
|
96
|
+
`StreamEvent` 有十种变体,下面逐个列出字段。哪些断言读取它们、使用时要注意什么,见后面的「事件总表」和「逐事件说明」。
|
|
95
97
|
|
|
96
98
|
{/* GENERATED:BEGIN stream-events */}
|
|
97
99
|
|
|
@@ -200,14 +202,14 @@ token 用量或 OTel span 反推得到)。与顶层 `estimatedCostUSD`(价目表
|
|
|
200
202
|
| `message` | agent(或用户)说了一段话 | `turn.message`、`turn.event(eventMatch("message", ...))`、Judge 的材料 |
|
|
201
203
|
| `operation.started`(`kind: "tool"`) | 发起一次工具调用 | `turn.calledTool(...)`、`turn.toolOrder(...)`、`turn.event(...)` |
|
|
202
204
|
| `operation.finished`(`kind: "tool"`) | 该次工具调用的结果 | 带状态条件的 `ToolMatch` |
|
|
203
|
-
| `operation.started`(`kind: "subagent"`) | 委派一个子 agent |
|
|
204
|
-
| `operation.finished`(`kind: "subagent"`) | 子 agent 返回 |
|
|
205
|
+
| `operation.started`(`kind: "subagent"`) | 委派一个子 agent | 保留在原始事件和报告里;没有子 agent 专用断言 |
|
|
206
|
+
| `operation.finished`(`kind: "subagent"`) | 子 agent 返回 | 保留在原始事件和报告里;失败会计入 `noFailedActions()` |
|
|
205
207
|
| `input.requested` | 停下来等人输入(HITL) | `t.check(turn.status, equals("waiting"))`、`t.requireInputRequest()` |
|
|
206
|
-
| `thinking` | 思考文本 | view
|
|
207
|
-
| `compaction` | 上下文被压缩 | view
|
|
208
|
-
| `error` | 本轮出错 | view
|
|
208
|
+
| `thinking` | 思考文本 | 在 view 中展示;需要时用 `t.check(turn.events, ...)` 检查 |
|
|
209
|
+
| `compaction` | 上下文被压缩 | 在 view 中展示;需要时用 `t.check(turn.events, ...)` 检查 |
|
|
210
|
+
| `error` | 本轮出错 | 在 view 中展示;需要时用 `t.check(turn.events, ...)` 检查 |
|
|
209
211
|
|
|
210
|
-
|
|
212
|
+
事件断言有三个入口:`event(match)`、`notEvent(match)` 和 `eventOrder(matches)`,都接收 `eventMatch(...)` 构造的匹配条件。`eventMatch` 支持 `message`、工具 `operation.started` 和工具 `operation.finished` 三种事件。要求出现几次,用匹配条件自己的 `.atLeast()`、`.exactly()` 等方法指定。其它事件可以把 `turn.events` 当作普通值,用 `check(turn.events, valueMatch)` 检查。
|
|
211
213
|
|
|
212
214
|
## 逐事件说明
|
|
213
215
|
|
|
@@ -217,7 +219,7 @@ token 用量或 OTel span 反推得到)。与顶层 `estimatedCostUSD`(价目表
|
|
|
217
219
|
{ type: "message", role: "assistant" | "user", text: string }
|
|
218
220
|
```
|
|
219
221
|
|
|
220
|
-
|
|
222
|
+
每段助手文本产出一条 `role: "assistant"` 的 `message`。工具结果不是助手消息,不要把工具输出包成 `message`,否则 `t.reply` 会读到错误的内容。用户输入的 `message` 由 NiceEval 自动记录,Adapter 不用产出。
|
|
221
223
|
|
|
222
224
|
### 工具 `operation.started` / `operation.finished` —— 调了什么工具、结果如何
|
|
223
225
|
|
|
@@ -229,14 +231,14 @@ token 用量或 OTel span 反推得到)。与顶层 `estimatedCostUSD`(价目表
|
|
|
229
231
|
output?: JsonValue, status: "completed" | "failed" | "rejected" }
|
|
230
232
|
```
|
|
231
233
|
|
|
232
|
-
-
|
|
233
|
-
- `status`
|
|
234
|
-
- `name`
|
|
235
|
-
- 只有 started
|
|
234
|
+
- 每个工具 `operation.started` 都要配一个 `operationId` 相同的工具 `operation.finished`,并发调用靠这个 ID 对上号。agent 返回里有现成的 ID 就直接用,例如 AI SDK 的 `toolCallId`、Anthropic 的 `tool_use.id`;没有时再按顺序生成。
|
|
235
|
+
- `status` 按实际情况填:工具执行失败填 `"failed"`,被人否决填 `"rejected"`。评估作者会用 `ToolMatch` 的状态条件区分这两种情况,不要混用。
|
|
236
|
+
- `name` 填工具的原始名字。
|
|
237
|
+
- 只有 started、还没有 finished 时,这次调用的状态是 `pending`,输出记为拿不到。finished 不带 `output` 也表示输出拿不到。缺失的输出不要写成空 JSON,也不要让它看起来像一次普通的不匹配。
|
|
236
238
|
|
|
237
239
|
#### 将工具事件交给 `ToolMatch`
|
|
238
240
|
|
|
239
|
-
同一个 `shell`
|
|
241
|
+
同一个 `shell` 工具可能先运行 `git status`,再运行 `pnpm test`。工具名只能说明是哪类工具。要分辨具体命令,评估作者用整理好的命令信息(command projection)来匹配:
|
|
240
242
|
|
|
241
243
|
```ts
|
|
242
244
|
import { commandMatch } from "niceeval/expect";
|
|
@@ -244,9 +246,9 @@ import { commandMatch } from "niceeval/expect";
|
|
|
244
246
|
turn.calledTool(commandMatch("pnpm", { argsStart: ["test"] }));
|
|
245
247
|
```
|
|
246
248
|
|
|
247
|
-
`ToolMatch`
|
|
249
|
+
`ToolMatch` 每次比较一次工具调用。完整的筛选条件,以及 JSON、路径、输出和计数规则,见 [Scoped assertions](https://github.com/NiceEval/NiceEval/blob/main/docs/feature/assertions/library/scoped-assertions.md)。
|
|
248
250
|
|
|
249
|
-
|
|
251
|
+
原生协议直接给出一条命令的结构化 argv 时,用 `niceeval/adapter` 导出的构造器生成命令信息:
|
|
250
252
|
|
|
251
253
|
```ts
|
|
252
254
|
import { commandProjection } from "niceeval/adapter";
|
|
@@ -267,9 +269,11 @@ events.push({
|
|
|
267
269
|
});
|
|
268
270
|
```
|
|
269
271
|
|
|
270
|
-
`commandProjection()` 保留 Adapter
|
|
272
|
+
`commandProjection()` 保留 Adapter 确认过的原始参数,并按 NiceEval 统一的规则整理成 `logical-command/v1` 格式。例如 `pnpm exec niceeval view` 能被 `commandMatch("niceeval", { argsStart: ["view"] })` 精确匹配。
|
|
271
273
|
|
|
272
|
-
|
|
274
|
+
只有原生协议本身给出了 argv,或者能按协议语法明确拆出唯一一条命令时,才能把原始命令标为可用(`state: "available"`)。
|
|
275
|
+
|
|
276
|
+
协议只给出 shell 源码,或者内容被截断、脱敏时,用 `opaqueCommandProjection(reason)`。能确定这次调用不是命令时,用 `notCommandProjection()`。判断不了是不是命令时,降低 actions coverage,不要从工具名、输入或 shell 文本去猜。
|
|
273
277
|
|
|
274
278
|
### 子 agent `operation.started` / `operation.finished` —— 委派了谁
|
|
275
279
|
|
|
@@ -280,7 +284,7 @@ events.push({
|
|
|
280
284
|
output?: JsonValue, status: "completed" | "failed" }
|
|
281
285
|
```
|
|
282
286
|
|
|
283
|
-
被测系统把任务委派给子 agent
|
|
287
|
+
被测系统把任务委派给子 agent 并等它返回时,产出这一对事件,`operationId` 的配对规则同上。它们保留在原始事件流和报告里。要检查它们,对 `turn.events` 用普通的值匹配;`eventMatch(...)` 的工具匹配不会把子 agent 当成工具调用。
|
|
284
288
|
|
|
285
289
|
### `input.requested` —— 停下等人(HITL)
|
|
286
290
|
|
|
@@ -294,27 +298,27 @@ events.push({
|
|
|
294
298
|
} }
|
|
295
299
|
```
|
|
296
300
|
|
|
297
|
-
agent
|
|
301
|
+
agent 停下来等人时,每个待回答的问题产出一条 `input.requested`,同时这个 Turn 的 `status` 是 `"waiting"`。`t.requireInputRequest(filter)` 按字段匹配 `request`,所以能填的字段尽量填,否则评估用例筛选不到。接法见[接入教程的 HITL 部分](/zh/tutorials/connect-your-agent)。
|
|
298
302
|
|
|
299
303
|
### `thinking` / `compaction` / `error`
|
|
300
304
|
|
|
301
305
|
```ts
|
|
302
306
|
{ type: "thinking", text: string }
|
|
303
|
-
{ type: "compaction", reason?: string } //
|
|
307
|
+
{ type: "compaction", reason?: string } // 上下文压缩;Adapter 解析出来就产出
|
|
304
308
|
{ type: "error", message: string }
|
|
305
309
|
```
|
|
306
310
|
|
|
307
|
-
|
|
311
|
+
有就产出,没有不要编造。`compaction` 主要来自 coding agent CLI,上下文满了时会自动压缩。这些事件主要用于报告和诊断;需要断言时,把 `turn.events` 当作普通值交给 `check`。
|
|
308
312
|
|
|
309
|
-
##
|
|
313
|
+
## 映射事件的三条规则
|
|
310
314
|
|
|
311
|
-
1.
|
|
312
|
-
2.
|
|
313
|
-
3.
|
|
315
|
+
1. **按真实顺序排列**:事件顺序就是发生顺序。`toolOrder` 和 `eventOrder` 从前往后依次匹配不同的调用,顺序错了,断言结果就不对。`eventOrder` 只能排 `eventMatch` 支持的事件。
|
|
316
|
+
2. **用 `operationId` 配对**:每个 started 都要有 `kind` 和 ID 都相同的 finished。配对完整,NiceEval 才能把状态和输入归到同一次工具调用上。
|
|
317
|
+
3. **如实声明完整性**:官方转换器按 Adapter 的实际能力声明事件覆盖范围(evidence coverage)。相关的输入或动作覆盖不完整时,否定式断言(例如“没有调用某个工具”)的结果是 `unavailable`,不会把“没看到”当成“没发生”。手写映射也要如实声明覆盖范围,见[能力位参考](/zh/reference/capabilities)。
|
|
314
318
|
|
|
315
319
|
## 一个完整的映射示例
|
|
316
320
|
|
|
317
|
-
agent
|
|
321
|
+
agent 返回里带步骤记录时,映射就是一个简单的循环:
|
|
318
322
|
|
|
319
323
|
```ts
|
|
320
324
|
import type { StreamEvent } from "niceeval";
|
|
@@ -53,7 +53,7 @@ export function or(
|
|
|
53
53
|
#### `not`
|
|
54
54
|
|
|
55
55
|
```ts
|
|
56
|
-
export function not<T>(match: BooleanMatch<T,
|
|
56
|
+
export function not<T, R extends T>(match: BooleanMatch<T, R, "value">): BooleanMatch<T, T, "value"> { ... }
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
#### `includes`
|
|
@@ -156,7 +156,7 @@ export function satisfies<T, R extends T = T>(
|
|
|
156
156
|
```ts
|
|
157
157
|
export function defineValueMatch<T, R extends T = T>(spec: {
|
|
158
158
|
readonly name: string;
|
|
159
|
-
readonly evaluate: (value: T) => boolean | Promise<boolean>;
|
|
159
|
+
readonly evaluate: (value: T) => boolean | { readonly state: "unavailable"; readonly reason: string } | Promise<boolean | { readonly state: "unavailable"; readonly reason: string }>;
|
|
160
160
|
}): BooleanMatch<T, R> | BooleanMatch<T, T> { ... }
|
|
161
161
|
```
|
|
162
162
|
|
|
@@ -178,6 +178,59 @@ export function eventMatch<K extends keyof EventOptionsByType>(
|
|
|
178
178
|
): EventMatch<Extract<EventOccurrenceView, { readonly type: K }>> { ... }
|
|
179
179
|
```
|
|
180
180
|
|
|
181
|
+
#### `mapValue`
|
|
182
|
+
|
|
183
|
+
```ts
|
|
184
|
+
export function mapValue<T, U>(
|
|
185
|
+
label: string, project: (value: T) => U, match: Match<NoInfer<U>, "value"> & { readonly kind: "boolean" },
|
|
186
|
+
): BooleanMatch<T, T> { ... }
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Project a single value without replacing the original subject's refinement.
|
|
190
|
+
|
|
191
|
+
#### `mapEach`
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
export function mapEach<T, U, Subject extends CollectionValue<T>>(
|
|
195
|
+
project: (value: T) => U,
|
|
196
|
+
aggregate: Match<CollectionValue<NoInfer<U>>, "value"> & { readonly kind: "boolean" },
|
|
197
|
+
): BooleanMatch<Subject & CollectionValue<T>, Subject> { ... }
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Project each complete item, retaining its material identity and order.
|
|
201
|
+
|
|
202
|
+
#### `filterWhere`
|
|
203
|
+
|
|
204
|
+
```ts
|
|
205
|
+
export function filterWhere<T, R extends T, Subject extends CollectionValue<T>>(
|
|
206
|
+
selector: BooleanMatch<T, R>, aggregate: BooleanMatch<CollectionValue<R>, CollectionValue<R>>,
|
|
207
|
+
): BooleanMatch<Subject, Subject> { ... }
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Select only definite matches; an unknown selector makes the aggregate unavailable.
|
|
211
|
+
|
|
212
|
+
#### `countWhere`
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
export function countWhere<T, Subject extends CollectionValue<T>>(
|
|
216
|
+
item: BooleanMatch<T, NoInfer<T>>, count: Match<number, "value"> & { readonly kind: "boolean" },
|
|
217
|
+
): BooleanMatch<Subject, Subject> { ... }
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Compare an exact match count only after every item in a complete collection is known.
|
|
221
|
+
|
|
222
|
+
#### `defineMaterialMatch`
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
export function defineMaterialMatch(definition: unknown): ContextualMatch { ... }
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
#### `defineContextMatch`
|
|
229
|
+
|
|
230
|
+
```ts
|
|
231
|
+
export function defineContextMatch(definition: unknown): ContextualMatch { ... }
|
|
232
|
+
```
|
|
233
|
+
|
|
181
234
|
{/* GENERATED:END expect-matchers */}
|
|
182
235
|
|
|
183
236
|
### 匹配工具调用
|
|
@@ -276,6 +329,28 @@ readonly kind: "score";
|
|
|
276
329
|
|
|
277
330
|
{/* GENERATED:END value-assertion */}
|
|
278
331
|
|
|
332
|
+
## 集合中的先后条件
|
|
333
|
+
|
|
334
|
+
`inOrder` 可以把 2–64 个普通值 Match 组合成集合 Match,交给 `t.check` 或应用的集合断言方法。
|
|
335
|
+
它接受只读数组或带完整性状态的 `MaterialCollection`,按原位置寻找严格递增的子序列,不要求相邻。
|
|
336
|
+
|
|
337
|
+
```ts
|
|
338
|
+
import { equals, inOrder, not, or } from "niceeval/expect";
|
|
339
|
+
|
|
340
|
+
t.check([1, 0, 2], inOrder([equals(1), equals(2)])).gate();
|
|
341
|
+
t.check([2, 1], not(inOrder([equals(1), equals(2)]))).gate();
|
|
342
|
+
t.check([3, 4], or(
|
|
343
|
+
inOrder([equals(1), equals(2)]),
|
|
344
|
+
inOrder([equals(3), equals(4)]),
|
|
345
|
+
)).gate();
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
同一项不能满足两个步骤,每个步骤内部可以用 `and` 约束同一事实。应用负责提供正式提交顺序;请求发出不代表操作采用或执行完成。
|
|
349
|
+
只要求双方都发言时,分别检查存在性即可。
|
|
350
|
+
|
|
351
|
+
不完整集合返回不可判定。完整集合有已知顺序证据时通过,没有可能的顺序时失败,只有依赖未知项才能成立时不可判定。
|
|
352
|
+
诊断保留原位置、材料 ID 和步骤判断。ToolMatch 与 EventMatch 的顺序组合保留各自的 Agent 范围,不能和普通值步骤混用。
|
|
353
|
+
|
|
279
354
|
## 自定义 matcher
|
|
280
355
|
|
|
281
356
|
```ts
|
|
@@ -16,7 +16,7 @@ description: "NiceEval 内置的 Sandbox 和非 Sandbox 适配器分别是什么
|
|
|
16
16
|
|
|
17
17
|
- **鉴权**:`ANTHROPIC_API_KEY`(工厂参数 `apiKey` 可覆盖),可选 `ANTHROPIC_BASE_URL`(工厂参数 `baseUrl`)。
|
|
18
18
|
- **装 MCP server**:`mcpServers` 配置项,`setup` 阶段写进 Sandbox 里用户级的 `~/.claude.json`(顶层 `mcpServers` 字段)。两种形态按字段区分:本地 stdio 进程写 `command`(可带 `args` / `env`)。远程 Streamable HTTP 端点写 `url`(可带 `headers`,逐字进请求头,常用于 `Authorization`),写成 `{ "type": "http", "url": …, "headers": … }` 条目。`url` 要 Sandbox 内可达:服务跑在你自己机器上时,先用 cloudflared / tailscale 这类隧道暴露成公网地址。
|
|
19
|
-
- **装 Skill**:`skills: SkillSpec[]`。本地 Skill(`{ kind: "local", path }`,从项目根读文件或目录)或 Repo Skill(`{ kind: "repo", source, ref, skills }`,可钉 commit/tag、可只启用多 Skill 仓库里的一部分)。装进 Sandbox 的 project 级 `.claude/skills/<name>/`,claude CLI 原生发现。adapter 会把原生 `Skill` 调用归一为 `skill.loaded` 原始事件,不重复记成工具调用;当前公开 Assert-first API 没有专用 Skill 断言,也不能把它伪装成 `calledTool("Skill"
|
|
19
|
+
- **装 Skill**:`skills: SkillSpec[]`。本地 Skill(`{ kind: "local", path }`,从项目根读文件或目录)或 Repo Skill(`{ kind: "repo", source, ref, skills }`,可钉 commit/tag、可只启用多 Skill 仓库里的一部分)。装进 Sandbox 的 project 级 `.claude/skills/<name>/`,claude CLI 原生发现。adapter 会把原生 `Skill` 调用归一为 `skill.loaded` 原始事件,不重复记成工具调用;当前公开 Assert-first API 没有专用 Skill 断言,也不能把它伪装成 `calledTool("Skill")`。
|
|
20
20
|
- **装原生 Plugin**:`plugins: ClaudeCodePluginSpec[]`,每一项声明 Marketplace 连接(`name` / `source` / 可选 `ref`)和其中的 Plugin 名。这个类型只属于 claude-code,传不进 codex。复用 Sandbox 的 Experiment 不用额外处理残留:每条 Attempt 开始前,同名 marketplace 注册与已装 Plugin 都会按声明的 `source` / `ref` 重新安装。
|
|
21
21
|
- **官方配置文件**:`settingsFile` 是运行 NiceEval 的机器上的本地项目路径,不是 Sandbox 内路径。它指向一份完整的 Claude Code `settings.json`。路径相对项目根,只允许普通相对路径或 `./` 前缀。`..`、绝对路径、`~` 和解析后逃出项目根的符号链接都会报错。
|
|
22
22
|
|
|
@@ -123,7 +123,7 @@ export default defineExperiment({
|
|
|
123
123
|
- **鉴权**:`BUB_API_KEY` + `BUB_API_BASE`(OpenAI 兼容代理),工厂参数 `apiKey` / `apiBase` 可覆盖。
|
|
124
124
|
- **装 Skill**:`skills: SkillSpec[]`,与另外两个 Adapter 同一个类型。装进 `.agents/skills/<name>/`,发现指引写进 AGENTS.md。
|
|
125
125
|
- **装插件**:`pythonPlugins: PythonPluginSpec[]`(`{ package }`:PyPI 包、版本约束或 git URL),`setup` 阶段进 `uv tool install … --with <package>`。这个类型只属于 bub。package 集合进安装 checkpoint key,插件不同的两个变体不会复用同一份安装缓存。
|
|
126
|
-
- **预制 Bub**:NiceEval 的 E2B 配方会把 Bub、OTel 插件和 Python 插件集合算成安装指纹。Adapter 只复用指纹完全一致的环境。仅在 PATH 里放一个 `bub` 不足以证明兼容。构建入口见 [Sandbox
|
|
126
|
+
- **预制 Bub**:NiceEval 的 E2B 配方会把 Bub、OTel 插件和 Python 插件集合算成安装指纹。Adapter 只复用指纹完全一致的环境。仅在 PATH 里放一个 `bub` 不足以证明兼容。构建入口见 [预制 Sandbox 环境 · 从官方基线继续构建](/zh/tutorials/prebuilt-sandbox#从官方基线继续构建)。
|
|
127
127
|
- bub 没有 `mcpServers`——MCP 只属于支持它的 Adapter,Config 上压根没有这个字段。
|
|
128
128
|
- **安装后脚本**:`postSetup: SandboxCommand[]`,语义与另外两个 Adapter 相同:全部安装步骤完成后按序在 Sandbox 里跑 command。成对的 `preTeardown: SandboxCommand[]` 按逆序在 agent teardown 之前收尾,当且仅当 `postSetup` 的时点已经走到才触发。
|
|
129
129
|
- **安装方式**:走 `uv tool install`(PyPI 包,不是 npm 包),首次安装会建 checkpoint 缓存加速后续 Sandbox。
|
|
@@ -4,22 +4,29 @@ sidebarTitle: "保留 Sandbox 现场"
|
|
|
4
4
|
description: "用 --keep-sandbox 把失败 Attempt 的 Sandbox 保留成可随时唤醒的现场,用 niceeval sandbox enter 进去手动排查,用 sandbox list / stop 查看和清理。"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Sandbox 默认在每个 Attempt
|
|
7
|
+
Sandbox 默认在每个 Attempt 结束后销毁。大多数问题先用 `niceeval show @<attempt-locator>` 或 `niceeval view` 查看判定、断言、文件改动、命令和对话就能定位,完整路线见[排查手册](/zh/troubleshooting/debugging)。
|
|
8
8
|
|
|
9
9
|
但有些问题只能进活的环境里看:
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
- **改动落在 `git diff`
|
|
13
|
-
-
|
|
11
|
+
- **环境起不来**:setup 阶段装依赖失败、agent CLI 启动不了。这时 agent 还没开始跑,对话记录是空的,最快的办法是进 Sandbox 手动重跑一遍安装命令。
|
|
12
|
+
- **改动落在 `git diff` 之外**:全局装了什么包、`$HOME` 下写了什么配置、`PATH` 实际是什么,保存下来的文件改动不包含这些内容。
|
|
13
|
+
- **重跑太慢**:冷启动加安装要几分钟。想逐条验证猜测时,留着现场比每次重跑快得多。
|
|
14
14
|
|
|
15
15
|
## 跑的时候保留现场
|
|
16
16
|
|
|
17
|
+
在 `niceeval exp` 上加 `--keep-sandbox`:
|
|
18
|
+
|
|
17
19
|
```bash
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
pnpm exec niceeval exp local onboarding/tool-first --keep-sandbox # 等价 --keep-sandbox=failed
|
|
21
|
+
pnpm exec niceeval exp local onboarding/tool-first --keep-sandbox=all # 通过的也保留
|
|
20
22
|
```
|
|
21
23
|
|
|
22
|
-
`--keep-sandbox`
|
|
24
|
+
`--keep-sandbox` 有两档:
|
|
25
|
+
|
|
26
|
+
- `failed`(默认值)保留判定为 `failed` 或 `errored` 的 Attempt,包括超时被打断的。
|
|
27
|
+
- `all` 连通过的也保留。调 setup Hook、核对通过时环境的真实状态时用它,不用故意让一条评估用例失败。
|
|
28
|
+
|
|
29
|
+
不带这个参数时全部销毁。加了 `--keep-sandbox` 的运行总会真实执行,不会沿用上次的结果。
|
|
23
30
|
|
|
24
31
|
运行结束后,摘要里会列出保留了哪些 Sandbox、怎么进去:
|
|
25
32
|
|
|
@@ -30,36 +37,48 @@ Kept sandboxes (1)
|
|
|
30
37
|
Stop them with: niceeval sandbox stop --all
|
|
31
38
|
```
|
|
32
39
|
|
|
33
|
-
每行给三样东西:Attempt
|
|
40
|
+
每行给三样东西:Attempt locator、Sandbox 实例 id、进入现场的命令。这次 Attempt 保存下来的结果,用 `niceeval show @<attempt-locator>` 或 `niceeval view --run <run-id>` 查看。
|
|
34
41
|
|
|
35
|
-
|
|
42
|
+
保留下来的 Sandbox 不会一直跑着消耗资源:Docker 容器停在磁盘上,E2B 微 VM 暂停计费,Vercel 保存文件系统。
|
|
43
|
+
|
|
44
|
+
## 进入现场
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pnpm exec niceeval sandbox enter a3f9c2d1
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`niceeval sandbox enter` 会先唤醒再进入,在工作目录打开 shell。进去之后就是这次 Attempt 跑完时的环境,可以手动执行命令、翻文件、复现失败。
|
|
51
|
+
|
|
52
|
+
退出 shell 后,现场自动回到休眠。想让它保持运行,加 `--leave-running`。
|
|
36
53
|
|
|
37
54
|
## 查看和清理
|
|
38
55
|
|
|
39
|
-
保留下来的 Sandbox
|
|
56
|
+
保留下来的 Sandbox 由项目记录在案,用 `niceeval sandbox` 管理:
|
|
40
57
|
|
|
41
58
|
```bash
|
|
42
|
-
niceeval sandbox list #
|
|
43
|
-
niceeval sandbox enter a3f9c2d1 #
|
|
44
|
-
niceeval sandbox stop a3f9c2d1 #
|
|
45
|
-
niceeval sandbox stop --all # 全部销毁
|
|
59
|
+
pnpm exec niceeval sandbox list # 列出保留的 Sandbox 和现场状态
|
|
60
|
+
pnpm exec niceeval sandbox enter a3f9c2d1 # 唤醒并进入,退出后自动回到休眠
|
|
61
|
+
pnpm exec niceeval sandbox stop a3f9c2d1 # 销毁指定 Sandbox(id 可以只写唯一前缀)
|
|
62
|
+
pnpm exec niceeval sandbox stop --all # 全部销毁
|
|
46
63
|
```
|
|
47
64
|
|
|
48
|
-
这些管理命令不读取 `niceeval.config.ts`。即使配置文件暂时无法执行,你仍可以查看或销毁现场。命令会读取
|
|
49
|
-
`.env` 来准备 Provider 凭据;`.env` 不可读时先修复它,再重试。
|
|
65
|
+
这些管理命令不读取 `niceeval.config.ts`。即使配置文件暂时无法执行,你仍可以查看或销毁现场。命令会读取 `.env` 来准备 Provider 凭据;`.env` 不可读时,先修复它再重试。
|
|
50
66
|
|
|
51
|
-
`sandbox`
|
|
52
|
-
打印人读文本。机器输出参数只属于明确声明它的命令。
|
|
67
|
+
`sandbox` 命令没有 `--json` 输出。`niceeval sandbox list --json` 会直接提示 `Unknown option '--json'`,不会继续打印人读文本。
|
|
53
68
|
|
|
54
|
-
`stop`
|
|
69
|
+
`stop` 可以重复执行。Sandbox 已经不在了(手动删过、云端过期)不算错误,命令只会把记录移掉并说明。如果 Provider 销毁失败,命令会保留记录并返回错误,方便稍后重试,不会把仍活着的资源从列表里藏掉。
|
|
70
|
+
|
|
71
|
+
忘了清理也有提醒:下次运行开始时,如果还有上次保留的 Sandbox,终端会打一行提示。
|
|
55
72
|
|
|
56
73
|
## 各 Provider 的差别
|
|
57
74
|
|
|
58
|
-
- **Docker
|
|
59
|
-
- **E2B
|
|
60
|
-
- **Vercel Sandbox
|
|
61
|
-
- **自定义 Provider**:`defineSandbox` 产出的
|
|
75
|
+
- **Docker**:容器停在磁盘上,不占内存,重启 Docker 也还在,进入时自动启动。容器不会自己消失,是唯一需要主动清理的 Provider。除了 `niceeval sandbox stop`,也可以用 `docker ps -a -f label=niceeval.keep-candidate=true` 直接核对。
|
|
76
|
+
- **E2B**:暂停微 VM,文件和内存整体保存。暂停期间停止计费、无限期保留,进入时自动恢复。
|
|
77
|
+
- **Vercel Sandbox**:停止微 VM,文件系统保存、之后可恢复,但内存状态不保留,唤醒后进程要重新启动。超过 Provider 的保留期限后,`niceeval sandbox list` 会标成 `expired`。
|
|
78
|
+
- **自定义 Provider**:`defineSandbox` 产出的 Provider 不支持保留现场。事后的 `sandbox stop` 不加载用户配置,无法在新进程里安全找回你写的销毁函数。
|
|
62
79
|
|
|
63
80
|
## 边界
|
|
64
81
|
|
|
65
|
-
保留的 Sandbox
|
|
82
|
+
保留的 Sandbox 只用来排查,不能接着跑,也不能重新评分。判定、断言和文件改动以已经保存的结果为准。在现场里改了什么都不会写回结果。查看结果的方法见[查看运行结果](/zh/tutorials/viewing-results)。
|
|
83
|
+
|
|
84
|
+
运行被强杀后留下、没有登记的 Sandbox 不在 `sandbox list` 里,回收方法见[运行被强杀后恢复](/zh/troubleshooting/recover-after-kill#收回强杀留下的-sandbox)。
|
|
@@ -1,37 +1,58 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "
|
|
2
|
+
title: "排查失败的评估结果"
|
|
3
3
|
sidebarTitle: "排查手册"
|
|
4
|
-
description: "
|
|
4
|
+
description: "评估失败或出错时,从具体的 Run 或 Attempt 出发,用 show 逐层查看错误、对话、耗时和改动,找到是应用、Adapter、环境还是断言的问题。"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
一批评估跑完,有几条 `failed` 或 `errored`。你要找到原因:是应用答错了、Adapter 映射漏了、环境没起来,还是断言写得太紧。
|
|
8
|
+
|
|
9
|
+
从一个明确的 Run 或 Attempt 开始查。在终端用 `niceeval show`,在浏览器用 `niceeval view`;脚本和 CI 用 `query` 读 JSON。
|
|
10
|
+
|
|
11
|
+
## 从 Run 找到出问题的 Attempt
|
|
12
|
+
|
|
13
|
+
先看这次运行的整体情况。Run ID 在 `exp` 结束时的 `NEXT` 面板里:
|
|
8
14
|
|
|
9
15
|
```sh
|
|
10
|
-
niceeval show --run <run-id>
|
|
11
|
-
niceeval show @<attempt-locator>
|
|
16
|
+
pnpm exec niceeval show --run <run-id>
|
|
12
17
|
```
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
输出会列出这个 Run 的时间、各评估用例的判定、分数、结果覆盖、用量和限制。每个 Attempt 前面有一个以 `@` 开头的 locator,复制出问题的那一个:
|
|
15
20
|
|
|
16
21
|
```sh
|
|
17
|
-
niceeval show @<attempt-locator>
|
|
18
|
-
niceeval show @<attempt-locator> --execution
|
|
19
|
-
niceeval show @<attempt-locator> --timing
|
|
20
|
-
niceeval show @<attempt-locator> --usage
|
|
21
|
-
niceeval show @<attempt-locator> --diff
|
|
22
|
+
pnpm exec niceeval show @<attempt-locator>
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
这一屏先告诉你判定和断言摘要。`errored` 时会显示出错的阶段和完整错误正文,通常先看这里就够了。
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
## 按问题选择要看的内容
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
单看摘要还不够时,按你怀疑的方向加一个参数:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
pnpm exec niceeval show @<attempt-locator> --source
|
|
33
|
+
pnpm exec niceeval show @<attempt-locator> --execution
|
|
34
|
+
pnpm exec niceeval show @<attempt-locator> --timing
|
|
35
|
+
pnpm exec niceeval show @<attempt-locator> --usage
|
|
36
|
+
pnpm exec niceeval show @<attempt-locator> --diff
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
| 你想知道 | 参数 |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| 这次运行用的评估源码和每条断言的结果 | `--source` |
|
|
42
|
+
| Agent 说了什么、调用了哪些工具 | `--execution` |
|
|
43
|
+
| 时间花在哪个阶段,是不是卡在 setup | `--timing` |
|
|
44
|
+
| 这次用了多少 token、请求和费用 | `--usage` |
|
|
45
|
+
| Agent 改了哪些文件 | `--diff` |
|
|
46
|
+
|
|
47
|
+
`--execution` 显示的是精简过的执行过程。要展开其中一项,复制它旁边的 ID:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
pnpm exec niceeval show @<attempt-locator> --execution --expand <stable-id>
|
|
32
51
|
```
|
|
33
52
|
|
|
34
|
-
|
|
53
|
+
## 查清一条断言为什么得这个分
|
|
54
|
+
|
|
55
|
+
问题落在某一条断言上时,用 `query` 取结构化详情。它会返回这条断言的各项贡献、测量值和 Judge 给出的理由:
|
|
35
56
|
|
|
36
57
|
```text
|
|
37
58
|
query discover
|
|
@@ -40,58 +61,60 @@ query discover
|
|
|
40
61
|
→ attempt.assertion.detail(locator, entryId)
|
|
41
62
|
```
|
|
42
63
|
|
|
43
|
-
不要从 `show`
|
|
64
|
+
不要从 `show` 的排版文本反推断言字段。完整 request 示例见[查看运行结果](/zh/tutorials/viewing-results#看一条断言具体为什么得这个分)。
|
|
44
65
|
|
|
45
66
|
## 无法打开结果
|
|
46
67
|
|
|
47
68
|
| 错误 | 下一步 |
|
|
48
69
|
| --- | --- |
|
|
49
|
-
|
|
|
50
|
-
| `--record`
|
|
51
|
-
|
|
|
52
|
-
| Run 仍为 `active
|
|
70
|
+
| 找不到项目的结果文件 | 确认在项目目录里运行,并检查 `.niceeval/record.sqlite` 是否存在。 |
|
|
71
|
+
| `--record` 指定的文件被拒绝 | 确认它是运行结束后复制的完整单文件,复制期间没有别的进程在写。不要删除还没合并的 WAL 文件。外部文件会经过完整性和数据一致性校验。 |
|
|
72
|
+
| 不支持的格式版本或数据库无效 | 保留原文件,核实写入它的 NiceEval 版本。支持的历史格式会自动升级;未知格式或损坏的数据不会被修补,也不会只读一部分。 |
|
|
73
|
+
| Run 仍为 `active`,但原进程已经终止 | 先用 `pnpm exec niceeval run show <run-id>` 核对,再运行 `pnpm exec niceeval run recover <run-id> --yes`。 |
|
|
53
74
|
|
|
54
|
-
|
|
75
|
+
已发布的结果不能手动修改。需要不同的结果时,重新运行创建新的 Run。`niceeval run recover` 只会结束能证明原进程已经终止的 Run,已经发布的 Attempt 都会保留。完整步骤见[运行被强杀后恢复](/zh/troubleshooting/recover-after-kill)。
|
|
55
76
|
|
|
56
77
|
## 读取历史 Record
|
|
57
78
|
|
|
58
|
-
|
|
79
|
+
这里的格式版本是结果文件内部的标识,和 NiceEval 的 npm 包版本无关。不要通过修改数据库里的版本字段尝试升级。
|
|
59
80
|
|
|
60
|
-
`show`、`query`、`run list
|
|
81
|
+
`show`、`query`、`run list`、`run show` 与 `view` 可以直接读取 0.15、0.16、0.17 格式的历史结果文件。读取时 NiceEval 在私有副本里自动升级,原文件、Run、Attempt 和引用都保持不变,不需要先运行评估。
|
|
61
82
|
|
|
62
|
-
|
|
83
|
+
用 `--record` 读取时,文件必须是已经交付的完整单文件,读取期间不能被其它进程修改。文件还带着未合并的 WAL、仍有运行在写,或无法确认写入进程是否已经结束时,命令会拒绝读取。不要删除旁边的文件来绕过检查。
|
|
63
84
|
|
|
64
|
-
|
|
85
|
+
在项目里正常运行 `exp` 等写入命令时,NiceEval 会先备份、验证,再自动升级支持的旧格式。读取当前格式的项目时,不会执行升级或恢复。
|
|
65
86
|
|
|
66
87
|
## 结果不完整或无法比较
|
|
67
88
|
|
|
68
|
-
|
|
89
|
+
脚本或 CI 先运行 `pnpm --silent exec niceeval query discover` 找到合适的查询,再用 `explain` 检查 request,最后用 `run` 执行。结果会指出缺了哪些结果、有哪些问题、用了什么证据,以及怎样修正。
|
|
90
|
+
|
|
91
|
+
`query` 只输出 JSON,不适合人直接阅读。要逐项解释分数时,用 `attempt.get` 和 `attempt.assertion.detail`,不要只看汇总分数。
|
|
69
92
|
|
|
70
|
-
需要浏览器界面时运行 `niceeval view --run <run-id> --no-open`。不要解析 View
|
|
93
|
+
需要浏览器界面时运行 `pnpm exec niceeval view --run <run-id> --no-open`。不要解析 View 页面,也不要直接查询 SQLite 里的表。
|
|
71
94
|
|
|
72
|
-
|
|
95
|
+
比较两个 Run 用 `runs.compare`。它的 `exact` 和 `paired` 模式遇到无法对齐的评估或配对时会直接拒绝,不会悄悄缩小分母。
|
|
73
96
|
|
|
74
97
|
## 读懂成批错误
|
|
75
98
|
|
|
76
|
-
|
|
99
|
+
一次运行里,同一类已知错误第一次出现时,终端会立即给出完整原因、负责方、源码位置和下一步。运行结束时,再用摘要列出总次数、受影响的对象和源码位置。迁移指南按 `guideId` 只完整显示一次,不会为每个对象重复展开。
|
|
77
100
|
|
|
78
|
-
只有 `code`、`owner
|
|
101
|
+
只有 `code`、`owner`、修复目标与 `guideId` 四项完全相同的错误才会归为一组。摘要最多保留 32 组,每组最多展示 32 个受影响对象和 32 个源码位置;超出的数量会单独写明,每条原始错误仍各自保留。没有稳定来源的未知错误单独显示,不会仅凭相似的 message 或 stack 合并。
|
|
79
102
|
|
|
80
|
-
|
|
103
|
+
源码位置按已知调用点或 source map 定位,找不到时显示 unknown。NiceEval 不会为了报错扫描整个项目,也不要求应用开启额外的 AST 扫描。
|
|
81
104
|
|
|
82
105
|
## 旧项目状态阻塞运行
|
|
83
106
|
|
|
84
|
-
|
|
107
|
+
如果项目数据早于支持自动升级的格式,或错误提示旧的 `locks/`、`sessions/` 等目录阻塞写入,按下面步骤保留历史。上面说的 0.15、0.16、0.17 格式会自动升级,不需要走这个流程。
|
|
85
108
|
|
|
86
|
-
1.
|
|
87
|
-
2.
|
|
88
|
-
3.
|
|
89
|
-
4.
|
|
109
|
+
1. 停止原项目里仍在运行的 NiceEval 进程。不要根据锁文件的修改时间判断它能不能删。
|
|
110
|
+
2. 保留原项目和完整的 `.niceeval` 目录。需要查看历史时,在原项目里使用当时写入数据的 NiceEval 版本。不确定是哪个版本时,先保留现场再核实。
|
|
111
|
+
3. 把配置、评估用例、实验和其它项目文件复制到一个新目录,不复制 `.niceeval`,并在新目录安装当前版本的 NiceEval。
|
|
112
|
+
4. 在新目录运行原实验,例如 `pnpm exec niceeval exp <experiment> --rerun all`。新结果写进新目录的结果文件,原项目的历史数据保持原样。
|
|
90
113
|
|
|
91
|
-
|
|
114
|
+
这个流程不会把旧结果带进新的结果文件。不要只删除个别锁文件或数据文件来绕过检查。`niceeval state migrate --all` 管理的是用户级服务状态,不能转换项目的结果文件。
|
|
92
115
|
|
|
93
116
|
## View 显示旧结果
|
|
94
117
|
|
|
95
|
-
|
|
118
|
+
`niceeval view` 打开时,固定读取当时已经发布的结果。页面提示有新结果时,确认刷新即可看到最新内容;刷新失败时,页面保留上一份能读到的结果。
|
|
96
119
|
|
|
97
|
-
|
|
120
|
+
正常的查看流程见[查看运行结果](/zh/tutorials/viewing-results),命令细节见 [CLI](/zh/reference/cli)。
|