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
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createAssertFirstCoreContext = createAssertFirstCoreContext;
|
|
4
4
|
exports.createAssertFirstEvalContext = createAssertFirstEvalContext;
|
|
5
|
+
const adapter_usage_projection_ts_1 = require("../o11y/adapter-usage-projection.cjs");
|
|
6
|
+
const pricing_ts_1 = require("../record/family/adapter-usage/pricing.cjs");
|
|
7
|
+
const material_ts_1 = require("../assertions/material.cjs");
|
|
8
|
+
const context_match_ts_1 = require("../assertions/context-match.cjs");
|
|
9
|
+
const eval_usage_ts_1 = require("../o11y/eval-usage.cjs");
|
|
10
|
+
const runtime_ts_1 = require("../assertions/runtime.cjs");
|
|
5
11
|
/**
|
|
6
12
|
* The active Eval context. Assertion authoring deliberately enters through
|
|
7
13
|
* `AssertionsRuntime`; this module never constructs an intermediate Fact or
|
|
@@ -10,21 +16,55 @@ exports.createAssertFirstEvalContext = createAssertFirstEvalContext;
|
|
|
10
16
|
const promises_1 = require("node:fs/promises");
|
|
11
17
|
const node_path_1 = require("node:path");
|
|
12
18
|
const effect_1 = require("effect");
|
|
13
|
-
const
|
|
19
|
+
const runtime_ts_2 = require("../assertions/runtime.cjs");
|
|
14
20
|
const workspace_diff_ts_1 = require("../assertions/workspace-diff.cjs");
|
|
15
21
|
const diff_ts_1 = require("../assertions/diff.cjs");
|
|
16
22
|
const collection_ts_1 = require("../assertions/collection.cjs");
|
|
17
23
|
const match_ts_1 = require("../assertions/match.cjs");
|
|
18
|
-
const numeric_ts_1 = require("../assertions/numeric.cjs");
|
|
19
24
|
const judge_presets_ts_1 = require("../assertions/judge-presets.cjs");
|
|
20
25
|
const derive_ts_1 = require("../o11y/derive.cjs");
|
|
21
26
|
const observed_ts_1 = require("../o11y/observed.cjs");
|
|
22
|
-
const cost_ts_1 = require("../o11y/cost.cjs");
|
|
23
27
|
const command_projection_ts_1 = require("../o11y/command-projection.cjs");
|
|
24
28
|
const source_loc_ts_1 = require("../source-loc.cjs");
|
|
25
29
|
const session_ts_1 = require("./session.cjs");
|
|
26
30
|
const control_flow_ts_1 = require("./control-flow.cjs");
|
|
27
31
|
const json_match_ts_1 = require("../shared/json-match.cjs");
|
|
32
|
+
const agentQACapture = Object.freeze({ maxItems: 16384, maxBytes: 4 * 1024 * 1024, maxNodes: 1048576, maxDepth: 64 });
|
|
33
|
+
function agentJudgePresetMethods(check, frame) {
|
|
34
|
+
const defaults = (0, context_match_ts_1.defineMaterialMatch)({
|
|
35
|
+
name: "agent-history",
|
|
36
|
+
read: () => frame.cut === undefined || frame.read === undefined
|
|
37
|
+
? { state: "unavailable", reason: "agent-history-receiver-closed" }
|
|
38
|
+
: frame.read(frame.cut),
|
|
39
|
+
match: (0, match_ts_1.defineValueMatch)({ name: "all-history-items", evaluate: (_value) => true }),
|
|
40
|
+
capture: agentQACapture,
|
|
41
|
+
});
|
|
42
|
+
const closeQA = (first, second, third, ...extra) => {
|
|
43
|
+
if (extra.length > 0)
|
|
44
|
+
throw new TypeError("closeQA accepts question and options, or selector, question and options");
|
|
45
|
+
let selector;
|
|
46
|
+
let question;
|
|
47
|
+
let options;
|
|
48
|
+
if (typeof first === "string") {
|
|
49
|
+
if (third !== undefined)
|
|
50
|
+
throw new TypeError("closeQA(question, options) accepts two arguments");
|
|
51
|
+
selector = defaults;
|
|
52
|
+
question = first;
|
|
53
|
+
options = second;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
question = second;
|
|
57
|
+
options = third;
|
|
58
|
+
selector = (0, match_ts_1.isManagedToolMatch)(first)
|
|
59
|
+
? (0, context_match_ts_1.defineMaterialMatch)({ name: "agent-tool-history", read: ctx => ctx.toolCalls, match: first, capture: agentQACapture })
|
|
60
|
+
: (0, match_ts_1.isManagedEventMatch)(first)
|
|
61
|
+
? (0, context_match_ts_1.defineMaterialMatch)({ name: "agent-event-history", read: ctx => ctx.eventOccurrences, match: first, capture: agentQACapture })
|
|
62
|
+
: first;
|
|
63
|
+
}
|
|
64
|
+
return (0, runtime_ts_1.registerMaterialQA)(check, selector, question, options);
|
|
65
|
+
};
|
|
66
|
+
return Object.freeze({ ...judgePresetMethods(check), closeQA });
|
|
67
|
+
}
|
|
28
68
|
function judgePresetMethods(check) {
|
|
29
69
|
const apply = (factory, material, options, extra, name) => {
|
|
30
70
|
if (extra.length > 0)
|
|
@@ -36,7 +76,11 @@ function judgePresetMethods(check) {
|
|
|
36
76
|
faithfulness: (material, options, ...extra) => apply(judge_presets_ts_1.faithfulness, material, options, extra, "faithfulness"),
|
|
37
77
|
instructionFollowing: (material, options, ...extra) => apply(judge_presets_ts_1.instructionFollowing, material, options, extra, "instructionFollowing"),
|
|
38
78
|
pairwisePreference: (material, options, ...extra) => apply(judge_presets_ts_1.pairwisePreference, material, options, extra, "pairwisePreference"),
|
|
39
|
-
closeQA: (
|
|
79
|
+
closeQA: (selector, question, options, ...extra) => {
|
|
80
|
+
if (extra.length > 0)
|
|
81
|
+
throw new TypeError("closeQA accepts selector, question and optional options");
|
|
82
|
+
return (0, runtime_ts_1.registerMaterialQA)(check, selector, question, options);
|
|
83
|
+
},
|
|
40
84
|
});
|
|
41
85
|
}
|
|
42
86
|
function scopeCriterion(scope, assertion = "succeeded") {
|
|
@@ -68,7 +112,7 @@ function scopeCoverageState(coverage, channel) {
|
|
|
68
112
|
return coverage[channel].status;
|
|
69
113
|
}
|
|
70
114
|
function succeededHandle(input) {
|
|
71
|
-
const captured = (0,
|
|
115
|
+
const captured = (0, runtime_ts_2.captureAssertionSnapshot)({
|
|
72
116
|
scope: input.scope,
|
|
73
117
|
assertion: "succeeded",
|
|
74
118
|
status: input.status,
|
|
@@ -250,7 +294,7 @@ function unavailableVoid() {
|
|
|
250
294
|
return Object.freeze({ state: "unavailable", reason: "evidence-unavailable" });
|
|
251
295
|
}
|
|
252
296
|
function scopedBooleanHandle(input) {
|
|
253
|
-
const captured = (0,
|
|
297
|
+
const captured = (0, runtime_ts_2.captureAssertionSnapshot)(input.snapshot);
|
|
254
298
|
return input.runtime.registerBoolean({
|
|
255
299
|
criterion: input.criterion,
|
|
256
300
|
subject: captured.material,
|
|
@@ -305,88 +349,11 @@ function noFailedActionsHandle(input) {
|
|
|
305
349
|
}),
|
|
306
350
|
});
|
|
307
351
|
}
|
|
308
|
-
function usageLimitHandle(input) {
|
|
309
|
-
assertNonNegativeFinite(input.maximum, input.metric === "tokens" ? "maxTokens() max" : "maxCost() usd");
|
|
310
|
-
// observed usage.costUSD intentionally never enters this material. Cost is
|
|
311
|
-
// sealed from the pricing receipt; tokens exclude cache buckets by contract.
|
|
312
|
-
const tokenBuckets = [input.usage.inputTokens, input.usage.outputTokens];
|
|
313
|
-
const recordedTokenBuckets = tokenBuckets.filter((value) => value !== undefined);
|
|
314
|
-
const tokenInputInvalid = recordedTokenBuckets.some((value) => !Number.isFinite(value) || value < 0);
|
|
315
|
-
const tokenValue = recordedTokenBuckets.reduce((sum, value) => sum + value, 0);
|
|
316
|
-
const tokenMaterial = tokenInputInvalid
|
|
317
|
-
? Object.freeze({ state: "unavailable", reason: "usage-input-invalid" })
|
|
318
|
-
: recordedTokenBuckets.length === 0
|
|
319
|
-
? Object.freeze({ state: "unavailable", reason: "usage-not-recorded" })
|
|
320
|
-
: recordedTokenBuckets.length === tokenBuckets.length && input.coverage.usage.status === "complete"
|
|
321
|
-
? Object.freeze({ state: "exact", value: tokenValue })
|
|
322
|
-
: Object.freeze({ state: "lower-bound", value: tokenValue });
|
|
323
|
-
const material = input.metric === "tokens"
|
|
324
|
-
? tokenMaterial
|
|
325
|
-
: input.pricing.state === "unavailable"
|
|
326
|
-
? Object.freeze({ state: "unavailable", reason: input.pricing.reason })
|
|
327
|
-
: input.pricing.receipt.charges.length === 4 && input.coverage.usage.status === "complete"
|
|
328
|
-
? Object.freeze({ state: "exact", value: input.pricing.receipt.amountUSD })
|
|
329
|
-
: Object.freeze({ state: "lower-bound", value: input.pricing.receipt.amountUSD });
|
|
330
|
-
const derivation = input.metric === "tokens"
|
|
331
|
-
? Object.freeze({
|
|
332
|
-
kind: "usage-token-sum",
|
|
333
|
-
buckets: Object.freeze([
|
|
334
|
-
...(input.usage.inputTokens === undefined ? [] : ["inputTokens"]),
|
|
335
|
-
...(input.usage.outputTokens === undefined ? [] : ["outputTokens"]),
|
|
336
|
-
]),
|
|
337
|
-
missingBuckets: Object.freeze([
|
|
338
|
-
...(input.usage.inputTokens === undefined ? ["inputTokens"] : []),
|
|
339
|
-
...(input.usage.outputTokens === undefined ? ["outputTokens"] : []),
|
|
340
|
-
]),
|
|
341
|
-
})
|
|
342
|
-
: input.pricing.state === "available"
|
|
343
|
-
? input.pricing.receipt
|
|
344
|
-
: Object.freeze({ kind: "pricing-estimate-unavailable", reason: input.pricing.reason });
|
|
345
|
-
const captured = (0, runtime_ts_1.captureAssertionSnapshot)(Object.freeze({
|
|
346
|
-
...material,
|
|
347
|
-
cut: input.snapshot,
|
|
348
|
-
coverage: input.coverage.usage,
|
|
349
|
-
derivation,
|
|
350
|
-
}));
|
|
351
|
-
const semanticCapture = material.state === "unavailable"
|
|
352
|
-
? Object.freeze({
|
|
353
|
-
...captured,
|
|
354
|
-
coverage: Object.freeze({ state: "unavailable", reason: "source-unavailable" }),
|
|
355
|
-
limitations: Object.freeze([]),
|
|
356
|
-
})
|
|
357
|
-
: material.state === "lower-bound" && captured.coverage.state === "complete"
|
|
358
|
-
? Object.freeze({
|
|
359
|
-
...captured,
|
|
360
|
-
coverage: Object.freeze({ state: "partial", reason: "provider-limited" }),
|
|
361
|
-
limitations: Object.freeze([{ kind: "provider-limited" }]),
|
|
362
|
-
})
|
|
363
|
-
: captured;
|
|
364
|
-
const criterionSubject = input.metric === "tokens"
|
|
365
|
-
? Object.freeze({
|
|
366
|
-
kind: "scope-metric",
|
|
367
|
-
metric: "tokens",
|
|
368
|
-
scope: input.scope,
|
|
369
|
-
unit: "tokens",
|
|
370
|
-
})
|
|
371
|
-
: Object.freeze({
|
|
372
|
-
kind: "scope-metric",
|
|
373
|
-
metric: "cost",
|
|
374
|
-
scope: input.scope,
|
|
375
|
-
unit: "usd",
|
|
376
|
-
});
|
|
377
|
-
return input.runtime.registerBoolean((0, numeric_ts_1.numericBooleanRegistration)({
|
|
378
|
-
match: (0, match_ts_1.atMost)(input.maximum),
|
|
379
|
-
criterionSubject,
|
|
380
|
-
material,
|
|
381
|
-
captured: semanticCapture,
|
|
382
|
-
matchedValue: () => undefined,
|
|
383
|
-
}));
|
|
384
|
-
}
|
|
385
352
|
function toolOrderHandle(input) {
|
|
386
353
|
return registerCollectionCheck(input.runtime, input.subject, (0, match_ts_1.inOrder)(input.matches));
|
|
387
354
|
}
|
|
388
|
-
function managedToolCalls(scope, snapshot) {
|
|
389
|
-
|
|
355
|
+
function managedToolCalls(scope, snapshot, check) {
|
|
356
|
+
const collection = (0, collection_ts_1.freezeManagedToolCalls)({
|
|
390
357
|
scope,
|
|
391
358
|
sourceSnapshot: snapshot.sourceSnapshot,
|
|
392
359
|
rows: snapshot.rows,
|
|
@@ -395,9 +362,11 @@ function managedToolCalls(scope, snapshot) {
|
|
|
395
362
|
orphanFinishCount: snapshot.orphanFinishes.length,
|
|
396
363
|
snapshot: snapshot.snapshot,
|
|
397
364
|
});
|
|
365
|
+
(0, material_ts_1.ownMaterialCollection)(check, collection);
|
|
366
|
+
return collection;
|
|
398
367
|
}
|
|
399
|
-
function managedEventOccurrences(scope, snapshot) {
|
|
400
|
-
|
|
368
|
+
function managedEventOccurrences(scope, snapshot, check) {
|
|
369
|
+
const collection = (0, collection_ts_1.freezeManagedEventOccurrences)({
|
|
401
370
|
scope,
|
|
402
371
|
sourceSnapshot: snapshot.sourceSnapshot,
|
|
403
372
|
rows: snapshot.rows,
|
|
@@ -405,6 +374,8 @@ function managedEventOccurrences(scope, snapshot) {
|
|
|
405
374
|
snapshot: snapshot.snapshot,
|
|
406
375
|
unassociatedOperation: snapshot.unassociatedOperation,
|
|
407
376
|
});
|
|
377
|
+
(0, material_ts_1.ownMaterialCollection)(check, collection);
|
|
378
|
+
return collection;
|
|
408
379
|
}
|
|
409
380
|
function eventHandle(input) {
|
|
410
381
|
if (!(0, match_ts_1.isManagedCollectionMatch)(input.match)) {
|
|
@@ -682,7 +653,7 @@ function createAssertFirstSandbox(input) {
|
|
|
682
653
|
throw new Error(`Agent ${JSON.stringify(input.agent.name)} does not provide sandbox; agent-attributed workspace diff Assertions are unavailable.`);
|
|
683
654
|
}
|
|
684
655
|
};
|
|
685
|
-
const register = (criterion, evaluate) => (0,
|
|
656
|
+
const register = (criterion, evaluate) => (0, runtime_ts_2.postRunBooleanAssertionHandle)(input.runtime.registerBoolean({
|
|
686
657
|
criterion,
|
|
687
658
|
subject: diffReferenceMaterial(),
|
|
688
659
|
evaluate,
|
|
@@ -954,21 +925,32 @@ function readInputFileEffect(path) {
|
|
|
954
925
|
*/
|
|
955
926
|
function createAssertFirstCoreContext(deps) {
|
|
956
927
|
const runtime = deps.evaluationKind === "score"
|
|
957
|
-
? (0,
|
|
958
|
-
: (0,
|
|
928
|
+
? (0, runtime_ts_2.createAssertionsRuntime)({ evaluationKind: "score", executeStop: deps.executeStop, ...(deps.judge === undefined ? {} : { judge: deps.judge }), signal: deps.signal, ...(deps.judgeUsage === undefined ? {} : { judgeUsage: deps.judgeUsage }) })
|
|
929
|
+
: (0, runtime_ts_2.createAssertionsRuntime)({ evaluationKind: "pass", executeStop: deps.executeStop, ...(deps.judge === undefined ? {} : { judge: deps.judge }), signal: deps.signal, ...(deps.judgeUsage === undefined ? {} : { judgeUsage: deps.judgeUsage }) });
|
|
959
930
|
const check = runtime.t.check;
|
|
960
931
|
const judge = ((subject, definition, ...extra) => {
|
|
961
932
|
if (extra.length > 0)
|
|
962
933
|
throw new TypeError("judge() accepts exactly (subject, definition)");
|
|
963
934
|
runtime.assertAuthoringOpen();
|
|
964
|
-
(0,
|
|
935
|
+
(0, runtime_ts_2.assertAssertionSubject)(subject, "judge");
|
|
965
936
|
if ((0, match_ts_1.managedScoreMatchOf)(definition) === undefined)
|
|
966
937
|
throw new TypeError("judge() definition must be a managed ScoreMatch");
|
|
967
938
|
return runtime.t.check(subject, definition);
|
|
968
939
|
});
|
|
969
940
|
const state = { assertions: runtime };
|
|
970
941
|
const presets = judgePresetMethods(runtime.t.check);
|
|
942
|
+
const readUsage = () => { runtime.assertAuthoringOpen(); return deps.readUsage?.() ?? (0, eval_usage_ts_1.projectAgentEvalUsage)({ contributions: [], scope: "attempt" }); };
|
|
943
|
+
const elapsedMs = () => {
|
|
944
|
+
runtime.assertAuthoringOpen();
|
|
945
|
+
const value = deps.elapsedMs?.();
|
|
946
|
+
const provenance = Object.freeze({ source: "runtime", scope: "attempt", unit: "milliseconds", cut: "call-time" });
|
|
947
|
+
return value === undefined || !Number.isFinite(value) || value < 0 ? Object.freeze({ state: "unavailable", reason: "runtime-timing-not-recorded", provenance }) : Object.freeze({ state: "exact", value, provenance });
|
|
948
|
+
};
|
|
949
|
+
const { maxTokens, maxCost } = usageBudgetMethods(runtime, readUsage);
|
|
971
950
|
const base = {
|
|
951
|
+
get usage() { return readUsage(); },
|
|
952
|
+
get elapsedMs() { return elapsedMs(); },
|
|
953
|
+
maxTokens, maxCost,
|
|
972
954
|
evaluationKind: deps.evaluationKind,
|
|
973
955
|
signal: deps.signal,
|
|
974
956
|
model: deps.model,
|
|
@@ -997,17 +979,36 @@ function createAssertFirstCoreContext(deps) {
|
|
|
997
979
|
judge,
|
|
998
980
|
...presets,
|
|
999
981
|
};
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
score: runtime.t.score,
|
|
1004
|
-
})
|
|
1005
|
-
: Object.freeze(base);
|
|
982
|
+
if (deps.evaluationKind === "score")
|
|
983
|
+
Object.defineProperty(base, "score", { value: runtime.t.score, enumerable: true });
|
|
984
|
+
const context = Object.freeze(base);
|
|
1006
985
|
return {
|
|
1007
986
|
context: context,
|
|
1008
987
|
state,
|
|
1009
988
|
};
|
|
1010
989
|
}
|
|
990
|
+
function usageBudgetMethods(runtime, readUsage) {
|
|
991
|
+
const maxTokens = (maximum, ...extra) => {
|
|
992
|
+
if (extra.length > 0)
|
|
993
|
+
throw new TypeError("maxTokens() accepts exactly one maximum");
|
|
994
|
+
assertNonNegativeFinite(maximum, "maxTokens() max");
|
|
995
|
+
return runtime.t.check(readUsage().totalTokens, (0, match_ts_1.atMost)(maximum));
|
|
996
|
+
};
|
|
997
|
+
const maxCost = (maximum, ...extra) => {
|
|
998
|
+
if (extra.length > 0)
|
|
999
|
+
throw new TypeError("maxCost() accepts exactly one maximum");
|
|
1000
|
+
const threshold = typeof maximum === "number" ? (0, pricing_ts_1.canonicalDecimalFromNumber)(maximum) : maximum;
|
|
1001
|
+
if (threshold == null || !/^(?:0|[1-9]\d*)(?:\.\d*[1-9])?$/.test(threshold) || threshold.length > 128)
|
|
1002
|
+
throw new TypeError("maxCost() requires a nonnegative canonical USD amount");
|
|
1003
|
+
const usage = readUsage();
|
|
1004
|
+
const usd = usage.costs.values.find((cost) => cost.currency === "USD");
|
|
1005
|
+
const complete = usage.costs.state === "complete" && usage.costs.values.length === 1;
|
|
1006
|
+
const captured = (0, runtime_ts_2.captureAssertionSnapshot)({ source: usage.source, scope: usage.scope, cut: usage.cut, unit: "USD", threshold, amount: usd?.value ?? null, complete, costs: usage.costs });
|
|
1007
|
+
return runtime.registerBoolean({ criterion: { kind: "value-match", subject: "explicit-value", matcher: { state: "declared", name: "max-cost-usd" } }, subject: captured.material, coverage: captured.coverage, limitations: captured.limitations,
|
|
1008
|
+
evaluate: () => effect_1.Effect.succeed(usd === undefined ? { state: "unavailable", reason: "source-unavailable" } : (0, adapter_usage_projection_ts_1.compareCanonicalDecimal)(usd.value, threshold) > 0 ? { state: "mismatched" } : complete ? { state: "matched", value: usd.value } : { state: "unavailable", reason: "source-unavailable" }) });
|
|
1009
|
+
};
|
|
1010
|
+
return { maxTokens, maxCost };
|
|
1011
|
+
}
|
|
1011
1012
|
/**
|
|
1012
1013
|
* Creates the Context that Runner actually hands to `test(t)`. Its only
|
|
1013
1014
|
* authoring state is the Attempt-local Assert-first runtime.
|
|
@@ -1039,7 +1040,8 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1039
1040
|
sourceRegistry: deps.sourceRegistry,
|
|
1040
1041
|
resources: deps.resources,
|
|
1041
1042
|
});
|
|
1042
|
-
const
|
|
1043
|
+
const readAttemptUsage = () => (0, eval_usage_ts_1.projectAgentEvalUsage)({ contributions: manager.usageContributionsSnapshot(), scope: "attempt", pricing: deps.pricing });
|
|
1044
|
+
const core = createAssertFirstCoreContext({ ...deps, readUsage: readAttemptUsage });
|
|
1043
1045
|
const runtime = core.state.assertions;
|
|
1044
1046
|
const check = core.context.check;
|
|
1045
1047
|
const judge = core.context.judge;
|
|
@@ -1049,9 +1051,6 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1049
1051
|
late: { diff: Object.freeze({ state: "pending" }), scripts: {} },
|
|
1050
1052
|
};
|
|
1051
1053
|
const resolveObservedEvaluation = (snapshot) => manager.observedEvaluationSegment(snapshot);
|
|
1052
|
-
// maxCost 断言唯一认价目表估算(estimateCost);observed usage.costUSD 与之独立并存,
|
|
1053
|
-
// 存在也不改变估算(见 Usage.costUSD 单向字段契约)。
|
|
1054
|
-
const pricingEstimateFor = (usage) => (0, cost_ts_1.pricingEstimate)(deps.model, usage, deps.pricing);
|
|
1055
1054
|
const sessions = [];
|
|
1056
1055
|
let attemptToolScopeCache;
|
|
1057
1056
|
const matcherSource = Object.freeze({
|
|
@@ -1094,7 +1093,7 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1094
1093
|
scopeId: observed.sessionId,
|
|
1095
1094
|
throughSessionSequence: observed.throughSessionSequence,
|
|
1096
1095
|
source: matcherSource,
|
|
1097
|
-
collectionAtCut: collectionAtCut(
|
|
1096
|
+
collectionAtCut: collectionAtCut(observedMatcherTurns(observed.sessionId), coverage, allowUnclassifiedActions),
|
|
1098
1097
|
});
|
|
1099
1098
|
};
|
|
1100
1099
|
const attemptSourceSnapshot = (turns, coverage, allowUnclassifiedActions = false) => Object.freeze({
|
|
@@ -1128,6 +1127,73 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1128
1127
|
: manager.evidenceCoverage;
|
|
1129
1128
|
return coverage;
|
|
1130
1129
|
};
|
|
1130
|
+
const observedMatcherTurns = (sessionId) => Object.freeze(manager.observedSessionSnapshots().filter(session => sessionId === undefined || session.sessionId === sessionId)
|
|
1131
|
+
.flatMap(session => session.turns.map(observed => Object.freeze({
|
|
1132
|
+
observed,
|
|
1133
|
+
events: resolveObservedEvaluation(observed)?.events ?? Object.freeze([]),
|
|
1134
|
+
outcome: manager.observedTurnState(observed)?.outcome ?? "failed",
|
|
1135
|
+
}))));
|
|
1136
|
+
const readDefaultHistory = (cut) => {
|
|
1137
|
+
const ends = cut.scope === "attempt"
|
|
1138
|
+
? new Map(cut.sessions.map(session => [session.sessionId, session.throughSessionSequence]))
|
|
1139
|
+
: new Map([[cut.sessionId, cut.throughSessionSequence]]);
|
|
1140
|
+
const prefix = observedMatcherTurns().filter(turn => {
|
|
1141
|
+
const end = ends.get(turn.observed.sessionId);
|
|
1142
|
+
return end !== undefined && turn.observed.throughSessionSequence <= end;
|
|
1143
|
+
});
|
|
1144
|
+
const selected = prefix.filter(turn => cut.scope !== "turn" || turn.observed.turnId === cut.turnId);
|
|
1145
|
+
const projection = projectMatcherSources(prefix, resolveObservedEvaluation);
|
|
1146
|
+
let reason = manager.observedHistoryIncompleteReason();
|
|
1147
|
+
if (projection.state === "invalid")
|
|
1148
|
+
reason ??= "agent-history-invalid-relation";
|
|
1149
|
+
const active = cut.scope === "attempt"
|
|
1150
|
+
? sessions.some(scope => scope.inFlight > 0)
|
|
1151
|
+
: sessions.some(scope => scope.session.observedSnapshot().sessionId === cut.sessionId && scope.inFlight > 0);
|
|
1152
|
+
if (active)
|
|
1153
|
+
reason ??= "scope-still-running";
|
|
1154
|
+
const items = [];
|
|
1155
|
+
for (const turn of selected) {
|
|
1156
|
+
const segment = resolveObservedEvaluation(turn.observed);
|
|
1157
|
+
if (segment === undefined) {
|
|
1158
|
+
reason ??= "agent-history-segment-unavailable";
|
|
1159
|
+
continue;
|
|
1160
|
+
}
|
|
1161
|
+
if (turn.observed.collectionAtCut !== "complete")
|
|
1162
|
+
reason ??= "agent-history-truncated";
|
|
1163
|
+
const coverage = manager.observedTurnState(turn.observed)?.coverage;
|
|
1164
|
+
for (const channel of ["events", "messages", "actions"]) {
|
|
1165
|
+
if (coverage?.[channel].status !== "complete")
|
|
1166
|
+
reason ??= coverage?.[channel].reason ?? `agent-history-${channel}-unavailable`;
|
|
1167
|
+
}
|
|
1168
|
+
segment.items.forEach((event, index) => {
|
|
1169
|
+
const raw = segment.events[index];
|
|
1170
|
+
if (raw === undefined)
|
|
1171
|
+
reason ??= "agent-history-event-unavailable";
|
|
1172
|
+
if ((raw?.truncated?.length ?? 0) > 0)
|
|
1173
|
+
reason ??= "agent-history-truncated";
|
|
1174
|
+
if (event.kind === "tool-finish" && event.occurrence.state !== "exact")
|
|
1175
|
+
reason ??= `agent-history-${event.occurrence.reason}`;
|
|
1176
|
+
const occurrenceId = event.kind === "tool-start" ? event.toolOccurrenceId
|
|
1177
|
+
: event.kind === "tool-finish" && event.occurrence.state === "exact" ? event.occurrence.toolOccurrenceId : undefined;
|
|
1178
|
+
const occurrence = occurrenceId === undefined ? undefined : projection.occurrenceCandidates.get(occurrenceId);
|
|
1179
|
+
items.push(Object.freeze({ id: event.eventId, value: Object.freeze({
|
|
1180
|
+
eventId: event.eventId, itemId: event.itemId,
|
|
1181
|
+
sessionId: segment.sessionId, turnId: segment.turnId, sessionSequence: event.sessionSequence,
|
|
1182
|
+
event: raw ?? event, observed: event,
|
|
1183
|
+
...(occurrence === undefined ? {} : { occurrence }),
|
|
1184
|
+
ordering: "first-session appearance, then sessionSequence; no cross-session causal order",
|
|
1185
|
+
}) }));
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
return reason === undefined ? Object.freeze({ state: "complete", items: Object.freeze(items) })
|
|
1189
|
+
: Object.freeze({ state: "partial", items: Object.freeze(items), reason });
|
|
1190
|
+
};
|
|
1191
|
+
const historyFrame = () => ({ read: readDefaultHistory });
|
|
1192
|
+
const latchHistoryCut = (frame, cut) => {
|
|
1193
|
+
frame.cut = cut;
|
|
1194
|
+
return cut;
|
|
1195
|
+
};
|
|
1196
|
+
const releaseHistoryFrame = (frame) => { frame.cut = undefined; frame.read = undefined; };
|
|
1131
1197
|
const attemptStatus = () => {
|
|
1132
1198
|
const active = sessions.filter((scope) => scope.started);
|
|
1133
1199
|
if (active.length === 0)
|
|
@@ -1154,7 +1220,7 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1154
1220
|
});
|
|
1155
1221
|
const sessionToolScope = (scope) => {
|
|
1156
1222
|
const coverage = sessionCoverage(scope);
|
|
1157
|
-
const turns =
|
|
1223
|
+
const turns = observedMatcherTurns(scope.session.observedSnapshot().sessionId);
|
|
1158
1224
|
const sourceSnapshot = sessionSourceSnapshot(scope, coverage.actions, true);
|
|
1159
1225
|
const snapshot = Object.freeze({
|
|
1160
1226
|
sessionIndex: scope.session.index,
|
|
@@ -1179,7 +1245,7 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1179
1245
|
const attemptToolScope = () => {
|
|
1180
1246
|
const active = sessions.filter((scope) => scope.started);
|
|
1181
1247
|
const coverage = attemptCoverage();
|
|
1182
|
-
const turns =
|
|
1248
|
+
const turns = observedMatcherTurns();
|
|
1183
1249
|
const sourceSnapshot = attemptSourceSnapshot(turns, coverage.actions, true);
|
|
1184
1250
|
const snapshot = Object.freeze({
|
|
1185
1251
|
sessions: Object.freeze(active.map((scope) => ({
|
|
@@ -1205,11 +1271,11 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1205
1271
|
attemptToolScopeCache = Object.freeze({ cutKey, value });
|
|
1206
1272
|
return value;
|
|
1207
1273
|
};
|
|
1208
|
-
const sessionScopedEvents = (scope) => Object.freeze(scope.
|
|
1274
|
+
const sessionScopedEvents = (scope) => Object.freeze(observedMatcherTurns(scope.session.observedSnapshot().sessionId).flatMap((turn) => turn.events));
|
|
1209
1275
|
const sessionEventScope = (scope) => {
|
|
1210
1276
|
const coverage = sessionCoverage(scope);
|
|
1211
1277
|
return projectEventScope({
|
|
1212
|
-
turns:
|
|
1278
|
+
turns: observedMatcherTurns(scope.session.observedSnapshot().sessionId),
|
|
1213
1279
|
sourceSnapshot: sessionSourceSnapshot(scope, coverage.events),
|
|
1214
1280
|
coverage,
|
|
1215
1281
|
snapshot: sessionSnapshot(scope),
|
|
@@ -1218,11 +1284,11 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1218
1284
|
};
|
|
1219
1285
|
const attemptScopedEvents = () => Object.freeze(sessions
|
|
1220
1286
|
.filter((scope) => scope.started)
|
|
1221
|
-
.flatMap((scope) => scope.
|
|
1287
|
+
.flatMap((scope) => observedMatcherTurns(scope.session.observedSnapshot().sessionId).flatMap((turn) => turn.events)));
|
|
1222
1288
|
const attemptEventScope = () => {
|
|
1223
1289
|
const active = sessions.filter((scope) => scope.started);
|
|
1224
1290
|
const coverage = attemptCoverage();
|
|
1225
|
-
const turns =
|
|
1291
|
+
const turns = observedMatcherTurns();
|
|
1226
1292
|
return projectEventScope({
|
|
1227
1293
|
turns,
|
|
1228
1294
|
sourceSnapshot: attemptSourceSnapshot(turns, coverage.events),
|
|
@@ -1269,8 +1335,11 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1269
1335
|
snapshot: scopeSnapshot,
|
|
1270
1336
|
resolveEvaluation: resolveObservedEvaluation,
|
|
1271
1337
|
});
|
|
1272
|
-
const toolCalls = managedToolCalls("turn", toolScope);
|
|
1273
|
-
const eventOccurrences = managedEventOccurrences("turn", eventScope);
|
|
1338
|
+
const toolCalls = managedToolCalls("turn", toolScope, check);
|
|
1339
|
+
const eventOccurrences = managedEventOccurrences("turn", eventScope, check);
|
|
1340
|
+
const readTurnUsage = () => { runtime.assertAuthoringOpen(); return (0, eval_usage_ts_1.projectAgentEvalUsage)({ contributions: manager.usageContributionsSnapshot().filter((call) => call.turnId === observed.turnId), scope: "turn", pricing: deps.pricing }); };
|
|
1341
|
+
const frame = historyFrame();
|
|
1342
|
+
const scopedCheck = (0, runtime_ts_1.createScopedAssertionCheck)(check, () => Object.freeze({ scope: "turn", toolCalls, eventOccurrences, get usage() { return readTurnUsage(); } }), () => latchHistoryCut(frame, turnSourceSnapshot(matcherTurn, coverage.actions, true)), () => releaseHistoryFrame(frame));
|
|
1274
1343
|
const snapshot = Object.freeze({
|
|
1275
1344
|
events,
|
|
1276
1345
|
toolCalls,
|
|
@@ -1351,33 +1420,7 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1351
1420
|
throw new TypeError("eventOrder() accepts exactly one ordered match list");
|
|
1352
1421
|
return registerCollectionCheck(runtime, eventOccurrences, (0, match_ts_1.inOrder)(matches));
|
|
1353
1422
|
};
|
|
1354
|
-
const maxTokens = (
|
|
1355
|
-
if (extra.length > 0)
|
|
1356
|
-
throw new TypeError("maxTokens() accepts exactly one maximum");
|
|
1357
|
-
return usageLimitHandle({
|
|
1358
|
-
runtime: runtime,
|
|
1359
|
-
scope: "turn",
|
|
1360
|
-
metric: "tokens",
|
|
1361
|
-
maximum: max,
|
|
1362
|
-
usage: turn.usage ?? {},
|
|
1363
|
-
coverage,
|
|
1364
|
-
snapshot: scopeSnapshot,
|
|
1365
|
-
});
|
|
1366
|
-
};
|
|
1367
|
-
const maxCost = (usd, ...extra) => {
|
|
1368
|
-
if (extra.length > 0)
|
|
1369
|
-
throw new TypeError("maxCost() accepts exactly one maximum");
|
|
1370
|
-
return usageLimitHandle({
|
|
1371
|
-
runtime: runtime,
|
|
1372
|
-
scope: "turn",
|
|
1373
|
-
metric: "cost",
|
|
1374
|
-
maximum: usd,
|
|
1375
|
-
usage: turn.usage ?? {},
|
|
1376
|
-
pricing: pricingEstimateFor(turn.usage === undefined ? {} : turn.usage),
|
|
1377
|
-
coverage,
|
|
1378
|
-
snapshot: scopeSnapshot,
|
|
1379
|
-
});
|
|
1380
|
-
};
|
|
1423
|
+
const { maxTokens, maxCost } = usageBudgetMethods(runtime, readTurnUsage);
|
|
1381
1424
|
return Object.freeze({
|
|
1382
1425
|
input: snapshot.input,
|
|
1383
1426
|
events: snapshot.events,
|
|
@@ -1386,10 +1429,11 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1386
1429
|
status: snapshot.status,
|
|
1387
1430
|
message: snapshot.output,
|
|
1388
1431
|
...(turn.data === undefined ? {} : { data: turn.data }),
|
|
1389
|
-
|
|
1390
|
-
|
|
1432
|
+
get usage() { return readTurnUsage(); },
|
|
1433
|
+
get elapsedMs() { return core.context.elapsedMs; },
|
|
1434
|
+
check: scopedCheck,
|
|
1391
1435
|
judge: judge,
|
|
1392
|
-
...
|
|
1436
|
+
...agentJudgePresetMethods(scopedCheck, frame),
|
|
1393
1437
|
succeeded: () => succeededHandle({
|
|
1394
1438
|
runtime: runtime,
|
|
1395
1439
|
scope: "turn",
|
|
@@ -1425,8 +1469,11 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1425
1469
|
const send = (scope, text, files, responses) => deps.requestEffect(sendEffect(scope, text, files, responses, (0, source_loc_ts_1.captureLoc)({ registry: deps.sourceRegistry })));
|
|
1426
1470
|
const makeSession = (scope) => {
|
|
1427
1471
|
const session = scope.session;
|
|
1428
|
-
const sessionCalls = () => managedToolCalls("session", sessionToolScope(scope));
|
|
1429
|
-
const sessionEventOccurrences = () => managedEventOccurrences("session", sessionEventScope(scope));
|
|
1472
|
+
const sessionCalls = () => managedToolCalls("session", sessionToolScope(scope), check);
|
|
1473
|
+
const sessionEventOccurrences = () => managedEventOccurrences("session", sessionEventScope(scope), check);
|
|
1474
|
+
const readSessionUsage = () => { runtime.assertAuthoringOpen(); return (0, eval_usage_ts_1.projectAgentEvalUsage)({ contributions: manager.usageContributionsSnapshot().filter((call) => call.sessionScopeId === session.sessionScopeId), scope: "session", pricing: deps.pricing }); };
|
|
1475
|
+
const frame = historyFrame();
|
|
1476
|
+
const scopedCheck = (0, runtime_ts_1.createScopedAssertionCheck)(check, () => Object.freeze({ scope: "session", get toolCalls() { return sessionCalls(); }, get eventOccurrences() { return sessionEventOccurrences(); }, get usage() { return readSessionUsage(); } }), () => latchHistoryCut(frame, sessionSourceSnapshot(scope, sessionCoverage(scope).actions, true)), () => releaseHistoryFrame(frame));
|
|
1430
1477
|
const toolOrder = (matches, ...extra) => {
|
|
1431
1478
|
if (extra.length > 0)
|
|
1432
1479
|
throw new TypeError("toolOrder() accepts exactly one ordered match list");
|
|
@@ -1488,35 +1535,7 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1488
1535
|
throw new TypeError("eventOrder() accepts exactly one ordered match list");
|
|
1489
1536
|
return registerCollectionCheck(runtime, sessionEventOccurrences(), (0, match_ts_1.inOrder)(matches));
|
|
1490
1537
|
};
|
|
1491
|
-
const maxTokens = (
|
|
1492
|
-
if (extra.length > 0)
|
|
1493
|
-
throw new TypeError("maxTokens() accepts exactly one maximum");
|
|
1494
|
-
const coverage = sessionCoverage(scope);
|
|
1495
|
-
return usageLimitHandle({
|
|
1496
|
-
runtime: runtime,
|
|
1497
|
-
scope: "session",
|
|
1498
|
-
metric: "tokens",
|
|
1499
|
-
maximum: max,
|
|
1500
|
-
usage: session.usage,
|
|
1501
|
-
coverage,
|
|
1502
|
-
snapshot: sessionSnapshot(scope),
|
|
1503
|
-
});
|
|
1504
|
-
};
|
|
1505
|
-
const maxCost = (usd, ...extra) => {
|
|
1506
|
-
if (extra.length > 0)
|
|
1507
|
-
throw new TypeError("maxCost() accepts exactly one maximum");
|
|
1508
|
-
const coverage = sessionCoverage(scope);
|
|
1509
|
-
return usageLimitHandle({
|
|
1510
|
-
runtime: runtime,
|
|
1511
|
-
scope: "session",
|
|
1512
|
-
metric: "cost",
|
|
1513
|
-
maximum: usd,
|
|
1514
|
-
usage: session.usage,
|
|
1515
|
-
pricing: pricingEstimateFor(session.usage),
|
|
1516
|
-
coverage,
|
|
1517
|
-
snapshot: sessionSnapshot(scope),
|
|
1518
|
-
});
|
|
1519
|
-
};
|
|
1538
|
+
const { maxTokens, maxCost } = usageBudgetMethods(runtime, readSessionUsage);
|
|
1520
1539
|
return Object.freeze({
|
|
1521
1540
|
send: (input) => {
|
|
1522
1541
|
const text = typeof input === "string" ? input : input.text;
|
|
@@ -1555,7 +1574,7 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1555
1574
|
return Object.freeze([...session.events]);
|
|
1556
1575
|
},
|
|
1557
1576
|
get usage() {
|
|
1558
|
-
return
|
|
1577
|
+
return readSessionUsage();
|
|
1559
1578
|
},
|
|
1560
1579
|
get toolCalls() {
|
|
1561
1580
|
return sessionCalls();
|
|
@@ -1563,9 +1582,10 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1563
1582
|
get eventOccurrences() {
|
|
1564
1583
|
return sessionEventOccurrences();
|
|
1565
1584
|
},
|
|
1566
|
-
|
|
1585
|
+
get elapsedMs() { return core.context.elapsedMs; },
|
|
1586
|
+
check: scopedCheck,
|
|
1567
1587
|
judge: judge,
|
|
1568
|
-
...
|
|
1588
|
+
...agentJudgePresetMethods(scopedCheck, frame),
|
|
1569
1589
|
succeeded: () => succeededHandle({
|
|
1570
1590
|
runtime: runtime,
|
|
1571
1591
|
scope: "session",
|
|
@@ -1611,8 +1631,8 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1611
1631
|
};
|
|
1612
1632
|
sessions.push(primaryScope);
|
|
1613
1633
|
const primary = makeSession(primaryScope);
|
|
1614
|
-
const attemptCalls = () => managedToolCalls("attempt", attemptToolScope());
|
|
1615
|
-
const attemptEventOccurrences = () => managedEventOccurrences("attempt", attemptEventScope());
|
|
1634
|
+
const attemptCalls = () => managedToolCalls("attempt", attemptToolScope(), check);
|
|
1635
|
+
const attemptEventOccurrences = () => managedEventOccurrences("attempt", attemptEventScope(), check);
|
|
1616
1636
|
const rootUsedNoTools = (...extra) => {
|
|
1617
1637
|
if (extra.length > 0)
|
|
1618
1638
|
throw new TypeError("usedNoTools() accepts no arguments");
|
|
@@ -1653,37 +1673,13 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1653
1673
|
match,
|
|
1654
1674
|
});
|
|
1655
1675
|
};
|
|
1656
|
-
const
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
const coverage = attemptCoverage();
|
|
1660
|
-
return usageLimitHandle({
|
|
1661
|
-
runtime,
|
|
1662
|
-
scope: "attempt",
|
|
1663
|
-
metric: "tokens",
|
|
1664
|
-
maximum: max,
|
|
1665
|
-
usage: manager.usage,
|
|
1666
|
-
coverage,
|
|
1667
|
-
snapshot: attemptSnapshot(),
|
|
1668
|
-
});
|
|
1669
|
-
};
|
|
1670
|
-
const rootMaxCost = (usd, ...extra) => {
|
|
1671
|
-
if (extra.length > 0)
|
|
1672
|
-
throw new TypeError("maxCost() accepts exactly one maximum");
|
|
1673
|
-
const coverage = attemptCoverage();
|
|
1674
|
-
return usageLimitHandle({
|
|
1675
|
-
runtime,
|
|
1676
|
-
scope: "attempt",
|
|
1677
|
-
metric: "cost",
|
|
1678
|
-
maximum: usd,
|
|
1679
|
-
usage: manager.usage,
|
|
1680
|
-
pricing: pricingEstimateFor(manager.usage),
|
|
1681
|
-
coverage,
|
|
1682
|
-
snapshot: attemptSnapshot(),
|
|
1683
|
-
});
|
|
1684
|
-
};
|
|
1676
|
+
const rootFrame = historyFrame();
|
|
1677
|
+
(0, runtime_ts_1.bindAssertionContext)(check, () => Object.freeze({ scope: "attempt", get toolCalls() { return attemptCalls(); }, get eventOccurrences() { return attemptEventOccurrences(); }, get usage() { return readAttemptUsage(); } }), () => latchHistoryCut(rootFrame, attemptSourceSnapshot(observedMatcherTurns(), attemptCoverage().actions, true)), () => releaseHistoryFrame(rootFrame));
|
|
1678
|
+
const { maxTokens: rootMaxTokens, maxCost: rootMaxCost } = usageBudgetMethods(runtime, readAttemptUsage);
|
|
1685
1679
|
const base = {
|
|
1686
|
-
...core.context,
|
|
1680
|
+
...Object.fromEntries(Object.entries(Object.getOwnPropertyDescriptors(core.context)).filter(([, descriptor]) => "value" in descriptor).map(([key, descriptor]) => [key, descriptor.value])),
|
|
1681
|
+
...agentJudgePresetMethods(check, rootFrame),
|
|
1682
|
+
get elapsedMs() { return core.context.elapsedMs; },
|
|
1687
1683
|
send: primary.send,
|
|
1688
1684
|
sendFile: primary.sendFile,
|
|
1689
1685
|
requireInputRequest: primary.requireInputRequest,
|
|
@@ -1722,7 +1718,8 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1722
1718
|
return (0, derive_ts_1.buildO11ySummary)(manager.allEvents);
|
|
1723
1719
|
},
|
|
1724
1720
|
get usage() {
|
|
1725
|
-
|
|
1721
|
+
runtime.assertAuthoringOpen();
|
|
1722
|
+
return readAttemptUsage();
|
|
1726
1723
|
},
|
|
1727
1724
|
get toolCalls() {
|
|
1728
1725
|
return attemptCalls();
|
|
@@ -1760,12 +1757,9 @@ function createAssertFirstEvalContext(deps) {
|
|
|
1760
1757
|
maxTokens: rootMaxTokens,
|
|
1761
1758
|
maxCost: rootMaxCost,
|
|
1762
1759
|
};
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
score: runtime.t.score,
|
|
1767
|
-
})
|
|
1768
|
-
: Object.freeze(base);
|
|
1760
|
+
if (deps.evaluationKind === "score")
|
|
1761
|
+
Object.defineProperty(base, "score", { value: runtime.t.score, enumerable: true });
|
|
1762
|
+
const context = Object.freeze(base);
|
|
1769
1763
|
return {
|
|
1770
1764
|
context: context,
|
|
1771
1765
|
state,
|