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
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.prepareManagedScoreMatch = prepareManagedScoreMatch;
|
|
4
4
|
const effect_1 = require("effect");
|
|
5
5
|
const node_crypto_1 = require("node:crypto");
|
|
6
|
+
const full_content_ts_1 = require("./full-content.cjs");
|
|
6
7
|
const provider_ts_1 = require("../judge/provider.cjs");
|
|
7
8
|
const image_ts_1 = require("../judge/image.cjs");
|
|
8
9
|
const judge_ts_1 = require("./judge.cjs");
|
|
@@ -74,12 +75,14 @@ function primitiveOptions(operation, input, images) {
|
|
|
74
75
|
throw new TypeError("LLM material contains an image not captured by this Assertion");
|
|
75
76
|
options.material = material.material;
|
|
76
77
|
const allowed = operation === "score" ? ["rubric", "anchors", "material"] : operation === "classify" ? ["rubric", "choices", "material"] : operation === "extract" ? ["rubric", "maxItems", "material"] : ["rubric", "choices", "items", "material"];
|
|
77
|
-
if (Object.keys(options).some((key) => !allowed.includes(key)) || allowed.some((key) => !(key in options)))
|
|
78
|
+
if (Object.keys(options).some((key) => !allowed.includes(key) && !(operation === "classify" && key === "evidenceIds")) || allowed.some((key) => !(key in options)))
|
|
78
79
|
throw new TypeError("Invalid LLM primitive arguments");
|
|
79
80
|
return options;
|
|
80
81
|
}
|
|
81
82
|
function validatePrimitiveOptions(operation, options) {
|
|
82
83
|
const rubric = requiredText(options.rubric, "rubric");
|
|
84
|
+
if (options.evidenceIds !== undefined)
|
|
85
|
+
validateEvidenceIds(options.evidenceIds);
|
|
83
86
|
if (operation === "score") {
|
|
84
87
|
if (!Array.isArray(options.anchors) || options.anchors.length < 2 || options.anchors.length > 32)
|
|
85
88
|
throw new TypeError("anchors must contain 2 to 32 entries");
|
|
@@ -139,8 +142,12 @@ function chatRequestFor(operation, input, profile, images, imageAudit) {
|
|
|
139
142
|
const choices = choicesOf(options.choices);
|
|
140
143
|
system.choices = choices;
|
|
141
144
|
const choice = { type: "string", enum: choices };
|
|
142
|
-
if (operation === "classify")
|
|
143
|
-
|
|
145
|
+
if (operation === "classify") {
|
|
146
|
+
const evidenceIds = options.evidenceIds;
|
|
147
|
+
if (evidenceIds !== undefined)
|
|
148
|
+
system.evidenceIds = evidenceIds;
|
|
149
|
+
parameters = schemaObject({ choice, rationale: string, ...(evidenceIds === undefined ? {} : { citations: { type: "array", items: { type: "string", enum: evidenceIds }, uniqueItems: true } }) });
|
|
150
|
+
}
|
|
144
151
|
else {
|
|
145
152
|
const ids = options.items.map((item) => item.id);
|
|
146
153
|
user.items = options.items;
|
|
@@ -211,7 +218,13 @@ function decodeChatOutput(operation, response, options) {
|
|
|
211
218
|
if (operation === "score")
|
|
212
219
|
output = effect_1.Schema.decodeUnknownSync(scoreSchema, parse)(raw);
|
|
213
220
|
else if (operation === "classify") {
|
|
214
|
-
const result = effect_1.Schema.decodeUnknownSync(classifySchema, parse)(raw);
|
|
221
|
+
const result = options.evidenceIds === undefined ? effect_1.Schema.decodeUnknownSync(classifySchema, parse)(raw) : effect_1.Schema.decodeUnknownSync(effect_1.Schema.Struct({ choice: effect_1.Schema.String, rationale: effect_1.Schema.String, citations: effect_1.Schema.Array(effect_1.Schema.String) }), parse)(raw);
|
|
222
|
+
if (options.evidenceIds !== undefined) {
|
|
223
|
+
const citations = result.citations;
|
|
224
|
+
validateEvidenceIds(citations, true);
|
|
225
|
+
if (citations.some((id) => !options.evidenceIds.includes(id)))
|
|
226
|
+
throw new TypeError("Unknown evidence citation");
|
|
227
|
+
}
|
|
215
228
|
if (!choicesOf(options.choices).includes(result.choice))
|
|
216
229
|
throw new TypeError("Unknown classification label");
|
|
217
230
|
output = result;
|
|
@@ -296,16 +309,18 @@ function decodeTypesafeOutput(operation, response, options) {
|
|
|
296
309
|
const items = options.items;
|
|
297
310
|
return (0, judge_ts_1.snapshotScoreMatchMaterial)({ items: items.map((item, index) => ({ id: item.id, ...decodeChoice(`q${index}`) })) });
|
|
298
311
|
}
|
|
312
|
+
class JudgeUsageAdmissionError extends Error {
|
|
313
|
+
}
|
|
299
314
|
/** A managed Match contributes one ordinary measurement entry and terminal Content. */
|
|
300
315
|
function prepareManagedScoreMatch(input) {
|
|
301
316
|
const { options } = input;
|
|
317
|
+
let deadlineAt = Infinity;
|
|
302
318
|
const snapshot = (0, judge_ts_1.snapshotJudgeMaterial)(input.material);
|
|
303
319
|
const material = snapshot.material;
|
|
304
320
|
const imageByValue = snapshot.imageByValue;
|
|
305
321
|
const images = snapshot.images;
|
|
306
322
|
const captured = (0, score_match_audit_ts_1.canonicalScoreMatchAuditJson)((0, judge_ts_1.projectJudgeMaterial)(material, imageByValue).json);
|
|
307
|
-
|
|
308
|
-
throw new TypeError(`ScoreMatch material exceeds ${options.llm.maxMaterialBytes} bytes`);
|
|
323
|
+
const subject = (0, full_content_ts_1.captureFullAssertionSnapshot)({ content: (0, judge_ts_1.chunkUtf8)(captured) }).material;
|
|
309
324
|
const definitionBase = { name: options.name, version: options.version, config: options.canonicalConfig, limits: options.llm };
|
|
310
325
|
const definition = { ...definitionBase, digest: (0, score_match_audit_ts_1.scoreMatchDefinitionDigest)(definitionBase) };
|
|
311
326
|
const typesafe = input.judge?.protocol.kind === "typesafe-system-one";
|
|
@@ -326,13 +341,25 @@ function prepareManagedScoreMatch(input) {
|
|
|
326
341
|
: typesafe
|
|
327
342
|
? { schemaVersion: 2, protocol: typesafeProtocol, definition, input: captured, calls: calls, result }
|
|
328
343
|
: { schemaVersion: 1, protocol: chatProtocol, definition, input: captured, calls: calls, result };
|
|
344
|
+
const envelopeOf = (value) => {
|
|
345
|
+
const encoded = (0, score_match_audit_ts_1.canonicalScoreMatchAuditJson)(value);
|
|
346
|
+
const chunks = (0, judge_ts_1.chunkUtf8)(encoded);
|
|
347
|
+
return {
|
|
348
|
+
manifest: { schemaVersion: auditVersion, protocol: auditProtocol, byteLength: bytes(encoded), digest: (0, node_crypto_1.createHash)("sha256").update(encoded).digest("hex"), chunkByteLengths: chunks.map(bytes) },
|
|
349
|
+
content: chunks,
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
const auditSize = (value) => Math.max(bytes((0, score_match_audit_ts_1.canonicalScoreMatchAuditJson)(value)), bytes((0, score_match_audit_ts_1.canonicalScoreMatchAuditJson)(envelopeOf(value))));
|
|
329
353
|
const latch = (problem) => {
|
|
330
354
|
if (!closed)
|
|
331
355
|
latched ??= problem;
|
|
332
356
|
return latched ?? problem;
|
|
333
357
|
};
|
|
334
|
-
|
|
335
|
-
|
|
358
|
+
const canRetainAudit = auditSize(audit()) + terminalReserve * 2 <= options.llm.maxAuditBytes;
|
|
359
|
+
if (!canRetainAudit)
|
|
360
|
+
latch(failure("unavailable", "score-match-audit-budget", "Audit budget cannot retain the definition, input and terminal result"));
|
|
361
|
+
else if (bytes(captured) > options.llm.maxMaterialBytes)
|
|
362
|
+
latch(failure("unavailable", "score-match-material-budget", "ScoreMatch material exceeds its byte budget"));
|
|
336
363
|
const invoke = (operation, raw) => effect_1.Effect.suspend(() => {
|
|
337
364
|
if (closed || !evaluationStarted)
|
|
338
365
|
return effect_1.Effect.fail(typedFailure(failure("errored", "score-match-context-closed", "LLM context is outside its owning evaluation")));
|
|
@@ -371,17 +398,22 @@ function prepareManagedScoreMatch(input) {
|
|
|
371
398
|
}
|
|
372
399
|
if (bytes(prepared.material) > options.llm.maxMaterialBytes)
|
|
373
400
|
return reject(failure("unavailable", "score-match-material-budget", "LLM step material exceeds its byte budget"));
|
|
374
|
-
const
|
|
375
|
-
|
|
401
|
+
const prospective = { ...audit(), calls: [...calls, {
|
|
402
|
+
ordinal: calls.length + 1, operation, state: "admitted",
|
|
403
|
+
...(prepared.requestTemplate === undefined ? { request: prepared.request } : { requestTemplate: prepared.requestTemplate, wireBody: prepared.wireBody }),
|
|
404
|
+
...(prepared.mapping === undefined ? {} : { mapping: prepared.mapping }),
|
|
405
|
+
attempts: [], result: { state: "interrupted" },
|
|
406
|
+
}] };
|
|
407
|
+
const remaining = options.llm.maxAuditBytes - auditSize(prospective) - terminalReserve * 4;
|
|
376
408
|
const providerResponseCap = profile.protocol.kind === "chat-completions"
|
|
377
409
|
? Math.min(profile.maxResponseBytes, (0, judge_ts_1.responseByteCap)(profile.protocol.maxOutputTokens))
|
|
378
410
|
: profile.maxResponseBytes;
|
|
379
|
-
const responseCap = Math.min(providerResponseCap, Math.floor(remaining /
|
|
411
|
+
const responseCap = Math.min(providerResponseCap, Math.floor(remaining / 25));
|
|
380
412
|
// Successful output can occur only once. Failed transmissions retain bounded
|
|
381
413
|
// metadata. Reserve the worst JSON escaping of that response and its decoded
|
|
382
|
-
// output
|
|
383
|
-
|
|
384
|
-
if (responseCap < 1024
|
|
414
|
+
// output in both the canonical audit and the persisted envelope, including
|
|
415
|
+
// chunk metadata, three attempt records and the terminal rejection reserve.
|
|
416
|
+
if (responseCap < 1024)
|
|
385
417
|
return reject(failure("unavailable", "score-match-audit-budget", "Audit budget cannot retain this request and its bounded response"));
|
|
386
418
|
const apiKey = (0, provider_ts_1.resolveJudgeCredential)(profile);
|
|
387
419
|
if (!apiKey) {
|
|
@@ -410,6 +442,14 @@ function prepareManagedScoreMatch(input) {
|
|
|
410
442
|
let received;
|
|
411
443
|
const sent = effect_1.Effect.tryPromise({
|
|
412
444
|
try: (signal) => {
|
|
445
|
+
if (signal.aborted)
|
|
446
|
+
return Promise.reject(new DOMException("Judge request cancelled", "AbortError"));
|
|
447
|
+
const usage = input.usage?.begin({
|
|
448
|
+
logicalOrdinal: index + 1, transmissionOrdinal: attempt, operation,
|
|
449
|
+
requestModel: profile.model, transportProvider: profile.provider,
|
|
450
|
+
});
|
|
451
|
+
if (input.usage !== undefined && usage === undefined)
|
|
452
|
+
return Promise.reject(new JudgeUsageAdmissionError());
|
|
413
453
|
attempts.push({ ordinal: attempt, transport: "attempted", result: { state: "interrupted" } });
|
|
414
454
|
update();
|
|
415
455
|
return (0, judge_ts_1.requestScoreMatchProvider)({
|
|
@@ -419,6 +459,8 @@ function prepareManagedScoreMatch(input) {
|
|
|
419
459
|
body: prepared.request,
|
|
420
460
|
maxBytes: responseCap,
|
|
421
461
|
signal,
|
|
462
|
+
...(usage === undefined ? {} : { usage }),
|
|
463
|
+
deadlineAt,
|
|
422
464
|
});
|
|
423
465
|
},
|
|
424
466
|
catch: (error) => error,
|
|
@@ -428,6 +470,12 @@ function prepareManagedScoreMatch(input) {
|
|
|
428
470
|
? Object.assign(new Error(`HTTP ${outcome.value.status}`), { status: outcome.value.status, headers: outcome.value.headers })
|
|
429
471
|
: outcome.ok ? undefined : outcome.error;
|
|
430
472
|
if (error !== undefined) {
|
|
473
|
+
if (error instanceof JudgeUsageAdmissionError) {
|
|
474
|
+
const problem = latch(failure("unavailable", "judge-usage-capacity-exceeded", "Judge usage cannot retain another physical transmission"));
|
|
475
|
+
callResult = problem;
|
|
476
|
+
update();
|
|
477
|
+
return yield* effect_1.Effect.fail(typedFailure(problem));
|
|
478
|
+
}
|
|
431
479
|
attempts[attempt - 1] = { ordinal: attempt, transport: "attempted", result: { state: "failed", code: "judge-call-failed", message: (0, judge_ts_1.errorSummary)(error) } };
|
|
432
480
|
update();
|
|
433
481
|
if ((0, judge_ts_1.isTransientJudgeFailure)(error) && attempt < 3) {
|
|
@@ -483,6 +531,8 @@ function prepareManagedScoreMatch(input) {
|
|
|
483
531
|
batchClassify: (value) => invoke("batchClassify", value),
|
|
484
532
|
}) });
|
|
485
533
|
const finish = (output) => {
|
|
534
|
+
const genuine = latched === undefined && typeof output === "object" && (output.state === "measured" || output.state === "unavailable") ? output : undefined;
|
|
535
|
+
const explanation = genuine === undefined ? {} : { ...(genuine.rationale === undefined ? {} : { rationale: { state: "available", value: genuine.rationale } }), citations: genuine.citations === undefined ? { state: "unavailable", reason: "not-recorded" } : { state: "available", value: [...genuine.citations] } };
|
|
486
536
|
if (latched === undefined && calls.some((call) => call.state !== "admitted" || call.result.state !== "completed")) {
|
|
487
537
|
latch(failure("unavailable", "score-match-incomplete-step", "A necessary LLM step did not complete"));
|
|
488
538
|
}
|
|
@@ -494,7 +544,7 @@ function prepareManagedScoreMatch(input) {
|
|
|
494
544
|
else {
|
|
495
545
|
result = { state: "measured", value: measurement };
|
|
496
546
|
const rationale = typeof output === "number" ? undefined : output.rationale;
|
|
497
|
-
return { state: "measured", value: measurement,
|
|
547
|
+
return { state: "measured", value: measurement, detail: explanation };
|
|
498
548
|
}
|
|
499
549
|
}
|
|
500
550
|
else if (output?.state === "unavailable")
|
|
@@ -507,7 +557,7 @@ function prepareManagedScoreMatch(input) {
|
|
|
507
557
|
const problem = latched;
|
|
508
558
|
result = problem;
|
|
509
559
|
return problem.state === "unavailable"
|
|
510
|
-
? { state: "unavailable", reason: "source-unavailable", detail: { failureDetail: problem.code, failureEvidence: problem.message, rationale: { state: "unavailable", reason: "not-recorded" }, evidence: { state: "unavailable", reason: "not-recorded" }, detail: { state: "unavailable", reason: "not-recorded" }, citations: { state: "unavailable", reason: "not-recorded" } } }
|
|
560
|
+
? { state: "unavailable", reason: "source-unavailable", detail: { failureDetail: problem.code, failureEvidence: problem.message, rationale: { state: "unavailable", reason: "not-recorded" }, evidence: { state: "unavailable", reason: "not-recorded" }, detail: { state: "unavailable", reason: "not-recorded" }, citations: { state: "unavailable", reason: "not-recorded" }, ...explanation } }
|
|
511
561
|
: { state: "errored", detail: { code: problem.code, message: problem.message } };
|
|
512
562
|
};
|
|
513
563
|
const evaluate = () => {
|
|
@@ -515,6 +565,9 @@ function prepareManagedScoreMatch(input) {
|
|
|
515
565
|
if (evaluationStarted || closed)
|
|
516
566
|
return effect_1.Effect.die(new Error("Managed ScoreMatch may only evaluate once"));
|
|
517
567
|
evaluationStarted = true;
|
|
568
|
+
deadlineAt = Date.now() + (input.judge?.timeoutMs ?? 180000);
|
|
569
|
+
if (latched !== undefined)
|
|
570
|
+
return effect_1.Effect.succeed({ state: "unavailable", reason: latched.message });
|
|
518
571
|
return options.score(material, context);
|
|
519
572
|
}).pipe(effect_1.Effect.catchCause((cause) => effect_1.Cause.hasInterrupts(cause) ? effect_1.Effect.interrupt : effect_1.Effect.succeed({ state: "errored", code: "score-match-callback-error", message: (0, judge_ts_1.errorSummary)(effect_1.Cause.squash(cause)) })), effect_1.Effect.flatMap((output) => effect_1.Effect.gen(function* () {
|
|
520
573
|
if (busy || pending.size > 0)
|
|
@@ -526,6 +579,7 @@ function prepareManagedScoreMatch(input) {
|
|
|
526
579
|
orElse: () => effect_1.Effect.sync(() => { latch(failure("unavailable", "judge-call-failed", "Managed ScoreMatch evaluation timed out")); return finish(0); }),
|
|
527
580
|
}), effect_1.Effect.ensuring(effect_1.Effect.gen(function* () {
|
|
528
581
|
// Stop escaped child calls and await their finalizers before terminal Content.
|
|
582
|
+
input.usage?.close();
|
|
529
583
|
yield* effect_1.Fiber.interruptAll([...pending]);
|
|
530
584
|
closed = true;
|
|
531
585
|
})));
|
|
@@ -533,24 +587,28 @@ function prepareManagedScoreMatch(input) {
|
|
|
533
587
|
};
|
|
534
588
|
return {
|
|
535
589
|
criterion: { kind: "managed-score-measurement", name: options.name, scale: "unit-interval" },
|
|
536
|
-
|
|
537
|
-
|
|
590
|
+
terminalCriterion: () => canRetainAudit
|
|
591
|
+
? { kind: "managed-score-measurement", name: options.name, scale: "unit-interval" }
|
|
592
|
+
: { kind: "value-match", subject: "explicit-value", matcher: { state: "declared", name: options.name } },
|
|
593
|
+
subject,
|
|
594
|
+
retainedBytes: (0, full_content_ts_1.fullAssertionContentByteLength)(subject) + options.llm.maxAuditBytes,
|
|
538
595
|
retainedImageBytes: images.reduce((sum, image) => sum + image.byteLength, 0),
|
|
539
596
|
evidence: Object.freeze(images.map((image) => ({ kind: "judge-image", image: image.image }))),
|
|
540
597
|
evaluate,
|
|
541
598
|
terminalEvidence: () => {
|
|
542
599
|
if (sealed !== undefined)
|
|
543
600
|
return sealed;
|
|
601
|
+
input.usage?.close();
|
|
544
602
|
closed = true;
|
|
545
|
-
const
|
|
546
|
-
|
|
547
|
-
const envelope = {
|
|
548
|
-
manifest: { schemaVersion: auditVersion, protocol: auditProtocol, byteLength: bytes(encoded), digest: (0, node_crypto_1.createHash)("sha256").update(encoded).digest("hex"), chunkByteLengths: chunks.map(bytes) },
|
|
549
|
-
content: chunks,
|
|
550
|
-
};
|
|
551
|
-
sealed = Object.freeze([{ kind: "snapshot", value: (0, judge_ts_1.snapshotScoreMatchMaterial)(envelope) }]);
|
|
603
|
+
const payload = canRetainAudit ? envelopeOf(audit()) : { failure: latched };
|
|
604
|
+
sealed = Object.freeze([(0, full_content_ts_1.captureFullAssertionSnapshot)(payload).material]);
|
|
552
605
|
return sealed;
|
|
553
606
|
},
|
|
607
|
+
actualRetainedBytes: () => (0, full_content_ts_1.fullAssertionContentByteLength)(subject) + (sealed ?? []).reduce((sum, evidence) => sum + ((0, full_content_ts_1.fullAssertionContentByteLength)(evidence) ?? 0), 0),
|
|
554
608
|
};
|
|
555
609
|
}
|
|
610
|
+
function validateEvidenceIds(value, empty = false) {
|
|
611
|
+
if (!Array.isArray(value) || value.length > 16384 || !empty && value.length === 0 || value.some((id) => typeof id !== "string" || id.trim() === "" || bytes(id) > 128 || /[\u0000-\u001f\u007f]/u.test(id)) || new Set(value).size !== value.length)
|
|
612
|
+
throw new TypeError("Evidence IDs must be unique bounded strings");
|
|
613
|
+
}
|
|
556
614
|
//# sourceMappingURL=score-match-gateway.cjs.map
|