niceeval 0.18.0 → 0.19.0
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 +4 -2
- package/dist/adapter-usage.cjs.map +1 -1
- package/dist/adapter-usage.d.cts +1 -1
- package/dist/adapter-usage.d.mts +1 -1
- package/dist/adapter-usage.d.ts +1 -1
- package/dist/adapter.cjs +8 -7
- package/dist/adapter.cjs.map +1 -1
- package/dist/adapter.d.cts +21 -21
- package/dist/adapter.d.mts +21 -21
- package/dist/adapter.d.ts +21 -21
- package/dist/agents/{effect-runtime.cjs → agent-effects.cjs} +12 -18
- package/dist/agents/agent-effects.cjs.map +1 -0
- package/dist/agents/agent-effects.d.cts +23 -0
- package/dist/agents/agent-effects.d.mts +23 -0
- package/dist/agents/agent-effects.d.ts +23 -0
- package/dist/agents/agent-effects.js +16 -0
- package/dist/agents/agent-effects.js.map +1 -0
- package/dist/agents/ai-sdk.cjs +1 -1
- package/dist/agents/ai-sdk.cjs.map +1 -1
- package/dist/agents/bub.cjs +31 -18
- package/dist/agents/bub.cjs.map +1 -1
- package/dist/agents/bub.d.cts +9 -12
- package/dist/agents/bub.d.mts +9 -12
- package/dist/agents/bub.d.ts +9 -12
- package/dist/agents/claude-code-native.cjs +2 -2
- package/dist/agents/claude-code-native.cjs.map +1 -1
- package/dist/agents/claude-code.cjs +17 -11
- package/dist/agents/claude-code.cjs.map +1 -1
- package/dist/agents/claude-code.d.cts +11 -11
- package/dist/agents/claude-code.d.mts +11 -11
- package/dist/agents/claude-code.d.ts +11 -11
- package/dist/agents/codex-app-server.cjs +2 -2
- package/dist/agents/codex-app-server.cjs.map +1 -1
- package/dist/agents/codex.cjs +18 -12
- package/dist/agents/codex.cjs.map +1 -1
- package/dist/agents/codex.d.cts +12 -12
- package/dist/agents/codex.d.mts +12 -12
- package/dist/agents/codex.d.ts +12 -12
- package/dist/agents/deepseek-harness.cjs +2 -2
- package/dist/agents/deepseek-harness.cjs.map +1 -1
- package/dist/agents/hermes.cjs +3 -3
- package/dist/agents/hermes.cjs.map +1 -1
- package/dist/agents/index.cjs +3 -3
- package/dist/agents/index.cjs.map +1 -1
- package/dist/agents/index.d.cts +3 -3
- package/dist/agents/index.d.mts +3 -3
- package/dist/agents/index.d.ts +3 -3
- package/dist/agents/index.js +2 -2
- package/dist/agents/index.mjs +2 -2
- package/dist/agents/mcp.cjs.map +1 -1
- package/dist/agents/mcp.d.cts +2 -2
- package/dist/agents/mcp.d.mts +2 -2
- package/dist/agents/mcp.d.ts +2 -2
- package/dist/agents/omp.cjs +2 -2
- package/dist/agents/omp.cjs.map +1 -1
- package/dist/agents/openai-compat.cjs +2 -2
- package/dist/agents/openai-compat.cjs.map +1 -1
- package/dist/agents/openclaw.cjs +3 -3
- package/dist/agents/openclaw.cjs.map +1 -1
- package/dist/agents/opencode.cjs +16 -4
- package/dist/agents/opencode.cjs.map +1 -1
- package/dist/agents/plugin-extensions.cjs +71 -0
- package/dist/agents/plugin-extensions.cjs.map +1 -0
- package/dist/agents/plugin-extensions.d.cts +26 -0
- package/dist/agents/plugin-extensions.d.mts +26 -0
- package/dist/agents/plugin-extensions.d.ts +26 -0
- package/dist/agents/plugin-extensions.js +8 -0
- package/dist/agents/plugin-extensions.js.map +1 -0
- package/dist/agents/post-setup.cjs +14 -3
- package/dist/agents/post-setup.cjs.map +1 -1
- package/dist/agents/post-setup.d.cts +4 -2
- package/dist/agents/post-setup.d.mts +4 -2
- package/dist/agents/post-setup.d.ts +4 -2
- package/dist/agents/post-setup.js +8 -6
- package/dist/agents/sdk-streams.cjs +3 -3
- package/dist/agents/sdk-streams.cjs.map +1 -1
- package/dist/agents/{session-slot.cjs → session-key.cjs} +4 -4
- package/dist/agents/session-key.cjs.map +1 -0
- package/dist/agents/session-key.d.cts +12 -0
- package/dist/agents/session-key.d.mts +12 -0
- package/dist/agents/session-key.d.ts +12 -0
- package/dist/agents/session-key.js +6 -0
- package/dist/agents/session-key.js.map +1 -0
- package/dist/agents/shared.cjs +2 -2
- package/dist/agents/shared.cjs.map +1 -1
- package/dist/agents/shared.d.cts +4 -4
- package/dist/agents/shared.d.mts +4 -4
- package/dist/agents/shared.d.ts +4 -4
- package/dist/agents/skills.cjs.map +1 -1
- package/dist/agents/skills.d.cts +3 -3
- package/dist/agents/skills.d.mts +3 -3
- package/dist/agents/skills.d.ts +3 -3
- package/dist/agents/types.cjs.map +1 -1
- package/dist/agents/types.d.cts +55 -54
- package/dist/agents/types.d.mts +55 -54
- package/dist/agents/types.d.ts +55 -54
- package/dist/agents/ui-message-stream.cjs +4 -4
- package/dist/agents/ui-message-stream.cjs.map +1 -1
- package/dist/agents/unrecognized-events.cjs +32 -0
- package/dist/agents/unrecognized-events.cjs.map +1 -0
- package/dist/agents/unrecognized-events.d.cts +8 -0
- package/dist/agents/unrecognized-events.d.mts +8 -0
- package/dist/agents/unrecognized-events.d.ts +8 -0
- package/dist/agents/unrecognized-events.js +6 -0
- package/dist/agents/unrecognized-events.js.map +1 -0
- package/dist/assertions/api.cjs.map +1 -1
- package/dist/assertions/api.d.cts +3 -0
- package/dist/assertions/api.d.mts +3 -0
- package/dist/assertions/api.d.ts +3 -0
- package/dist/assertions/collection.cjs +1 -1
- package/dist/assertions/collection.cjs.map +1 -1
- package/dist/assertions/judge.cjs +1 -1
- package/dist/assertions/judge.cjs.map +1 -1
- package/dist/assertions/match.cjs +52 -21
- package/dist/assertions/match.cjs.map +1 -1
- package/dist/assertions/match.d.cts +16 -5
- package/dist/assertions/match.d.mts +16 -5
- package/dist/assertions/match.d.ts +16 -5
- package/dist/assertions/match.js +96 -94
- package/dist/assertions/measurements.cjs +22 -6
- package/dist/assertions/measurements.cjs.map +1 -1
- package/dist/assertions/measurements.d.cts +8 -1
- package/dist/assertions/measurements.d.mts +8 -1
- package/dist/assertions/measurements.d.ts +8 -1
- package/dist/assertions/numeric.cjs +2 -0
- package/dist/assertions/numeric.cjs.map +1 -1
- package/dist/assertions/numeric.d.cts +1 -1
- package/dist/assertions/numeric.d.mts +1 -1
- package/dist/assertions/numeric.d.ts +1 -1
- package/dist/assertions/quantity.cjs +42 -0
- package/dist/assertions/quantity.cjs.map +1 -0
- package/dist/assertions/quantity.d.cts +18 -0
- package/dist/assertions/quantity.d.mts +18 -0
- package/dist/assertions/quantity.d.ts +18 -0
- package/dist/assertions/quantity.js +22 -0
- package/dist/assertions/quantity.js.map +1 -0
- package/dist/assertions/record/attachment.cjs +2 -0
- package/dist/assertions/record/attachment.cjs.map +1 -1
- package/dist/assertions/record/codec.cjs +5 -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 +3 -1
- package/dist/assertions/record/model.d.mts +3 -1
- package/dist/assertions/record/model.d.ts +3 -1
- package/dist/assertions/runtime.cjs +11 -6
- package/dist/assertions/runtime.cjs.map +1 -1
- package/dist/cli/program.cjs +3 -0
- package/dist/cli/program.cjs.map +1 -1
- package/dist/context/assert-first.cjs +6 -4
- package/dist/context/assert-first.cjs.map +1 -1
- package/dist/context/assert-first.d.cts +9 -3
- package/dist/context/assert-first.d.mts +9 -3
- package/dist/context/assert-first.d.ts +9 -3
- package/dist/context/notes.cjs +47 -0
- package/dist/context/notes.cjs.map +1 -0
- package/dist/context/notes.d.cts +10 -0
- package/dist/context/notes.d.mts +10 -0
- package/dist/context/notes.d.ts +10 -0
- package/dist/context/notes.js +6 -0
- package/dist/context/notes.js.map +1 -0
- package/dist/context/send-failures.cjs +1 -7
- package/dist/context/send-failures.cjs.map +1 -1
- package/dist/context/send-failures.d.cts +2 -3
- package/dist/context/send-failures.d.mts +2 -3
- package/dist/context/send-failures.d.ts +2 -3
- package/dist/context/send-retry.cjs +0 -1
- package/dist/context/send-retry.cjs.map +1 -1
- package/dist/context/send-retry.d.cts +1 -2
- package/dist/context/send-retry.d.mts +1 -2
- package/dist/context/send-retry.d.ts +1 -2
- package/dist/context/session.cjs +10 -17
- package/dist/context/session.cjs.map +1 -1
- package/dist/context/session.d.cts +4 -10
- package/dist/context/session.d.mts +4 -10
- package/dist/context/session.d.ts +4 -10
- package/dist/define.cjs +88 -65
- package/dist/define.cjs.map +1 -1
- package/dist/define.d.cts +3 -3
- package/dist/define.d.mts +3 -3
- package/dist/define.d.ts +3 -3
- package/dist/eval/cli/contribution.cjs +1 -1
- package/dist/eval/cli/contribution.cjs.map +1 -1
- package/dist/eval/host/index.cjs +1 -1
- package/dist/eval/host/index.cjs.map +1 -1
- package/dist/eval/record/evaluation.cjs +1 -1
- package/dist/eval/record/evaluation.cjs.map +1 -1
- package/dist/eval/record/membership-provenance.d.cts +3 -3
- package/dist/eval/record/membership-provenance.d.mts +3 -3
- package/dist/eval/record/membership-provenance.d.ts +3 -3
- package/dist/eval/record/score.cjs +2 -2
- package/dist/eval/record/score.cjs.map +1 -1
- package/dist/eval/record/sealed-assertion.cjs +1 -1
- package/dist/eval/record/sealed-assertion.cjs.map +1 -1
- package/dist/eval/record/verdict.cjs +2 -2
- package/dist/eval/record/verdict.cjs.map +1 -1
- package/dist/expect/index.cjs +10 -1
- package/dist/expect/index.cjs.map +1 -1
- package/dist/expect/index.d.cts +3 -1
- package/dist/expect/index.d.mts +3 -1
- package/dist/expect/index.d.ts +3 -1
- package/dist/expect/index.js +92 -76
- package/dist/expect/index.mjs +92 -76
- package/dist/experiment/host/cli/contribution.cjs +52 -39
- package/dist/experiment/host/cli/contribution.cjs.map +1 -1
- package/dist/experiment/host/cli/contribution.d.cts +18 -4
- package/dist/experiment/host/cli/contribution.d.mts +18 -4
- package/dist/experiment/host/cli/contribution.d.ts +18 -4
- package/dist/experiment/host/cli/contribution.js +2 -2
- package/dist/experiment/host/cli/debug-protocol.cjs +2 -2
- package/dist/experiment/host/cli/debug-protocol.cjs.map +1 -1
- package/dist/experiment/host/cli/debug-protocol.d.cts +2 -2
- package/dist/experiment/host/cli/debug-protocol.d.mts +2 -2
- package/dist/experiment/host/cli/debug-protocol.d.ts +2 -2
- package/dist/experiment/host/cli/output-protocol.cjs +1 -1
- package/dist/experiment/host/cli/output-protocol.cjs.map +1 -1
- package/dist/experiment/host/cli/output-protocol.d.cts +2 -2
- package/dist/experiment/host/cli/output-protocol.d.mts +2 -2
- package/dist/experiment/host/cli/output-protocol.d.ts +2 -2
- package/dist/experiment/host/current.cjs +2 -2
- package/dist/experiment/host/current.cjs.map +1 -1
- package/dist/experiment/host/index.cjs +1 -1
- package/dist/experiment/host/index.cjs.map +1 -1
- package/dist/experiment/host/operations.cjs +21 -22
- package/dist/experiment/host/operations.cjs.map +1 -1
- package/dist/experiment/host/runtime.cjs +8 -9
- package/dist/experiment/host/runtime.cjs.map +1 -1
- package/dist/experiment/host/runtime.d.cts +3 -3
- package/dist/experiment/host/runtime.d.mts +3 -3
- package/dist/experiment/host/runtime.d.ts +3 -3
- package/dist/experiment/host/teardown.cjs +3 -3
- package/dist/experiment/host/teardown.cjs.map +1 -1
- package/dist/experiment/host/teardown.d.cts +3 -3
- package/dist/experiment/host/teardown.d.mts +3 -3
- package/dist/experiment/host/teardown.d.ts +3 -3
- package/dist/experiment/host/types.cjs.map +1 -1
- package/dist/experiment/host/types.d.cts +19 -19
- package/dist/experiment/host/types.d.mts +19 -19
- package/dist/experiment/host/types.d.ts +19 -19
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/dist/inspection/assertions.cjs +1 -1
- package/dist/inspection/assertions.cjs.map +1 -1
- package/dist/inspection/cli/contribution.cjs +8 -7
- package/dist/inspection/cli/contribution.cjs.map +1 -1
- package/dist/inspection/facts.cjs +4 -4
- package/dist/inspection/facts.cjs.map +1 -1
- package/dist/inspection/index.cjs +1 -5
- package/dist/inspection/index.cjs.map +1 -1
- package/dist/inspection/index.d.cts +1 -2
- package/dist/inspection/index.d.mts +1 -2
- package/dist/inspection/index.d.ts +1 -2
- package/dist/inspection/index.js +20 -26
- package/dist/inspection/lifecycle.cjs +7 -0
- package/dist/inspection/lifecycle.cjs.map +1 -0
- package/dist/inspection/lifecycle.d.cts +4 -0
- package/dist/inspection/lifecycle.d.mts +4 -0
- package/dist/inspection/lifecycle.d.ts +4 -0
- package/dist/inspection/lifecycle.js +6 -0
- package/dist/inspection/lifecycle.js.map +1 -0
- package/dist/inspection/notes.cjs +40 -0
- package/dist/inspection/notes.cjs.map +1 -0
- package/dist/inspection/notes.d.cts +12 -0
- package/dist/inspection/notes.d.mts +12 -0
- package/dist/inspection/notes.d.ts +12 -0
- package/dist/inspection/notes.js +8 -0
- package/dist/inspection/notes.js.map +1 -0
- package/dist/inspection/overview.cjs +12 -15
- package/dist/inspection/overview.cjs.map +1 -1
- package/dist/inspection/overview.d.cts +8 -6
- package/dist/inspection/overview.d.mts +8 -6
- package/dist/inspection/overview.d.ts +8 -6
- package/dist/inspection/planned-attempt.cjs +45 -0
- package/dist/inspection/planned-attempt.cjs.map +1 -0
- package/dist/inspection/planned-attempt.d.cts +109 -0
- package/dist/inspection/planned-attempt.d.mts +109 -0
- package/dist/inspection/planned-attempt.d.ts +109 -0
- package/dist/inspection/planned-attempt.js +24 -0
- package/dist/inspection/planned-attempt.js.map +1 -0
- package/dist/inspection/project-result.cjs +5 -5
- package/dist/inspection/project-result.cjs.map +1 -1
- package/dist/inspection/project-result.d.cts +58 -57
- package/dist/inspection/project-result.d.mts +58 -57
- package/dist/inspection/project-result.d.ts +58 -57
- package/dist/inspection/project-result.js +4 -4
- package/dist/inspection/project.cjs +3 -3
- package/dist/inspection/project.cjs.map +1 -1
- package/dist/inspection/protocol-values.cjs +1 -1
- package/dist/inspection/protocol-values.cjs.map +1 -1
- package/dist/inspection/protocol-values.d.cts +1 -1
- package/dist/inspection/protocol-values.d.mts +1 -1
- package/dist/inspection/protocol-values.d.ts +1 -1
- package/dist/inspection/protocol.cjs +8 -8
- package/dist/inspection/protocol.cjs.map +1 -1
- package/dist/inspection/protocol.d.cts +237 -219
- package/dist/inspection/protocol.d.mts +237 -219
- package/dist/inspection/protocol.d.ts +237 -219
- package/dist/inspection/public.cjs +1 -5
- package/dist/inspection/public.cjs.map +1 -1
- package/dist/inspection/public.d.cts +1 -2
- package/dist/inspection/public.d.mts +1 -2
- package/dist/inspection/public.d.ts +1 -2
- package/dist/inspection/public.js +14 -20
- package/dist/inspection/public.mjs +166 -129
- package/dist/inspection/query.cjs +1 -1
- package/dist/inspection/query.cjs.map +1 -1
- package/dist/inspection/results.cjs +61 -52
- package/dist/inspection/results.cjs.map +1 -1
- package/dist/inspection/results.d.cts +157 -140
- package/dist/inspection/results.d.mts +157 -140
- package/dist/inspection/results.d.ts +157 -140
- package/dist/inspection/select.cjs +33 -28
- package/dist/inspection/select.cjs.map +1 -1
- package/dist/inspection/source.cjs +1 -1
- package/dist/inspection/source.cjs.map +1 -1
- package/dist/inspection/sources.cjs +2 -2
- package/dist/inspection/sources.cjs.map +1 -1
- package/dist/inspection/trace.cjs +9 -8
- package/dist/inspection/trace.cjs.map +1 -1
- package/dist/inspection/trace.d.cts +4 -4
- package/dist/inspection/trace.d.mts +4 -4
- package/dist/inspection/trace.d.ts +4 -4
- package/dist/loaders/index.cjs +7 -279
- package/dist/loaders/index.cjs.map +1 -1
- package/dist/loaders/index.d.cts +2 -95
- package/dist/loaders/index.d.mts +2 -95
- package/dist/loaders/index.d.ts +2 -95
- package/dist/loaders/index.js +10 -12
- package/dist/loaders/index.mjs +10 -12
- package/dist/loaders/runtime.cjs +283 -0
- package/dist/loaders/runtime.cjs.map +1 -0
- package/dist/loaders/runtime.d.cts +95 -0
- package/dist/loaders/runtime.d.mts +95 -0
- package/dist/loaders/runtime.d.ts +95 -0
- package/dist/loaders/runtime.js +16 -0
- package/dist/loaders/runtime.js.map +1 -0
- package/dist/migrations/judge-provider.md +6 -6
- package/dist/{model-slots.cjs → model-roles.cjs} +12 -12
- package/dist/{model-slots.cjs.map → model-roles.cjs.map} +1 -1
- package/dist/{model-slots.d.cts → model-roles.d.cts} +10 -10
- package/dist/{model-slots.d.mts → model-roles.d.mts} +10 -10
- package/dist/{model-slots.d.ts → model-roles.d.ts} +10 -10
- package/dist/model-roles.js +14 -0
- package/dist/model-roles.js.map +1 -0
- package/dist/o11y/adapter-usage-projection.cjs +9 -8
- package/dist/o11y/adapter-usage-projection.cjs.map +1 -1
- package/dist/o11y/adapter-usage-projection.d.cts +23 -15
- package/dist/o11y/adapter-usage-projection.d.mts +23 -15
- package/dist/o11y/adapter-usage-projection.d.ts +23 -15
- package/dist/o11y/cache-read.cjs +14 -14
- package/dist/o11y/cache-read.cjs.map +1 -1
- package/dist/o11y/cache-read.d.cts +5 -5
- package/dist/o11y/cache-read.d.mts +5 -5
- package/dist/o11y/cache-read.d.ts +5 -5
- package/dist/o11y/derive.cjs.map +1 -1
- package/dist/o11y/derive.d.cts +2 -2
- package/dist/o11y/derive.d.mts +2 -2
- package/dist/o11y/derive.d.ts +2 -2
- package/dist/o11y/eval-usage.cjs +9 -9
- package/dist/o11y/eval-usage.cjs.map +1 -1
- package/dist/o11y/eval-usage.d.cts +7 -7
- package/dist/o11y/eval-usage.d.mts +7 -7
- package/dist/o11y/eval-usage.d.ts +7 -7
- package/dist/o11y/parsers/bub.cjs +57 -81
- package/dist/o11y/parsers/bub.cjs.map +1 -1
- package/dist/o11y/parsers/index.cjs.map +1 -1
- package/dist/o11y/parsers/index.d.cts +2 -0
- package/dist/o11y/parsers/index.d.mts +2 -0
- package/dist/o11y/parsers/index.d.ts +2 -0
- package/dist/o11y/parsers/opencode.cjs +129 -217
- package/dist/o11y/parsers/opencode.cjs.map +1 -1
- package/dist/o11y/parsers/opencode.d.cts +2 -5
- package/dist/o11y/parsers/opencode.d.mts +2 -5
- package/dist/o11y/parsers/opencode.d.ts +2 -5
- package/dist/o11y/types.cjs.map +1 -1
- package/dist/o11y/types.d.cts +1 -1
- package/dist/o11y/types.d.mts +1 -1
- package/dist/o11y/types.d.ts +1 -1
- package/dist/plugin/contracts.cjs +170 -120
- package/dist/plugin/contracts.cjs.map +1 -1
- package/dist/plugin/contracts.d.cts +102 -90
- package/dist/plugin/contracts.d.mts +102 -90
- package/dist/plugin/contracts.d.ts +102 -90
- package/dist/plugin/contracts.js +16 -12
- package/dist/plugin/index.cjs.map +1 -1
- package/dist/plugin/index.d.cts +1 -1
- package/dist/plugin/index.d.mts +1 -1
- package/dist/plugin/index.d.ts +1 -1
- package/dist/plugin/link.cjs +69 -64
- package/dist/plugin/link.cjs.map +1 -1
- package/dist/plugin/link.d.cts +5 -3
- package/dist/plugin/link.d.mts +5 -3
- package/dist/plugin/link.d.ts +5 -3
- package/dist/plugin/link.js +12 -8
- 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/attempt-note/definition.cjs +12 -0
- package/dist/record/family/attempt-note/definition.cjs.map +1 -0
- package/dist/record/family/attempt-note/definition.d.cts +6 -0
- package/dist/record/family/attempt-note/definition.d.mts +6 -0
- package/dist/record/family/attempt-note/definition.d.ts +6 -0
- package/dist/record/family/attempt-note/definition.js +6 -0
- package/dist/record/family/attempt-note/definition.js.map +1 -0
- package/dist/record/family/attempt-note/persistence.cjs +10 -0
- package/dist/record/family/attempt-note/persistence.cjs.map +1 -0
- package/dist/record/family/attempt-note/persistence.d.cts +6 -0
- package/dist/record/family/attempt-note/persistence.d.mts +6 -0
- package/dist/record/family/attempt-note/persistence.d.ts +6 -0
- package/dist/record/family/attempt-note/persistence.js +6 -0
- package/dist/record/family/attempt-note/persistence.js.map +1 -0
- package/dist/record/family/attempt-note/schema.cjs +20 -0
- package/dist/record/family/attempt-note/schema.cjs.map +1 -0
- package/dist/record/family/attempt-note/schema.d.cts +21 -0
- package/dist/record/family/attempt-note/schema.d.mts +21 -0
- package/dist/record/family/attempt-note/schema.d.ts +21 -0
- package/dist/record/family/attempt-note/schema.js +10 -0
- package/dist/record/family/attempt-note/schema.js.map +1 -0
- package/dist/record/family/catalog.cjs +32 -29
- package/dist/record/family/catalog.cjs.map +1 -1
- package/dist/record/family/catalog.d.cts +7 -2
- package/dist/record/family/catalog.d.mts +7 -2
- package/dist/record/family/catalog.d.ts +7 -2
- package/dist/record/family/current.cjs +48 -45
- package/dist/record/family/current.cjs.map +1 -1
- package/dist/record/family/current.d.cts +15 -0
- package/dist/record/family/current.d.mts +15 -0
- package/dist/record/family/current.d.ts +15 -0
- package/dist/record/model/index.js +66 -64
- package/dist/record/model/run-context.cjs +9 -3
- package/dist/record/model/run-context.cjs.map +1 -1
- package/dist/record/model/run-context.d.cts +9 -2
- package/dist/record/model/run-context.d.mts +9 -2
- package/dist/record/model/run-context.d.ts +9 -2
- package/dist/record/model/run-context.js +8 -6
- 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/run/cli/contribution.cjs +6 -32
- package/dist/run/cli/contribution.cjs.map +1 -1
- package/dist/run/host/runtime.cjs +1 -1
- package/dist/run/host/runtime.cjs.map +1 -1
- package/dist/run/storage/sqlite.cjs +7 -7
- package/dist/run/storage/sqlite.cjs.map +1 -1
- package/dist/runner/adapter-usage.cjs +5 -3
- package/dist/runner/adapter-usage.cjs.map +1 -1
- package/dist/runner/adapter-usage.d.cts +2 -2
- package/dist/runner/adapter-usage.d.mts +2 -2
- package/dist/runner/adapter-usage.d.ts +2 -2
- package/dist/runner/adoption.cjs +9 -12
- package/dist/runner/adoption.cjs.map +1 -1
- package/dist/runner/attempt-notes.cjs +8 -0
- package/dist/runner/attempt-notes.cjs.map +1 -0
- package/dist/runner/attempt-notes.d.cts +4 -0
- package/dist/runner/attempt-notes.d.mts +4 -0
- package/dist/runner/attempt-notes.d.ts +4 -0
- package/dist/runner/attempt-notes.js +8 -0
- package/dist/runner/attempt-notes.js.map +1 -0
- package/dist/runner/attempt.cjs +61 -73
- package/dist/runner/attempt.cjs.map +1 -1
- package/dist/runner/attempt.d.cts +3 -3
- package/dist/runner/attempt.d.mts +3 -3
- package/dist/runner/attempt.d.ts +3 -3
- package/dist/runner/command-plan.cjs +21 -26
- package/dist/runner/command-plan.cjs.map +1 -1
- package/dist/runner/command-plan.d.cts +4 -4
- package/dist/runner/command-plan.d.mts +4 -4
- package/dist/runner/command-plan.d.ts +4 -4
- package/dist/runner/command-plan.js +4 -4
- package/dist/runner/config-identity.cjs.map +1 -1
- package/dist/runner/config-identity.d.cts +2 -2
- package/dist/runner/config-identity.d.mts +2 -2
- package/dist/runner/config-identity.d.ts +2 -2
- package/dist/runner/discover.cjs +6 -6
- package/dist/runner/discover.cjs.map +1 -1
- package/dist/runner/eval-selection.cjs +2 -2
- package/dist/runner/eval-selection.cjs.map +1 -1
- package/dist/runner/eval-selection.d.cts +2 -2
- package/dist/runner/eval-selection.d.mts +2 -2
- package/dist/runner/eval-selection.d.ts +2 -2
- package/dist/runner/feedback/human.cjs +1 -1
- package/dist/runner/feedback/human.cjs.map +1 -1
- package/dist/runner/feedback/json.cjs +4 -2
- package/dist/runner/feedback/json.cjs.map +1 -1
- package/dist/runner/feedback/json.d.cts +1 -1
- package/dist/runner/feedback/json.d.mts +1 -1
- package/dist/runner/feedback/json.d.ts +1 -1
- package/dist/runner/feedback/sink.cjs +1 -1
- package/dist/runner/feedback/sink.cjs.map +1 -1
- package/dist/runner/feedback/sink.d.cts +1 -1
- package/dist/runner/feedback/sink.d.mts +1 -1
- package/dist/runner/feedback/sink.d.ts +1 -1
- package/dist/runner/fingerprint.cjs +1 -1
- package/dist/runner/fingerprint.cjs.map +1 -1
- package/dist/runner/project-target.cjs.map +1 -1
- package/dist/runner/project-target.d.cts +2 -2
- package/dist/runner/project-target.d.mts +2 -2
- package/dist/runner/project-target.d.ts +2 -2
- package/dist/runner/record/attachments.cjs +2 -2
- package/dist/runner/record/attachments.cjs.map +1 -1
- package/dist/runner/record/planning.cjs +8 -2
- package/dist/runner/record/planning.cjs.map +1 -1
- package/dist/runner/record.cjs +2 -0
- package/dist/runner/record.cjs.map +1 -1
- package/dist/runner/report.cjs +3 -3
- package/dist/runner/report.cjs.map +1 -1
- package/dist/runner/report.d.cts +1 -1
- package/dist/runner/report.d.mts +1 -1
- package/dist/runner/report.d.ts +1 -1
- package/dist/runner/reuse-plan.cjs +2 -2
- package/dist/runner/reuse-plan.cjs.map +1 -1
- package/dist/runner/run.cjs +10 -45
- package/dist/runner/run.cjs.map +1 -1
- package/dist/runner/sandbox-pool.cjs +1 -2
- package/dist/runner/sandbox-pool.cjs.map +1 -1
- package/dist/runner/setup-prefix-preparation.cjs +1 -1
- package/dist/runner/setup-prefix-preparation.cjs.map +1 -1
- package/dist/runner/teardown-registry.cjs +2 -2
- package/dist/runner/teardown-registry.cjs.map +1 -1
- package/dist/runner/teardown-registry.d.cts +1 -1
- package/dist/runner/teardown-registry.d.mts +1 -1
- package/dist/runner/teardown-registry.d.ts +1 -1
- package/dist/runner/types.cjs +4 -4
- package/dist/runner/types.cjs.map +1 -1
- package/dist/runner/types.d.cts +64 -93
- package/dist/runner/types.d.mts +64 -93
- package/dist/runner/types.d.ts +64 -93
- package/dist/runner/types.js +2 -2
- package/dist/sandbox/action.cjs +1 -1
- package/dist/sandbox/action.cjs.map +1 -1
- package/dist/sandbox/cli/contribution.cjs +17 -14
- package/dist/sandbox/cli/contribution.cjs.map +1 -1
- package/dist/sandbox/cli/contribution.d.cts +1 -1
- package/dist/sandbox/cli/contribution.d.mts +1 -1
- package/dist/sandbox/cli/contribution.d.ts +1 -1
- package/dist/sandbox/commands.cjs +1 -1
- package/dist/sandbox/commands.cjs.map +1 -1
- package/dist/sandbox/commands.d.cts +1 -1
- package/dist/sandbox/commands.d.mts +1 -1
- package/dist/sandbox/commands.d.ts +1 -1
- package/dist/sandbox/compose.cjs +2 -2
- package/dist/sandbox/compose.cjs.map +1 -1
- package/dist/sandbox/docker-profile/registry.cjs +5 -9
- package/dist/sandbox/docker-profile/registry.cjs.map +1 -1
- package/dist/sandbox/docker-profile/registry.d.cts +0 -3
- package/dist/sandbox/docker-profile/registry.d.mts +0 -3
- package/dist/sandbox/docker-profile/registry.d.ts +0 -3
- package/dist/sandbox/docker-profile/registry.js +6 -12
- package/dist/sandbox/docker-profile/runtime.cjs +1 -1
- package/dist/sandbox/docker-profile/runtime.cjs.map +1 -1
- package/dist/sandbox/docker-profile/schema.cjs +12 -16
- package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
- package/dist/sandbox/docker-profile/schema.d.cts +2 -6
- package/dist/sandbox/docker-profile/schema.d.mts +2 -6
- package/dist/sandbox/docker-profile/schema.d.ts +2 -6
- package/dist/sandbox/docker-profile/schema.js +24 -32
- package/dist/sandbox/incus.cjs +2 -2
- package/dist/sandbox/incus.cjs.map +1 -1
- package/dist/sandbox/index.cjs +4 -35
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.d.cts +4 -8
- package/dist/sandbox/index.d.mts +4 -8
- package/dist/sandbox/index.d.ts +4 -8
- package/dist/sandbox/index.js +116 -172
- package/dist/sandbox/index.mjs +116 -172
- package/dist/sandbox/layer.cjs +3 -3
- package/dist/sandbox/layer.cjs.map +1 -1
- package/dist/sandbox/link.cjs +5 -0
- package/dist/sandbox/link.cjs.map +1 -1
- package/dist/sandbox/link.d.cts +3 -0
- package/dist/sandbox/link.d.mts +3 -0
- package/dist/sandbox/link.d.ts +3 -0
- package/dist/sandbox/runtime.cjs +9 -4
- package/dist/sandbox/runtime.cjs.map +1 -1
- package/dist/shared/failure-class.cjs +5 -5
- package/dist/shared/failure-class.cjs.map +1 -1
- package/dist/shared/failure-class.d.cts +4 -10
- package/dist/shared/failure-class.d.mts +4 -10
- package/dist/shared/failure-class.d.ts +4 -10
- package/dist/shared/types.cjs.map +1 -1
- package/dist/shared/types.d.cts +1 -1
- package/dist/shared/types.d.mts +1 -1
- package/dist/shared/types.d.ts +1 -1
- package/dist/show/contribution.cjs +17 -2
- package/dist/show/contribution.cjs.map +1 -1
- package/dist/show/contribution.d.cts +14 -0
- package/dist/show/contribution.d.mts +14 -0
- package/dist/show/contribution.d.ts +14 -0
- package/dist/show/model.cjs +8 -5
- package/dist/show/model.cjs.map +1 -1
- package/dist/show/model.d.cts +11 -8
- package/dist/show/model.d.mts +11 -8
- package/dist/show/model.d.ts +11 -8
- package/dist/show/render.cjs +34 -22
- package/dist/show/render.cjs.map +1 -1
- package/dist/sources/projector.cjs +1 -1
- package/dist/sources/projector.cjs.map +1 -1
- package/dist/types.cjs +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/types.js +2 -2
- package/dist/view/app-dist/.vite/manifest.json +2 -2
- package/dist/view/app-dist/assets/{index-B3ijZRph.js → index-CxrOUvHC.js} +17 -17
- package/dist/view/app-dist/assets/{quality-cost-scatter-B--DfJ9s.js → quality-cost-scatter-B6Aiss7x.js} +1 -1
- package/dist/view/app-dist/index.html +1 -1
- package/dist/view/cli/contribution.cjs +1 -1
- package/dist/view/cli/contribution.cjs.map +1 -1
- package/dist/view/function-runtime.mjs +318 -121
- package/dist/view/http-protocol.d.cts +1 -1
- package/dist/view/http-protocol.d.mts +1 -1
- package/dist/view/http-protocol.d.ts +1 -1
- package/dist/view/inspection-host.cjs +2 -2
- package/dist/view/inspection-host.cjs.map +1 -1
- package/dist/view/inspection-host.d.cts +349 -331
- package/dist/view/inspection-host.d.mts +349 -331
- package/dist/view/inspection-host.d.ts +349 -331
- package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +6 -6
- package/docs-site/zh/examples/integrations/claude-sdk.mdx +5 -5
- package/docs-site/zh/examples/integrations/codex-sdk.mdx +4 -4
- package/docs-site/zh/examples/integrations/langgraph.mdx +4 -4
- package/docs-site/zh/examples/integrations/pi-sdk.mdx +5 -5
- package/docs-site/zh/explanation/adapter.mdx +6 -6
- package/docs-site/zh/explanation/assert.mdx +7 -7
- package/docs-site/zh/explanation/drive.mdx +4 -4
- package/docs-site/zh/explanation/hitl.mdx +2 -2
- package/docs-site/zh/explanation/judge.mdx +2 -2
- package/docs-site/zh/introduction.mdx +2 -2
- package/docs-site/zh/reference/builtin-agents.mdx +46 -49
- package/docs-site/zh/reference/cli.mdx +16 -14
- package/docs-site/zh/reference/define-agent.mdx +19 -19
- package/docs-site/zh/reference/define-config.mdx +7 -15
- package/docs-site/zh/reference/define-eval.mdx +20 -14
- package/docs-site/zh/reference/define-experiment.mdx +18 -39
- package/docs-site/zh/reference/events.mdx +1 -1
- package/docs-site/zh/reference/expect.mdx +21 -0
- package/docs-site/zh/reference/official-adapters.mdx +12 -5
- package/docs-site/zh/troubleshooting/debugging.mdx +2 -2
- package/docs-site/zh/troubleshooting/recover-after-kill.mdx +1 -1
- package/docs-site/zh/tutorials/agent-onboarding.mdx +2 -2
- package/docs-site/zh/tutorials/authoring.mdx +2 -2
- package/docs-site/zh/tutorials/compare-runs.mdx +1 -1
- package/docs-site/zh/tutorials/concurrency.mdx +8 -8
- package/docs-site/zh/tutorials/configuration.mdx +5 -5
- package/docs-site/zh/tutorials/control-run-cost.mdx +19 -19
- package/docs-site/zh/tutorials/eval-groups.mdx +1 -1
- package/docs-site/zh/tutorials/evaluation-kinds.mdx +5 -5
- package/docs-site/zh/tutorials/experiment-services.mdx +32 -32
- package/docs-site/zh/tutorials/handle-execution-failures.mdx +2 -28
- package/docs-site/zh/tutorials/plugins.mdx +49 -143
- package/docs-site/zh/tutorials/sandbox-agent.mdx +1 -1
- package/docs-site/zh/tutorials/sandbox-reuse.mdx +7 -7
- package/docs-site/zh/tutorials/upgrade-0-18.mdx +1 -1
- package/docs-site/zh/tutorials/upgrade-0-19.mdx +121 -0
- package/docs-site/zh/tutorials/upgrade-0-20.mdx +12 -0
- package/docs-site/zh/tutorials/verify-judge.mdx +2 -2
- package/docs-site/zh/tutorials/viewing-results.mdx +2 -2
- package/docs-site/zh/tutorials/write-experiment.mdx +1 -1
- package/docs-site/zh/tutorials/write-send.mdx +13 -13
- package/package.json +1 -1
- package/dist/agents/effect-runtime.cjs.map +0 -1
- package/dist/agents/effect-runtime.d.cts +0 -29
- package/dist/agents/effect-runtime.d.mts +0 -29
- package/dist/agents/effect-runtime.d.ts +0 -29
- package/dist/agents/effect-runtime.js +0 -16
- package/dist/agents/effect-runtime.js.map +0 -1
- package/dist/agents/session-slot.cjs.map +0 -1
- package/dist/agents/session-slot.d.cts +0 -12
- package/dist/agents/session-slot.d.mts +0 -12
- package/dist/agents/session-slot.d.ts +0 -12
- package/dist/agents/session-slot.js +0 -6
- package/dist/agents/session-slot.js.map +0 -1
- package/dist/model-slots.js +0 -14
- package/dist/model-slots.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["api.ts"],"names":[],"mappings":";;;AAmYA;;;;GAIG;AACU,QAAA,oBAAoB,GAAkB,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAsBvF;;;;;GAKG;AACH,MAAa,6BAA8B,SAAQ,KAAK;IAE/B;IADZ,IAAI,GAAG,+BAA+B,CAAC;IAChD,YAAqB,MAA4G;QAC7H,KAAK,CAAC,kDAAkD,MAAM,EAAE,CAAC,CAAC;QADjD,WAAM,GAAN,MAAM,CAAsG;QAE7H,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC;IAChD,CAAC;CACJ;AAND,sEAMC","sourcesContent":["// @concord-file ne-eval-assertions-api\n// @concord-implements docs/feature/assertions/README.md\n// @concord-implements docs/feature/assertions/library.md\n// @concord-implements docs/feature/assertions/library/value-assertions.md\n// @concord-implements docs/feature/assertions/library/scoped-assertions.md\nimport type { Effect } from \"effect\";\nimport type { BooleanMatch, CollectionMatch, ManagedToolCalls, MatchDiagnostic, NumericComparator, NumericMaterial, NumericComparisonMatch, ScoreMatch, EventMatch, ManagedEventOccurrences, ToolMatch, } from \"./match.ts\";\nimport type { AgentWorkspaceDiff } from \"./workspace-diff.ts\";\nimport type { EvaluationKind } from \"../shared/evaluation.ts\";\nimport type { JudgeImage } from \"../judge/image.ts\";\n/** The two Evaluation kinds deliberately share one Assertion entry model. */\nexport type AssertionEvaluationKind = EvaluationKind;\n/**\n * A bounded JSON-shaped value owned by the authoring runtime. It is a\n * domain value, not the durable Assertions attachment material type.\n */\nexport type AssertionSnapshotValue = null | boolean | number | string | readonly AssertionSnapshotValue[] | AssertionSnapshotObject;\nexport interface AssertionSnapshotObject {\n readonly [key: string]: AssertionSnapshotValue;\n}\nexport interface AssertionDisplay {\n readonly key?: string;\n readonly label?: string;\n readonly groupPath: readonly string[];\n}\nexport type AssertionCoverage = {\n readonly state: \"complete\";\n} | {\n readonly state: \"partial\";\n readonly reason: \"sampled\" | \"truncated\" | \"redacted\" | \"provider-limited\" | \"capacity-limited\";\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"not-collected\" | \"source-unavailable\" | \"producer-failed\";\n} | {\n readonly state: \"not-applicable\";\n readonly reason: \"optional-material\" | \"unsupported-subject\";\n};\nexport type AssertionLimitation = {\n readonly kind: \"redacted\";\n readonly fieldCount: number;\n} | {\n readonly kind: \"sampled\";\n readonly captured: number;\n readonly knownTotal?: number;\n} | {\n readonly kind: \"truncated\";\n readonly omittedBytes: number;\n} | {\n readonly kind: \"provider-limited\";\n} | {\n readonly kind: \"capacity-limited\";\n readonly capturedItems: number;\n readonly knownTotalItems: number;\n readonly omittedBytes: number | null;\n};\n/**\n * Authoring material intentionally has no blob ref, attachment entry ID, or\n * durable schema identity. The private producer adapter selects the exact\n * same-owner Attachment schema when it serializes this domain reference.\n */\nexport type AssertionMaterial = {\n readonly kind: \"snapshot\";\n readonly value: AssertionSnapshotValue;\n} | {\n readonly kind: \"judge-image\";\n readonly image: JudgeImage;\n} | {\n readonly kind: \"record-attachment\";\n readonly preview: string;\n};\nexport type AssertionCriterion = {\n readonly kind: \"value-match\";\n readonly subject: \"explicit-value\";\n readonly matcher: {\n readonly state: \"declared\";\n readonly name: string;\n } | {\n readonly state: \"unavailable\";\n };\n} | {\n /** Package-private runtime variant encoded as numeric-comparison/v1. */\n readonly kind: \"value-match\";\n readonly numeric: {\n readonly comparator: NumericComparator;\n readonly threshold: number;\n readonly subject: {\n readonly kind: \"explicit-value\";\n } | {\n readonly kind: \"scope-metric\";\n readonly metric: \"tokens\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly unit: \"tokens\";\n } | {\n readonly kind: \"scope-metric\";\n readonly metric: \"cost\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly unit: \"usd\";\n } | {\n readonly kind: \"collection-cardinality\";\n readonly collection: \"tool-calls\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n };\n };\n} | {\n readonly kind: \"scope-status\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly assertion: \"succeeded\" | \"no-failed-actions\";\n} | {\n readonly kind: \"occurrence\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly occurrence: \"tool\" | \"skill\" | \"event\";\n readonly assertion: \"present\" | \"absent\" | \"count\" | \"order\";\n readonly matcher?: string;\n readonly quantifier?: {\n readonly kind: \"absent\";\n } | {\n readonly kind: \"at-least\" | \"less-than\" | \"at-most\" | \"greater-than\" | \"exact\";\n readonly count: number;\n };\n} | {\n readonly kind: \"judge-measurement\";\n readonly name: string;\n readonly scale: \"unit-interval\";\n} | {\n readonly kind: \"managed-score-measurement\";\n readonly name: string;\n readonly scale: \"unit-interval\";\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"changed-paths\";\n readonly paths: readonly string[];\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"no-changes\";\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"file-changed\";\n readonly path: string;\n readonly status?: \"added\" | \"modified\" | \"deleted\";\n readonly before?: string;\n readonly after?: string;\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"file-deleted\";\n readonly path: string;\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"not-in-diff\";\n readonly pattern: string;\n readonly flags: string;\n readonly content: \"added\" | \"removed\" | \"both\";\n} | {\n readonly kind: \"direct-score\";\n readonly source: \"author\";\n} | {\n readonly kind: \"third-party\";\n readonly name: string;\n readonly schemaId: string;\n readonly data: AssertionSnapshotValue;\n};\nexport type AssertionScoreContribution = {\n readonly state: \"not-scored\";\n} | {\n readonly state: \"earned\";\n readonly points: number;\n readonly earned: number;\n} | {\n readonly state: \"unavailable\";\n readonly points: number;\n readonly reason: \"source-unavailable\" | \"evaluation-errored\" | \"not-applicable\";\n};\n/** Constant-size semantic receipt for one collection evaluation. */\nexport interface AssertionCollectionReceipt {\n readonly examined: number;\n readonly matched: number;\n readonly mismatched: number;\n readonly unavailable: number;\n readonly knownTotal: number | null;\n readonly complete: boolean;\n readonly exhaustive: boolean;\n readonly decisive: boolean;\n}\nexport type MatcherRelationStatus = {\n readonly state: \"exact\";\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"historical-not-recorded\" | \"source-unavailable\" | \"ambiguous\";\n};\nexport type MatcherSourceLocator = {\n readonly kind: \"tool-occurrence\";\n readonly toolOccurrenceId: string;\n readonly relation: MatcherRelationStatus;\n} | {\n readonly kind: \"event\";\n readonly eventId: string;\n readonly toolOccurrenceId?: string;\n readonly relation: MatcherRelationStatus;\n};\nexport interface MatcherRetainedRow {\n readonly locator: MatcherSourceLocator;\n readonly result: \"matched\" | \"mismatched\" | \"unavailable\" | \"not-evaluated\";\n readonly difference?: AssertionSnapshotValue;\n}\nexport interface MatcherQueryStep {\n readonly step: number;\n readonly summary: AssertionSnapshotValue;\n}\nexport type MatcherSourceSnapshot = {\n readonly scope: \"turn\";\n readonly sessionId: string;\n readonly turnId: string;\n readonly scopeId: string;\n readonly throughSessionSequence: number;\n readonly source: {\n readonly family: \"niceeval.agent-turns\";\n readonly schemaVersion: number;\n };\n readonly collectionAtCut: \"complete\" | \"partial\" | \"unavailable\";\n} | {\n readonly scope: \"session\";\n readonly sessionId: string;\n readonly scopeId: string;\n readonly throughSessionSequence: number;\n readonly source: {\n readonly family: \"niceeval.agent-turns\";\n readonly schemaVersion: number;\n };\n readonly collectionAtCut: \"complete\" | \"partial\" | \"unavailable\";\n} | {\n readonly scope: \"attempt\";\n readonly scopeId: string;\n readonly sessions: readonly {\n readonly sessionId: string;\n readonly throughSessionSequence: number;\n }[];\n readonly source: {\n readonly family: \"niceeval.agent-turns\";\n readonly schemaVersion: number;\n };\n readonly collectionAtCut: \"complete\" | \"partial\" | \"unavailable\";\n};\nexport interface OrderStepReceipt {\n readonly step: number;\n readonly comparisons: number;\n readonly matched: number;\n readonly mismatched: number;\n readonly unavailable: number;\n}\nexport interface OrderEvaluationReceipt {\n readonly sourceRows: number;\n readonly comparisons: number;\n readonly unavailableComparisons: number;\n readonly definitePrefixLength: number;\n readonly possiblePrefixLength: number;\n readonly stepReceipts: readonly OrderStepReceipt[];\n readonly complete: boolean;\n readonly exhaustive: boolean;\n readonly decisive: boolean;\n}\nexport interface MatcherOrderPathNode {\n readonly step: number;\n readonly locator: MatcherSourceLocator;\n readonly sessionId: string;\n readonly sessionSequence: number;\n readonly result: \"matched\" | \"unavailable\";\n}\nexport interface MatcherFailureFrontier {\n readonly longestDefinitePrefix: readonly MatcherOrderPathNode[];\n readonly longestPossiblePrefix: readonly MatcherOrderPathNode[];\n readonly firstBlockingStep: number;\n readonly suffixChecked: AssertionCollectionReceipt;\n readonly representatives: readonly MatcherRetainedRow[];\n}\nexport type MatcherQueryArtifact = {\n readonly kind: \"collection-filter\";\n readonly sourceSnapshot: MatcherSourceSnapshot;\n readonly query: MatcherQueryStep;\n readonly receipt: AssertionCollectionReceipt;\n readonly retainedRows: readonly MatcherRetainedRow[];\n} | {\n readonly kind: \"ordered-sequence\";\n readonly sourceSnapshot: Extract<MatcherSourceSnapshot, {\n readonly scope: \"turn\" | \"session\";\n }>;\n readonly querySteps: readonly MatcherQueryStep[];\n readonly receipt: OrderEvaluationReceipt;\n readonly result: {\n readonly state: \"matched\";\n readonly witnessPath: readonly MatcherOrderPathNode[];\n } | {\n readonly state: \"mismatched\";\n readonly failureFrontier: MatcherFailureFrontier;\n } | {\n readonly state: \"unavailable\";\n readonly reason: string;\n };\n readonly retainedRows: readonly MatcherRetainedRow[];\n};\nexport type AssertionConditionPolicy = {\n readonly kind: \"boolean\";\n readonly expected: true;\n} | {\n readonly kind: \"at-least\";\n readonly threshold: number;\n} | {\n readonly kind: \"record-only\";\n};\nexport interface AssertionPolicy {\n readonly requirement: \"required\" | \"optional\";\n readonly condition: AssertionConditionPolicy;\n}\nexport type AssertionObserved = {\n readonly kind: \"boolean\";\n readonly outcome: \"matched\" | \"mismatched\" | \"unavailable\" | \"errored\" | \"not-applicable\";\n} | {\n readonly kind: \"measurement\";\n readonly state: \"available\";\n readonly value: number;\n} | {\n readonly kind: \"measurement\";\n readonly state: \"unavailable\";\n} | {\n readonly kind: \"direct-score\";\n readonly state: \"available\";\n readonly value: number;\n} | {\n readonly kind: \"direct-score\";\n readonly state: \"unavailable\";\n};\nexport type AssertionResult = {\n readonly state: \"matched\";\n readonly gate: \"not-gate\" | \"satisfied\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"earned\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"mismatched\";\n readonly reason: \"condition-not-met\";\n readonly gate: \"not-gate\" | \"failed\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"earned\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly gate: \"not-gate\" | \"unavailable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"errored\";\n readonly reason: \"evaluator-failed\" | \"producer-interrupted\" | \"invalid-subject\";\n readonly gate: \"not-gate\" | \"unavailable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"not-applicable\";\n readonly reason: \"coverage-not-applicable\";\n readonly gate: \"not-gate\" | \"not-applicable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n};\n/** One fully formed author/runtime result, before durable attachment encoding. */\nexport interface SealedAssertionEntry {\n readonly display: AssertionDisplay;\n readonly criterion: AssertionCriterion;\n readonly subject: AssertionMaterial;\n readonly evidence: readonly AssertionMaterial[];\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n readonly result: AssertionResult;\n readonly policy: AssertionPolicy;\n readonly observed: AssertionObserved;\n readonly matcherArtifact?: MatcherQueryArtifact;\n}\n/**\n * Assertion handles are runtime-owned capabilities, not subjects for another\n * `t.check`. The symbol is public only for TypeScript's nominal boundary; the\n * runtime also keeps an unforgeable ownership registry.\n */\nexport const assertionHandleBrand: unique symbol = Symbol(\"niceeval.assertion-handle\");\ndeclare const assertionConditionStateBrand: unique symbol;\ndeclare const assertionGateStateBrand: unique symbol;\ndeclare const assertionScoreStateBrand: unique symbol;\nexport interface AssertionHandleBase<HasCondition extends boolean = boolean, HasScore extends boolean = boolean> {\n readonly [assertionHandleBrand]: true;\n readonly [assertionConditionStateBrand]: HasCondition;\n readonly [assertionScoreStateBrand]: HasScore;\n key(value: string): this;\n label(value: string): this;\n /** Adds one display-only group segment to this already registered entry. */\n group(title: string): this;\n}\n/** A value that is not an AssertionHandle. */\nexport type AssertionSubject<Value> = Value extends AssertionHandleBase ? never : Value;\n/** Numeric cardinality deliberately excludes the managed event occurrence subject. */\nexport type NumericAssertionSubject<Value> = Value extends ManagedEventOccurrences ? never : AssertionSubject<Value>;\nexport interface AssertionStopError {\n readonly _tag: \"AssertionStopError\";\n readonly entryIndex: number;\n readonly reason: \"condition-not-met\" | \"source-unavailable\" | \"evaluator-failed\" | \"not-applicable\";\n}\n/**\n * A public authoring call reached an Attempt boundary which is no longer able\n * to accept it. Keeping this distinct from an evaluator failure lets a\n * detached Promise diagnose its own lifecycle error instead of looking like a\n * failed assertion.\n */\nexport class AssertionAuthoringClosedError extends Error {\n readonly _tag = \"AssertionAuthoringClosedError\";\n constructor(readonly reason: \"stop-latched\" | \"attempt-sealing\" | \"attempt-sealed\" | \"attempt-interrupted\" | \"runtime-unattached\") {\n super(`Cannot use an Assertion authoring handle after ${reason}`);\n this.name = \"AssertionAuthoringClosedError\";\n }\n}\n/**\n * The owning Attempt executes a requested stop barrier in its existing Effect\n * scope. Handles only enqueue this request; they never create a runtime.\n */\nexport type AssertionStopExecutor = <Value>(effect: Effect.Effect<Value, AssertionStopError, never>) => Promise<Value>;\n/** A Boolean entry is evaluated once and may retain a refinement witness. */\nexport type BooleanAssertionEvaluation<Refined> = {\n readonly state: \"matched\";\n readonly value: Refined;\n readonly diagnostic?: MatchDiagnostic;\n readonly receipt?: AssertionCollectionReceipt;\n readonly matcherArtifact?: MatcherQueryArtifact;\n} | {\n readonly state: \"mismatched\";\n readonly diagnostic?: MatchDiagnostic;\n readonly receipt?: AssertionCollectionReceipt;\n readonly matcherArtifact?: MatcherQueryArtifact;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly diagnostic?: MatchDiagnostic;\n readonly receipt?: AssertionCollectionReceipt;\n readonly matcherArtifact?: MatcherQueryArtifact;\n} | {\n readonly state: \"not-applicable\";\n readonly diagnostic?: MatchDiagnostic;\n readonly matcherArtifact?: MatcherQueryArtifact;\n};\n/** A measurement is always a finite unit-interval value when it is available. */\nexport type MeasurementAssertionEvaluation = {\n readonly receipt?: AssertionCollectionReceipt;\n} & ({\n readonly state: \"measured\";\n readonly value: number;\n readonly detail?: AssertionSnapshotObject;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly detail?: AssertionSnapshotObject;\n} | {\n readonly state: \"not-applicable\";\n readonly detail?: AssertionSnapshotObject;\n} | {\n readonly state: \"errored\";\n readonly detail?: AssertionSnapshotObject;\n});\nexport interface CapturedAssertionSnapshot {\n readonly material: Extract<AssertionMaterial, {\n readonly kind: \"snapshot\";\n }>;\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n}\nexport interface AssertionRegistrationBase {\n /** @internal Seal the criterion for the actual local or managed evaluation path. */\n readonly terminalCriterion?: () => AssertionCriterion;\n readonly retainedBytes?: number;\n readonly terminalReceipt?: () => AssertionCollectionReceipt;\n readonly criterion: AssertionCriterion;\n readonly subject: AssertionMaterial;\n readonly evidence?: readonly AssertionMaterial[];\n readonly coverage?: AssertionCoverage;\n readonly limitations?: readonly AssertionLimitation[];\n}\n/**\n * Scope, Judge, and Sandbox adapters use this internal registration shape.\n * They still register exactly one Assertion entry; they do not manufacture a\n * separate intermediate value for a later consumer.\n */\nexport interface BooleanAssertionRegistration<Refined> extends AssertionRegistrationBase {\n /** Sealed when Attempt interruption prevents the ordinary evaluator from running. */\n readonly interruptedMatcherArtifact?: MatcherQueryArtifact;\n readonly evaluate: () => Effect.Effect<BooleanAssertionEvaluation<Refined>, unknown, never>;\n}\nexport interface MeasurementAssertionRegistration extends AssertionRegistrationBase {\n /** Bytes synchronously reserved from an Attempt-local producer budget. */\n readonly retainedBytes?: number;\n readonly retainedImageBytes?: number;\n /** Complete terminal Content appended exactly once by the shared sealing path. */\n readonly terminalEvidence?: () => readonly AssertionMaterial[];\n /** Terminal producer facts frozen by the shared Assertion sealing path. */\n readonly terminalDetail?: () => AssertionSnapshotObject;\n readonly evaluate: () => Effect.Effect<MeasurementAssertionEvaluation, unknown, never>;\n}\nexport interface PassBooleanAssertionHandle<out Refined, HasGate extends boolean = false> extends AssertionHandleBase<true, false> {\n readonly kind: \"boolean\";\n readonly [assertionGateStateBrand]: HasGate;\n /** An unavailable/errored optional entry does not independently error Verdict. */\n optional(): this;\n gate(this: PassBooleanAssertionHandle<Refined, false>): PassBooleanAssertionHandle<Refined, true>;\n orStop(): Promise<Refined>;\n}\nexport interface ScoreBooleanAssertionHandle<out Refined, HasGate extends boolean = false, HasScore extends boolean = false> extends AssertionHandleBase<true, HasScore> {\n readonly kind: \"boolean\";\n readonly [assertionGateStateBrand]: HasGate;\n gate(this: ScoreBooleanAssertionHandle<Refined, false, HasScore>): ScoreBooleanAssertionHandle<Refined, true, HasScore>;\n score(this: ScoreBooleanAssertionHandle<Refined, HasGate, false>, points: number): ScoreBooleanAssertionHandle<Refined, HasGate, true>;\n orStop(): Promise<Refined>;\n}\nexport interface PassMeasurementAssertionHandle<HasCondition extends boolean = false> extends AssertionHandleBase<HasCondition, false> {\n readonly kind: \"measurement\";\n gate(this: PassMeasurementAssertionHandle<false>, minimum: number): PassMeasurementAssertionHandle<true>;\n orStop(this: PassMeasurementAssertionHandle<false>, minimum: number): Promise<number>;\n orStop(this: PassMeasurementAssertionHandle<true>): Promise<number>;\n}\nexport interface ScoreMeasurementAssertionHandle<HasCondition extends boolean = false, HasScore extends boolean = false> extends AssertionHandleBase<HasCondition, HasScore> {\n readonly kind: \"measurement\";\n gate(this: ScoreMeasurementAssertionHandle<false, HasScore>, minimum: number): ScoreMeasurementAssertionHandle<true, HasScore>;\n score(this: ScoreMeasurementAssertionHandle<HasCondition, false>, points: number): ScoreMeasurementAssertionHandle<HasCondition, true>;\n orStop(this: ScoreMeasurementAssertionHandle<false, HasScore>, minimum: number): Promise<number>;\n orStop(this: ScoreMeasurementAssertionHandle<true, HasScore>): Promise<number>;\n}\n/** A Boolean Assertion that intentionally has no author control-flow operation. */\ninterface PostRunPassBooleanAssertionHandle<Refined, HasGate extends boolean = false> extends AssertionHandleBase<true, false> {\n readonly kind: \"boolean\";\n readonly [assertionGateStateBrand]: HasGate;\n optional(): this;\n gate(this: PostRunPassBooleanAssertionHandle<Refined, false>): PostRunPassBooleanAssertionHandle<Refined, true>;\n}\ninterface PostRunScoreBooleanAssertionHandle<Refined, HasGate extends boolean = false, HasScore extends boolean = false> extends AssertionHandleBase<true, HasScore> {\n readonly kind: \"boolean\";\n readonly [assertionGateStateBrand]: HasGate;\n gate(this: PostRunScoreBooleanAssertionHandle<Refined, false, HasScore>): PostRunScoreBooleanAssertionHandle<Refined, true, HasScore>;\n score(this: PostRunScoreBooleanAssertionHandle<Refined, HasGate, false>, points: number): PostRunScoreBooleanAssertionHandle<Refined, HasGate, true>;\n}\nexport type PostRunBooleanAssertionHandle<Kind extends AssertionEvaluationKind, Refined, HasGate extends boolean = false, HasScore extends boolean = false> = Kind extends \"pass\" ? PostRunPassBooleanAssertionHandle<Refined, HasGate> : PostRunScoreBooleanAssertionHandle<Refined, HasGate, HasScore>;\n/** Direct score is an Assertion entry, but has no condition or stop barrier. */\nexport interface DirectScoreAssertionHandle extends AssertionHandleBase<false, true> {\n readonly kind: \"direct-score\";\n}\n/**\n * Definition-time handle shared by Adapter Assertion factories. It exposes\n * only operations whose meaning is identical in Pass and Score Evals; the\n * bound Eval factory replaces it with the native handle for its Kind.\n */\nexport interface PolymorphicBooleanAssertionHandle<out Refined, HasGate extends boolean = false> extends AssertionHandleBase<true, false> {\n readonly kind: \"boolean\";\n readonly [assertionGateStateBrand]: HasGate;\n gate(this: PolymorphicBooleanAssertionHandle<Refined, false>): PolymorphicBooleanAssertionHandle<Refined, true>;\n orStop(): Promise<Refined>;\n}\n/** Definition-time measurement counterpart to PolymorphicBooleanAssertionHandle. */\nexport interface PolymorphicMeasurementAssertionHandle<HasCondition extends boolean = false> extends AssertionHandleBase<HasCondition, false> {\n readonly kind: \"measurement\";\n gate(this: PolymorphicMeasurementAssertionHandle<false>, minimum: number): PolymorphicMeasurementAssertionHandle<true>;\n orStop(this: PolymorphicMeasurementAssertionHandle<false>, minimum: number): Promise<number>;\n orStop(this: PolymorphicMeasurementAssertionHandle<true>): Promise<number>;\n}\nexport type AssertionCheckKind = AssertionEvaluationKind | \"polymorphic\";\ntype CheckedBooleanHandle<Kind extends AssertionCheckKind, Refined> = Kind extends AssertionEvaluationKind ? BooleanAssertionHandle<Kind, Refined> : PolymorphicBooleanAssertionHandle<Refined>;\ntype CheckedMeasurementHandle<Kind extends AssertionCheckKind> = Kind extends AssertionEvaluationKind ? MeasurementAssertionHandle<Kind> : PolymorphicMeasurementAssertionHandle;\n/** Single owner for the public check overload set, including Adapter-polymorphic factories. */\nexport interface AssertionCheck<Kind extends AssertionCheckKind, Context = unknown> {\n <T>(match: import(\"./context-match.ts\").MaterialMatch<Context, T>): CheckedBooleanHandle<Kind, void>;\n <T>(match: import(\"./context-match.ts\").ContextBooleanMatch<Context, T>): CheckedBooleanHandle<Kind, void>;\n <T>(match: import(\"./context-match.ts\").ContextScoreMatch<Context, T>): CheckedMeasurementHandle<Kind>;\n (value: import(\"./match.ts\").NumericMaterial, match: NumericComparisonMatch): CheckedBooleanHandle<Kind, number>;\n <Value, Refined extends Value>(value: AssertionSubject<Value>, match: BooleanMatch<NoInfer<Value>, Refined, \"value\">): CheckedBooleanHandle<Kind, Refined>;\n <Value extends readonly unknown[]>(value: NumericAssertionSubject<Value>, match: NumericComparisonMatch): CheckedBooleanHandle<Kind, Value>;\n <S extends \"turn\" | \"session\" | \"attempt\">(value: AssertionSubject<ManagedToolCalls<S>>, match: ToolMatch): CheckedBooleanHandle<Kind, ManagedToolCalls<S>>;\n <S extends \"turn\" | \"session\" | \"attempt\">(value: AssertionSubject<ManagedEventOccurrences<S>>, match: EventMatch): CheckedBooleanHandle<Kind, ManagedEventOccurrences<S>>;\n <Value>(value: AssertionSubject<Value>, match: CollectionMatch<NoInfer<Value>>): CheckedBooleanHandle<Kind, Value>;\n <Value>(value: AssertionSubject<Value>, match: ScoreMatch<NoInfer<Value>>): CheckedMeasurementHandle<Kind>;\n}\nexport interface AssertionGroupContext {\n /**\n * Runs an ordinary author callback with one display-only group segment. The\n * callback remains inside the Attempt's outer Promise boundary; this facade\n * does not evaluate an Effect or create an independent runtime.\n */\n group<Value>(title: string, body: () => Value | PromiseLike<Value>): Promise<Awaited<Value>>;\n}\nexport interface PassAssertionsContext extends AssertionGroupContext {\n readonly evaluationKind: \"pass\";\n readonly check: AssertionCheck<\"pass\">;\n}\n/** Adds direct points, or a unit-interval measurement with an explicit fixed weight. */\nexport interface ScoreFunction {\n (points: number): DirectScoreAssertionHandle;\n (ratio: number | NumericMaterial, options: {\n readonly weight: number;\n }): ScoreMeasurementAssertionHandle<false, true>;\n}\nexport interface ScoreAssertionsContext extends AssertionGroupContext {\n readonly evaluationKind: \"score\";\n readonly check: AssertionCheck<\"score\">;\n readonly score: ScoreFunction;\n}\nexport type AssertionsContext<Kind extends AssertionEvaluationKind> = Kind extends \"pass\" ? PassAssertionsContext : ScoreAssertionsContext;\nexport type BooleanAssertionHandle<Kind extends AssertionEvaluationKind, Refined, HasGate extends boolean = false, HasScore extends boolean = false> = Kind extends \"pass\" ? PassBooleanAssertionHandle<Refined, HasGate> : ScoreBooleanAssertionHandle<Refined, HasGate, HasScore>;\nexport type MeasurementAssertionHandle<Kind extends AssertionEvaluationKind, HasCondition extends boolean = false, HasScore extends boolean = false> = Kind extends \"pass\" ? PassMeasurementAssertionHandle<HasCondition> : ScoreMeasurementAssertionHandle<HasCondition, HasScore>;\nexport interface AssertionSealOptions {\n readonly execution?: \"completed\" | \"errored\";\n readonly explicitlySkipped?: boolean;\n /**\n * The owning Attempt was interrupted before ordinary evaluation could\n * finish. Unsettled entries are sealed as producer-interrupted instead of\n * being silently omitted or evaluated on a detached runtime.\n */\n readonly interrupted?: boolean;\n}\n/** Sealing has no expected authoring failure after registration-time validation. */\nexport type AssertionSealError = never;\n/** The sealed evaluation is a domain result, not a durable Record payload. */\nexport interface SealedAssertionEvaluationEntry {\n readonly required: boolean;\n readonly result: AssertionResult;\n}\nexport interface SealedAssertionEvaluation {\n readonly execution: \"completed\" | \"errored\";\n readonly explicitlySkipped: boolean;\n readonly assertions: readonly SealedAssertionEvaluationEntry[];\n}\n/**\n * One immutable result feeds the Verdict/Score fold and the private durable\n * producer adapter. No RecordAttachment writer type crosses this boundary.\n */\nexport interface SealedAssertionsRuntime {\n readonly entries: readonly SealedAssertionEntry[];\n readonly evaluation: SealedAssertionEvaluation;\n}\n/** The runtime Verdict is independent of the durable Verdict attachment codec. */\nexport interface AssertionVerdict {\n readonly state: import(\"../shared/types.ts\").Verdict;\n}\nexport type AssertionScoreIncompleteReason = \"execution-errored\" | \"source-unavailable\" | \"evaluation-errored\" | \"not-applicable\";\n/** The runtime Score is independent of the durable Score attachment codec. */\nexport type AssertionScore = {\n readonly state: \"complete\";\n readonly earned: number;\n} | {\n readonly state: \"partial\";\n readonly earned: number;\n readonly reasons: readonly AssertionScoreIncompleteReason[];\n} | {\n readonly state: \"unavailable\";\n readonly reasons: readonly AssertionScoreIncompleteReason[];\n};\n/**\n * The attempt-owned frozen result is handed from Runner to the Evaluation\n * Record adapter. The adapter alone adds attachment schemas and writes.\n */\nexport interface SealedAttemptAssertions {\n readonly entries: readonly SealedAssertionEntry[];\n readonly evaluation: SealedAssertionEvaluation;\n readonly workspaceDiff?: AgentWorkspaceDiff;\n readonly verdict: AssertionVerdict;\n readonly score?: AssertionScore;\n}\nexport interface AssertionsRuntime<Kind extends AssertionEvaluationKind> {\n readonly evaluationKind: Kind;\n readonly t: AssertionsContext<Kind>;\n /** @internal Reject before an adapter reads or snapshots author material. */\n assertAuthoringOpen(): void;\n /** Attempt-owned synchronous admission close; sealing still happens once through `seal`. */\n closeAuthoring(reason: \"attempt-sealing\" | \"attempt-interrupted\"): void;\n registerBoolean<Refined>(definition: BooleanAssertionRegistration<Refined>): BooleanAssertionHandle<Kind, Refined>;\n registerMeasurement(definition: MeasurementAssertionRegistration): MeasurementAssertionHandle<Kind>;\n seal(options?: AssertionSealOptions): Effect.Effect<SealedAssertionsRuntime, AssertionSealError, never>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["api.ts"],"names":[],"mappings":";;;AAqYA;;;;GAIG;AACU,QAAA,oBAAoB,GAAkB,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAsBvF;;;;;GAKG;AACH,MAAa,6BAA8B,SAAQ,KAAK;IAE/B;IADZ,IAAI,GAAG,+BAA+B,CAAC;IAChD,YAAqB,MAA4G;QAC7H,KAAK,CAAC,kDAAkD,MAAM,EAAE,CAAC,CAAC;QADjD,WAAM,GAAN,MAAM,CAAsG;QAE7H,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC;IAChD,CAAC;CACJ;AAND,sEAMC","sourcesContent":["// @concord-file\n// @concord-implements docs/feature/assertions/README.md\n// @concord-implements docs/feature/assertions/library.md\n// @concord-implements docs/feature/assertions/library/value-assertions.md\n// @concord-implements docs/feature/assertions/library/scoped-assertions.md\nimport type { Effect } from \"effect\";\nimport type { BooleanMatch, CollectionMatch, ManagedToolCalls, MatchDiagnostic, NumericComparator, NumericMaterial, NumericComparisonMatch, ScoreMatch, EventMatch, ManagedEventOccurrences, ToolMatch, } from \"./match.ts\";\nimport type { AgentWorkspaceDiff } from \"./workspace-diff.ts\";\nimport type { EvaluationKind } from \"../shared/evaluation.ts\";\nimport type { JudgeImage } from \"../judge/image.ts\";\n/** The two Evaluation kinds deliberately share one Assertion entry model. */\nexport type AssertionEvaluationKind = EvaluationKind;\n/**\n * A bounded JSON-shaped value owned by the authoring runtime. It is a\n * domain value, not the durable Assertions attachment material type.\n */\nexport type AssertionSnapshotValue = null | boolean | number | string | readonly AssertionSnapshotValue[] | AssertionSnapshotObject;\nexport interface AssertionSnapshotObject {\n readonly [key: string]: AssertionSnapshotValue;\n}\nexport interface AssertionDisplay {\n readonly key?: string;\n readonly label?: string;\n readonly groupPath: readonly string[];\n}\nexport type AssertionCoverage = {\n readonly state: \"complete\";\n} | {\n readonly state: \"partial\";\n readonly reason: \"sampled\" | \"truncated\" | \"redacted\" | \"provider-limited\" | \"capacity-limited\";\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"not-collected\" | \"source-unavailable\" | \"producer-failed\";\n} | {\n readonly state: \"not-applicable\";\n readonly reason: \"optional-material\" | \"unsupported-subject\";\n};\nexport type AssertionLimitation = {\n readonly kind: \"redacted\";\n readonly fieldCount: number;\n} | {\n readonly kind: \"sampled\";\n readonly captured: number;\n readonly knownTotal?: number;\n} | {\n readonly kind: \"truncated\";\n readonly omittedBytes: number;\n} | {\n readonly kind: \"provider-limited\";\n} | {\n readonly kind: \"capacity-limited\";\n readonly capturedItems: number;\n readonly knownTotalItems: number;\n readonly omittedBytes: number | null;\n};\n/**\n * Authoring material intentionally has no blob ref, attachment entry ID, or\n * durable schema identity. The private producer adapter selects the exact\n * same-owner Attachment schema when it serializes this domain reference.\n */\nexport type AssertionMaterial = {\n readonly kind: \"snapshot\";\n readonly value: AssertionSnapshotValue;\n} | {\n readonly kind: \"judge-image\";\n readonly image: JudgeImage;\n} | {\n readonly kind: \"record-attachment\";\n readonly preview: string;\n};\nexport type AssertionCriterion = {\n readonly kind: \"value-match\";\n readonly subject: \"explicit-value\";\n readonly matcher: {\n readonly state: \"declared\";\n readonly name: string;\n } | {\n readonly state: \"unavailable\";\n };\n} | {\n /** Package-private runtime variant encoded as numeric-comparison/v1. */\n readonly kind: \"value-match\";\n readonly numeric: {\n readonly comparator: NumericComparator;\n readonly threshold: number;\n readonly upperThreshold?: number;\n readonly unit?: import(\"./quantity.ts\").Unit;\n readonly subject: {\n readonly kind: \"explicit-value\";\n } | {\n readonly kind: \"scope-metric\";\n readonly metric: \"tokens\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly unit: \"tokens\";\n } | {\n readonly kind: \"scope-metric\";\n readonly metric: \"cost\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly unit: \"usd\";\n } | {\n readonly kind: \"collection-cardinality\";\n readonly collection: \"tool-calls\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n };\n };\n} | {\n readonly kind: \"scope-status\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly assertion: \"succeeded\" | \"no-failed-actions\";\n} | {\n readonly kind: \"occurrence\";\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly occurrence: \"tool\" | \"skill\" | \"event\";\n readonly assertion: \"present\" | \"absent\" | \"count\" | \"order\";\n readonly matcher?: string;\n readonly quantifier?: {\n readonly kind: \"absent\";\n } | {\n readonly kind: \"at-least\" | \"less-than\" | \"at-most\" | \"greater-than\" | \"exact\";\n readonly count: number;\n };\n} | {\n readonly kind: \"judge-measurement\";\n readonly name: string;\n readonly scale: \"unit-interval\";\n} | {\n readonly kind: \"managed-score-measurement\";\n readonly name: string;\n readonly scale: \"unit-interval\";\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"changed-paths\";\n readonly paths: readonly string[];\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"no-changes\";\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"file-changed\";\n readonly path: string;\n readonly status?: \"added\" | \"modified\" | \"deleted\";\n readonly before?: string;\n readonly after?: string;\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"file-deleted\";\n readonly path: string;\n} | {\n readonly kind: \"sandbox-result\";\n readonly operation: \"not-in-diff\";\n readonly pattern: string;\n readonly flags: string;\n readonly content: \"added\" | \"removed\" | \"both\";\n} | {\n readonly kind: \"direct-score\";\n readonly source: \"author\";\n} | {\n readonly kind: \"third-party\";\n readonly name: string;\n readonly schemaId: string;\n readonly data: AssertionSnapshotValue;\n};\nexport type AssertionScoreContribution = {\n readonly state: \"not-scored\";\n} | {\n readonly state: \"earned\";\n readonly points: number;\n readonly earned: number;\n} | {\n readonly state: \"unavailable\";\n readonly points: number;\n readonly reason: \"source-unavailable\" | \"evaluation-errored\" | \"not-applicable\";\n};\n/** Constant-size semantic receipt for one collection evaluation. */\nexport interface AssertionCollectionReceipt {\n readonly examined: number;\n readonly matched: number;\n readonly mismatched: number;\n readonly unavailable: number;\n readonly knownTotal: number | null;\n readonly complete: boolean;\n readonly exhaustive: boolean;\n readonly decisive: boolean;\n}\nexport type MatcherRelationStatus = {\n readonly state: \"exact\";\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"historical-not-recorded\" | \"source-unavailable\" | \"ambiguous\";\n};\nexport type MatcherSourceLocator = {\n readonly kind: \"tool-occurrence\";\n readonly toolOccurrenceId: string;\n readonly relation: MatcherRelationStatus;\n} | {\n readonly kind: \"event\";\n readonly eventId: string;\n readonly toolOccurrenceId?: string;\n readonly relation: MatcherRelationStatus;\n};\nexport interface MatcherRetainedRow {\n readonly locator: MatcherSourceLocator;\n readonly result: \"matched\" | \"mismatched\" | \"unavailable\" | \"not-evaluated\";\n readonly difference?: AssertionSnapshotValue;\n}\nexport interface MatcherQueryStep {\n readonly step: number;\n readonly summary: AssertionSnapshotValue;\n}\nexport type MatcherSourceSnapshot = {\n readonly scope: \"turn\";\n readonly sessionId: string;\n readonly turnId: string;\n readonly scopeId: string;\n readonly throughSessionSequence: number;\n readonly source: {\n readonly family: \"niceeval.agent-turns\";\n readonly schemaVersion: number;\n };\n readonly collectionAtCut: \"complete\" | \"partial\" | \"unavailable\";\n} | {\n readonly scope: \"session\";\n readonly sessionId: string;\n readonly scopeId: string;\n readonly throughSessionSequence: number;\n readonly source: {\n readonly family: \"niceeval.agent-turns\";\n readonly schemaVersion: number;\n };\n readonly collectionAtCut: \"complete\" | \"partial\" | \"unavailable\";\n} | {\n readonly scope: \"attempt\";\n readonly scopeId: string;\n readonly sessions: readonly {\n readonly sessionId: string;\n readonly throughSessionSequence: number;\n }[];\n readonly source: {\n readonly family: \"niceeval.agent-turns\";\n readonly schemaVersion: number;\n };\n readonly collectionAtCut: \"complete\" | \"partial\" | \"unavailable\";\n};\nexport interface OrderStepReceipt {\n readonly step: number;\n readonly comparisons: number;\n readonly matched: number;\n readonly mismatched: number;\n readonly unavailable: number;\n}\nexport interface OrderEvaluationReceipt {\n readonly sourceRows: number;\n readonly comparisons: number;\n readonly unavailableComparisons: number;\n readonly definitePrefixLength: number;\n readonly possiblePrefixLength: number;\n readonly stepReceipts: readonly OrderStepReceipt[];\n readonly complete: boolean;\n readonly exhaustive: boolean;\n readonly decisive: boolean;\n}\nexport interface MatcherOrderPathNode {\n readonly step: number;\n readonly locator: MatcherSourceLocator;\n readonly sessionId: string;\n readonly sessionSequence: number;\n readonly result: \"matched\" | \"unavailable\";\n}\nexport interface MatcherFailureFrontier {\n readonly longestDefinitePrefix: readonly MatcherOrderPathNode[];\n readonly longestPossiblePrefix: readonly MatcherOrderPathNode[];\n readonly firstBlockingStep: number;\n readonly suffixChecked: AssertionCollectionReceipt;\n readonly representatives: readonly MatcherRetainedRow[];\n}\nexport type MatcherQueryArtifact = {\n readonly kind: \"collection-filter\";\n readonly sourceSnapshot: MatcherSourceSnapshot;\n readonly query: MatcherQueryStep;\n readonly receipt: AssertionCollectionReceipt;\n readonly retainedRows: readonly MatcherRetainedRow[];\n} | {\n readonly kind: \"ordered-sequence\";\n readonly sourceSnapshot: Extract<MatcherSourceSnapshot, {\n readonly scope: \"turn\" | \"session\";\n }>;\n readonly querySteps: readonly MatcherQueryStep[];\n readonly receipt: OrderEvaluationReceipt;\n readonly result: {\n readonly state: \"matched\";\n readonly witnessPath: readonly MatcherOrderPathNode[];\n } | {\n readonly state: \"mismatched\";\n readonly failureFrontier: MatcherFailureFrontier;\n } | {\n readonly state: \"unavailable\";\n readonly reason: string;\n };\n readonly retainedRows: readonly MatcherRetainedRow[];\n};\nexport type AssertionConditionPolicy = {\n readonly kind: \"boolean\";\n readonly expected: true;\n} | {\n readonly kind: \"at-least\";\n readonly threshold: number;\n} | {\n readonly kind: \"record-only\";\n};\nexport interface AssertionPolicy {\n readonly requirement: \"required\" | \"optional\";\n readonly condition: AssertionConditionPolicy;\n}\nexport type AssertionObserved = {\n readonly kind: \"boolean\";\n readonly outcome: \"matched\" | \"mismatched\" | \"unavailable\" | \"errored\" | \"not-applicable\";\n} | {\n readonly kind: \"measurement\";\n readonly state: \"available\";\n readonly value: number;\n} | {\n readonly kind: \"measurement\";\n readonly state: \"unavailable\";\n} | {\n readonly kind: \"direct-score\";\n readonly state: \"available\";\n readonly value: number;\n} | {\n readonly kind: \"direct-score\";\n readonly state: \"unavailable\";\n};\nexport type AssertionResult = {\n readonly state: \"matched\";\n readonly gate: \"not-gate\" | \"satisfied\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"earned\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"mismatched\";\n readonly reason: \"condition-not-met\";\n readonly gate: \"not-gate\" | \"failed\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"earned\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly gate: \"not-gate\" | \"unavailable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"errored\";\n readonly reason: \"evaluator-failed\" | \"producer-interrupted\" | \"invalid-subject\";\n readonly gate: \"not-gate\" | \"unavailable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n} | {\n readonly state: \"not-applicable\";\n readonly reason: \"coverage-not-applicable\";\n readonly gate: \"not-gate\" | \"not-applicable\";\n readonly score: Extract<AssertionScoreContribution, {\n readonly state: \"not-scored\" | \"unavailable\";\n }>;\n readonly diagnostic?: AssertionSnapshotObject;\n readonly receipt?: AssertionCollectionReceipt;\n};\n/** One fully formed author/runtime result, before durable attachment encoding. */\nexport interface SealedAssertionEntry {\n readonly display: AssertionDisplay;\n readonly criterion: AssertionCriterion;\n readonly subject: AssertionMaterial;\n readonly evidence: readonly AssertionMaterial[];\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n readonly result: AssertionResult;\n readonly policy: AssertionPolicy;\n readonly observed: AssertionObserved;\n readonly matcherArtifact?: MatcherQueryArtifact;\n}\n/**\n * Assertion handles are runtime-owned capabilities, not subjects for another\n * `t.check`. The symbol is public only for TypeScript's nominal boundary; the\n * runtime also keeps an unforgeable ownership registry.\n */\nexport const assertionHandleBrand: unique symbol = Symbol(\"niceeval.assertion-handle\");\ndeclare const assertionConditionStateBrand: unique symbol;\ndeclare const assertionGateStateBrand: unique symbol;\ndeclare const assertionScoreStateBrand: unique symbol;\nexport interface AssertionHandleBase<HasCondition extends boolean = boolean, HasScore extends boolean = boolean> {\n readonly [assertionHandleBrand]: true;\n readonly [assertionConditionStateBrand]: HasCondition;\n readonly [assertionScoreStateBrand]: HasScore;\n key(value: string): this;\n label(value: string): this;\n /** Adds one display-only group segment to this already registered entry. */\n group(title: string): this;\n}\n/** A value that is not an AssertionHandle. */\nexport type AssertionSubject<Value> = Value extends AssertionHandleBase ? never : Value;\n/** Numeric cardinality deliberately excludes the managed event occurrence subject. */\nexport type NumericAssertionSubject<Value> = Value extends ManagedEventOccurrences ? never : AssertionSubject<Value>;\nexport interface AssertionStopError {\n readonly _tag: \"AssertionStopError\";\n readonly entryIndex: number;\n readonly reason: \"condition-not-met\" | \"source-unavailable\" | \"evaluator-failed\" | \"not-applicable\";\n}\n/**\n * A public authoring call reached an Attempt boundary which is no longer able\n * to accept it. Keeping this distinct from an evaluator failure lets a\n * detached Promise diagnose its own lifecycle error instead of looking like a\n * failed assertion.\n */\nexport class AssertionAuthoringClosedError extends Error {\n readonly _tag = \"AssertionAuthoringClosedError\";\n constructor(readonly reason: \"stop-latched\" | \"attempt-sealing\" | \"attempt-sealed\" | \"attempt-interrupted\" | \"runtime-unattached\") {\n super(`Cannot use an Assertion authoring handle after ${reason}`);\n this.name = \"AssertionAuthoringClosedError\";\n }\n}\n/**\n * The owning Attempt executes a requested stop barrier in its existing Effect\n * scope. Handles only enqueue this request; they never create a runtime.\n */\nexport type AssertionStopExecutor = <Value>(effect: Effect.Effect<Value, AssertionStopError, never>) => Promise<Value>;\n/** A Boolean entry is evaluated once and may retain a refinement witness. */\nexport type BooleanAssertionEvaluation<Refined> = {\n readonly state: \"matched\";\n readonly value: Refined;\n readonly diagnostic?: MatchDiagnostic;\n readonly receipt?: AssertionCollectionReceipt;\n readonly matcherArtifact?: MatcherQueryArtifact;\n} | {\n readonly state: \"mismatched\";\n readonly diagnostic?: MatchDiagnostic;\n readonly receipt?: AssertionCollectionReceipt;\n readonly matcherArtifact?: MatcherQueryArtifact;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly diagnostic?: MatchDiagnostic;\n readonly receipt?: AssertionCollectionReceipt;\n readonly matcherArtifact?: MatcherQueryArtifact;\n} | {\n readonly state: \"not-applicable\";\n readonly diagnostic?: MatchDiagnostic;\n readonly matcherArtifact?: MatcherQueryArtifact;\n};\n/** A measurement is always a finite unit-interval value when it is available. */\nexport type MeasurementAssertionEvaluation = {\n readonly receipt?: AssertionCollectionReceipt;\n} & ({\n readonly state: \"measured\";\n readonly value: number;\n readonly detail?: AssertionSnapshotObject;\n} | {\n readonly state: \"unavailable\";\n readonly reason: \"evidence-unavailable\" | \"source-unavailable\" | \"redacted\";\n readonly detail?: AssertionSnapshotObject;\n} | {\n readonly state: \"not-applicable\";\n readonly detail?: AssertionSnapshotObject;\n} | {\n readonly state: \"errored\";\n readonly detail?: AssertionSnapshotObject;\n});\nexport interface CapturedAssertionSnapshot {\n readonly material: Extract<AssertionMaterial, {\n readonly kind: \"snapshot\";\n }>;\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n}\nexport interface AssertionRegistrationBase {\n /** @internal Seal the criterion for the actual local or managed evaluation path. */\n readonly terminalCriterion?: () => AssertionCriterion;\n readonly retainedBytes?: number;\n readonly terminalReceipt?: () => AssertionCollectionReceipt;\n readonly criterion: AssertionCriterion;\n readonly subject: AssertionMaterial;\n readonly evidence?: readonly AssertionMaterial[];\n readonly coverage?: AssertionCoverage;\n readonly limitations?: readonly AssertionLimitation[];\n}\n/**\n * Scope, Judge, and Sandbox adapters use this internal registration shape.\n * They still register exactly one Assertion entry; they do not manufacture a\n * separate intermediate value for a later consumer.\n */\nexport interface BooleanAssertionRegistration<Refined> extends AssertionRegistrationBase {\n /** Sealed when Attempt interruption prevents the ordinary evaluator from running. */\n readonly interruptedMatcherArtifact?: MatcherQueryArtifact;\n readonly evaluate: () => Effect.Effect<BooleanAssertionEvaluation<Refined>, unknown, never>;\n}\nexport interface MeasurementAssertionRegistration extends AssertionRegistrationBase {\n /** Bytes synchronously reserved from an Attempt-local producer budget. */\n readonly retainedBytes?: number;\n readonly retainedImageBytes?: number;\n /** Complete terminal Content appended exactly once by the shared sealing path. */\n readonly terminalEvidence?: () => readonly AssertionMaterial[];\n /** Terminal producer facts frozen by the shared Assertion sealing path. */\n readonly terminalDetail?: () => AssertionSnapshotObject;\n readonly evaluate: () => Effect.Effect<MeasurementAssertionEvaluation, unknown, never>;\n}\nexport interface PassBooleanAssertionHandle<out Refined, HasGate extends boolean = false> extends AssertionHandleBase<true, false> {\n readonly kind: \"boolean\";\n readonly [assertionGateStateBrand]: HasGate;\n /** An unavailable/errored optional entry does not independently error Verdict. */\n optional(): this;\n gate(this: PassBooleanAssertionHandle<Refined, false>): PassBooleanAssertionHandle<Refined, true>;\n orStop(): Promise<Refined>;\n}\nexport interface ScoreBooleanAssertionHandle<out Refined, HasGate extends boolean = false, HasScore extends boolean = false> extends AssertionHandleBase<true, HasScore> {\n readonly kind: \"boolean\";\n readonly [assertionGateStateBrand]: HasGate;\n gate(this: ScoreBooleanAssertionHandle<Refined, false, HasScore>): ScoreBooleanAssertionHandle<Refined, true, HasScore>;\n score(this: ScoreBooleanAssertionHandle<Refined, HasGate, false>, points: number): ScoreBooleanAssertionHandle<Refined, HasGate, true>;\n orStop(): Promise<Refined>;\n}\nexport interface PassMeasurementAssertionHandle<HasCondition extends boolean = false> extends AssertionHandleBase<HasCondition, false> {\n readonly kind: \"measurement\";\n gate(this: PassMeasurementAssertionHandle<false>, minimum: number): PassMeasurementAssertionHandle<true>;\n orStop(this: PassMeasurementAssertionHandle<false>, minimum: number): Promise<number>;\n orStop(this: PassMeasurementAssertionHandle<true>): Promise<number>;\n}\nexport interface ScoreMeasurementAssertionHandle<HasCondition extends boolean = false, HasScore extends boolean = false> extends AssertionHandleBase<HasCondition, HasScore> {\n readonly kind: \"measurement\";\n gate(this: ScoreMeasurementAssertionHandle<false, HasScore>, minimum: number): ScoreMeasurementAssertionHandle<true, HasScore>;\n score(this: ScoreMeasurementAssertionHandle<HasCondition, false>, points: number): ScoreMeasurementAssertionHandle<HasCondition, true>;\n orStop(this: ScoreMeasurementAssertionHandle<false, HasScore>, minimum: number): Promise<number>;\n orStop(this: ScoreMeasurementAssertionHandle<true, HasScore>): Promise<number>;\n}\n/** A Boolean Assertion that intentionally has no author control-flow operation. */\ninterface PostRunPassBooleanAssertionHandle<Refined, HasGate extends boolean = false> extends AssertionHandleBase<true, false> {\n readonly kind: \"boolean\";\n readonly [assertionGateStateBrand]: HasGate;\n optional(): this;\n gate(this: PostRunPassBooleanAssertionHandle<Refined, false>): PostRunPassBooleanAssertionHandle<Refined, true>;\n}\ninterface PostRunScoreBooleanAssertionHandle<Refined, HasGate extends boolean = false, HasScore extends boolean = false> extends AssertionHandleBase<true, HasScore> {\n readonly kind: \"boolean\";\n readonly [assertionGateStateBrand]: HasGate;\n gate(this: PostRunScoreBooleanAssertionHandle<Refined, false, HasScore>): PostRunScoreBooleanAssertionHandle<Refined, true, HasScore>;\n score(this: PostRunScoreBooleanAssertionHandle<Refined, HasGate, false>, points: number): PostRunScoreBooleanAssertionHandle<Refined, HasGate, true>;\n}\nexport type PostRunBooleanAssertionHandle<Kind extends AssertionEvaluationKind, Refined, HasGate extends boolean = false, HasScore extends boolean = false> = Kind extends \"pass\" ? PostRunPassBooleanAssertionHandle<Refined, HasGate> : PostRunScoreBooleanAssertionHandle<Refined, HasGate, HasScore>;\n/** Direct score is an Assertion entry, but has no condition or stop barrier. */\nexport interface DirectScoreAssertionHandle extends AssertionHandleBase<false, true> {\n readonly kind: \"direct-score\";\n}\n/**\n * Definition-time handle shared by Adapter Assertion factories. It exposes\n * only operations whose meaning is identical in Pass and Score Evals; the\n * bound Eval factory replaces it with the native handle for its Kind.\n */\nexport interface PolymorphicBooleanAssertionHandle<out Refined, HasGate extends boolean = false> extends AssertionHandleBase<true, false> {\n readonly kind: \"boolean\";\n readonly [assertionGateStateBrand]: HasGate;\n gate(this: PolymorphicBooleanAssertionHandle<Refined, false>): PolymorphicBooleanAssertionHandle<Refined, true>;\n orStop(): Promise<Refined>;\n}\n/** Definition-time measurement counterpart to PolymorphicBooleanAssertionHandle. */\nexport interface PolymorphicMeasurementAssertionHandle<HasCondition extends boolean = false> extends AssertionHandleBase<HasCondition, false> {\n readonly kind: \"measurement\";\n gate(this: PolymorphicMeasurementAssertionHandle<false>, minimum: number): PolymorphicMeasurementAssertionHandle<true>;\n orStop(this: PolymorphicMeasurementAssertionHandle<false>, minimum: number): Promise<number>;\n orStop(this: PolymorphicMeasurementAssertionHandle<true>): Promise<number>;\n}\nexport type AssertionCheckKind = AssertionEvaluationKind | \"polymorphic\";\ntype CheckedBooleanHandle<Kind extends AssertionCheckKind, Refined> = Kind extends AssertionEvaluationKind ? BooleanAssertionHandle<Kind, Refined> : PolymorphicBooleanAssertionHandle<Refined>;\ntype CheckedMeasurementHandle<Kind extends AssertionCheckKind> = Kind extends AssertionEvaluationKind ? MeasurementAssertionHandle<Kind> : PolymorphicMeasurementAssertionHandle;\n/** Single owner for the public check overload set, including Adapter-polymorphic factories. */\nexport interface AssertionCheck<Kind extends AssertionCheckKind, Context = unknown> {\n <T>(match: import(\"./context-match.ts\").MaterialMatch<Context, T>): CheckedBooleanHandle<Kind, void>;\n <T>(match: import(\"./context-match.ts\").ContextBooleanMatch<Context, T>): CheckedBooleanHandle<Kind, void>;\n <T>(match: import(\"./context-match.ts\").ContextScoreMatch<Context, T>): CheckedMeasurementHandle<Kind>;\n (value: import(\"./match.ts\").NumericMaterial, match: NumericComparisonMatch): CheckedBooleanHandle<Kind, number>;\n <Value, Refined extends Value>(value: AssertionSubject<Value>, match: BooleanMatch<NoInfer<Value>, Refined, \"value\">): CheckedBooleanHandle<Kind, Refined>;\n <Value extends readonly unknown[]>(value: NumericAssertionSubject<Value>, match: NumericComparisonMatch): CheckedBooleanHandle<Kind, Value>;\n <S extends \"turn\" | \"session\" | \"attempt\">(value: AssertionSubject<ManagedToolCalls<S>>, match: ToolMatch): CheckedBooleanHandle<Kind, ManagedToolCalls<S>>;\n <S extends \"turn\" | \"session\" | \"attempt\">(value: AssertionSubject<ManagedEventOccurrences<S>>, match: EventMatch): CheckedBooleanHandle<Kind, ManagedEventOccurrences<S>>;\n <Value>(value: AssertionSubject<Value>, match: CollectionMatch<NoInfer<Value>>): CheckedBooleanHandle<Kind, Value>;\n <Value>(value: AssertionSubject<Value>, match: ScoreMatch<NoInfer<Value>>): CheckedMeasurementHandle<Kind>;\n <U extends import(\"./quantity.ts\").Unit>(value: import(\"./match.ts\").NumericMaterial<U>, match: NumericComparisonMatch<NoInfer<U>>): CheckedBooleanHandle<Kind, number>;\n}\nexport interface AssertionGroupContext {\n /**\n * Runs an ordinary author callback with one display-only group segment. The\n * callback remains inside the Attempt's outer Promise boundary; this facade\n * does not evaluate an Effect or create an independent runtime.\n */\n group<Value>(title: string, body: () => Value | PromiseLike<Value>): Promise<Awaited<Value>>;\n}\nexport interface PassAssertionsContext extends AssertionGroupContext {\n readonly evaluationKind: \"pass\";\n readonly check: AssertionCheck<\"pass\">;\n}\n/** Adds direct points, or a unit-interval measurement with an explicit fixed weight. */\nexport interface ScoreFunction {\n (points: number): DirectScoreAssertionHandle;\n (ratio: number | NumericMaterial, options: {\n readonly weight: number;\n }): ScoreMeasurementAssertionHandle<false, true>;\n}\nexport interface ScoreAssertionsContext extends AssertionGroupContext {\n readonly evaluationKind: \"score\";\n readonly check: AssertionCheck<\"score\">;\n readonly score: ScoreFunction;\n}\nexport type AssertionsContext<Kind extends AssertionEvaluationKind> = Kind extends \"pass\" ? PassAssertionsContext : ScoreAssertionsContext;\nexport type BooleanAssertionHandle<Kind extends AssertionEvaluationKind, Refined, HasGate extends boolean = false, HasScore extends boolean = false> = Kind extends \"pass\" ? PassBooleanAssertionHandle<Refined, HasGate> : ScoreBooleanAssertionHandle<Refined, HasGate, HasScore>;\nexport type MeasurementAssertionHandle<Kind extends AssertionEvaluationKind, HasCondition extends boolean = false, HasScore extends boolean = false> = Kind extends \"pass\" ? PassMeasurementAssertionHandle<HasCondition> : ScoreMeasurementAssertionHandle<HasCondition, HasScore>;\nexport interface AssertionSealOptions {\n readonly execution?: \"completed\" | \"errored\";\n readonly explicitlySkipped?: boolean;\n /**\n * The owning Attempt was interrupted before ordinary evaluation could\n * finish. Unsettled entries are sealed as producer-interrupted instead of\n * being silently omitted or evaluated on a detached runtime.\n */\n readonly interrupted?: boolean;\n}\n/** Sealing has no expected authoring failure after registration-time validation. */\nexport type AssertionSealError = never;\n/** The sealed evaluation is a domain result, not a durable Record payload. */\nexport interface SealedAssertionEvaluationEntry {\n readonly required: boolean;\n readonly result: AssertionResult;\n}\nexport interface SealedAssertionEvaluation {\n readonly execution: \"completed\" | \"errored\";\n readonly explicitlySkipped: boolean;\n readonly assertions: readonly SealedAssertionEvaluationEntry[];\n}\n/**\n * One immutable result feeds the Verdict/Score fold and the private durable\n * producer adapter. No RecordAttachment writer type crosses this boundary.\n */\nexport interface SealedAssertionsRuntime {\n readonly entries: readonly SealedAssertionEntry[];\n readonly evaluation: SealedAssertionEvaluation;\n}\n/** The runtime Verdict is independent of the durable Verdict attachment codec. */\nexport interface AssertionVerdict {\n readonly state: import(\"../shared/types.ts\").Verdict;\n}\nexport type AssertionScoreIncompleteReason = \"execution-errored\" | \"source-unavailable\" | \"evaluation-errored\" | \"not-applicable\";\n/** The runtime Score is independent of the durable Score attachment codec. */\nexport type AssertionScore = {\n readonly state: \"complete\";\n readonly earned: number;\n} | {\n readonly state: \"partial\";\n readonly earned: number;\n readonly reasons: readonly AssertionScoreIncompleteReason[];\n} | {\n readonly state: \"unavailable\";\n readonly reasons: readonly AssertionScoreIncompleteReason[];\n};\n/**\n * The attempt-owned frozen result is handed from Runner to the Evaluation\n * Record adapter. The adapter alone adds attachment schemas and writes.\n */\nexport interface SealedAttemptAssertions {\n readonly entries: readonly SealedAssertionEntry[];\n readonly evaluation: SealedAssertionEvaluation;\n readonly workspaceDiff?: AgentWorkspaceDiff;\n readonly verdict: AssertionVerdict;\n readonly score?: AssertionScore;\n}\nexport interface AssertionsRuntime<Kind extends AssertionEvaluationKind> {\n readonly evaluationKind: Kind;\n readonly t: AssertionsContext<Kind>;\n /** @internal Reject before an adapter reads or snapshots author material. */\n assertAuthoringOpen(): void;\n /** Attempt-owned synchronous admission close; sealing still happens once through `seal`. */\n closeAuthoring(reason: \"attempt-sealing\" | \"attempt-interrupted\"): void;\n registerBoolean<Refined>(definition: BooleanAssertionRegistration<Refined>): BooleanAssertionHandle<Kind, Refined>;\n registerMeasurement(definition: MeasurementAssertionRegistration): MeasurementAssertionHandle<Kind>;\n seal(options?: AssertionSealOptions): Effect.Effect<SealedAssertionsRuntime, AssertionSealError, never>;\n}\n"]}
|
|
@@ -78,6 +78,8 @@ export type AssertionCriterion = {
|
|
|
78
78
|
readonly numeric: {
|
|
79
79
|
readonly comparator: NumericComparator;
|
|
80
80
|
readonly threshold: number;
|
|
81
|
+
readonly upperThreshold?: number;
|
|
82
|
+
readonly unit?: import("./quantity.cjs").Unit;
|
|
81
83
|
readonly subject: {
|
|
82
84
|
readonly kind: "explicit-value";
|
|
83
85
|
} | {
|
|
@@ -581,6 +583,7 @@ export interface AssertionCheck<Kind extends AssertionCheckKind, Context = unkno
|
|
|
581
583
|
<S extends "turn" | "session" | "attempt">(value: AssertionSubject<ManagedEventOccurrences<S>>, match: EventMatch): CheckedBooleanHandle<Kind, ManagedEventOccurrences<S>>;
|
|
582
584
|
<Value>(value: AssertionSubject<Value>, match: CollectionMatch<NoInfer<Value>>): CheckedBooleanHandle<Kind, Value>;
|
|
583
585
|
<Value>(value: AssertionSubject<Value>, match: ScoreMatch<NoInfer<Value>>): CheckedMeasurementHandle<Kind>;
|
|
586
|
+
<U extends import("./quantity.cjs").Unit>(value: import("./match.cjs").NumericMaterial<U>, match: NumericComparisonMatch<NoInfer<U>>): CheckedBooleanHandle<Kind, number>;
|
|
584
587
|
}
|
|
585
588
|
export interface AssertionGroupContext {
|
|
586
589
|
/**
|
|
@@ -78,6 +78,8 @@ export type AssertionCriterion = {
|
|
|
78
78
|
readonly numeric: {
|
|
79
79
|
readonly comparator: NumericComparator;
|
|
80
80
|
readonly threshold: number;
|
|
81
|
+
readonly upperThreshold?: number;
|
|
82
|
+
readonly unit?: import("./quantity.mjs").Unit;
|
|
81
83
|
readonly subject: {
|
|
82
84
|
readonly kind: "explicit-value";
|
|
83
85
|
} | {
|
|
@@ -581,6 +583,7 @@ export interface AssertionCheck<Kind extends AssertionCheckKind, Context = unkno
|
|
|
581
583
|
<S extends "turn" | "session" | "attempt">(value: AssertionSubject<ManagedEventOccurrences<S>>, match: EventMatch): CheckedBooleanHandle<Kind, ManagedEventOccurrences<S>>;
|
|
582
584
|
<Value>(value: AssertionSubject<Value>, match: CollectionMatch<NoInfer<Value>>): CheckedBooleanHandle<Kind, Value>;
|
|
583
585
|
<Value>(value: AssertionSubject<Value>, match: ScoreMatch<NoInfer<Value>>): CheckedMeasurementHandle<Kind>;
|
|
586
|
+
<U extends import("./quantity.mjs").Unit>(value: import("./match.mjs").NumericMaterial<U>, match: NumericComparisonMatch<NoInfer<U>>): CheckedBooleanHandle<Kind, number>;
|
|
584
587
|
}
|
|
585
588
|
export interface AssertionGroupContext {
|
|
586
589
|
/**
|
package/dist/assertions/api.d.ts
CHANGED
|
@@ -78,6 +78,8 @@ export type AssertionCriterion = {
|
|
|
78
78
|
readonly numeric: {
|
|
79
79
|
readonly comparator: NumericComparator;
|
|
80
80
|
readonly threshold: number;
|
|
81
|
+
readonly upperThreshold?: number;
|
|
82
|
+
readonly unit?: import("./quantity.js").Unit;
|
|
81
83
|
readonly subject: {
|
|
82
84
|
readonly kind: "explicit-value";
|
|
83
85
|
} | {
|
|
@@ -581,6 +583,7 @@ export interface AssertionCheck<Kind extends AssertionCheckKind, Context = unkno
|
|
|
581
583
|
<S extends "turn" | "session" | "attempt">(value: AssertionSubject<ManagedEventOccurrences<S>>, match: EventMatch): CheckedBooleanHandle<Kind, ManagedEventOccurrences<S>>;
|
|
582
584
|
<Value>(value: AssertionSubject<Value>, match: CollectionMatch<NoInfer<Value>>): CheckedBooleanHandle<Kind, Value>;
|
|
583
585
|
<Value>(value: AssertionSubject<Value>, match: ScoreMatch<NoInfer<Value>>): CheckedMeasurementHandle<Kind>;
|
|
586
|
+
<U extends import("./quantity.js").Unit>(value: import("./match.js").NumericMaterial<U>, match: NumericComparisonMatch<NoInfer<U>>): CheckedBooleanHandle<Kind, number>;
|
|
584
587
|
}
|
|
585
588
|
export interface AssertionGroupContext {
|
|
586
589
|
/**
|
|
@@ -7,7 +7,7 @@ exports.managedEventOccurrencesSidecarOf = managedEventOccurrencesSidecarOf;
|
|
|
7
7
|
exports.toolMatcherQuery = toolMatcherQuery;
|
|
8
8
|
exports.eventMatcherQuery = eventMatcherQuery;
|
|
9
9
|
exports.collectionMatchRegistration = collectionMatchRegistration;
|
|
10
|
-
// @concord-file
|
|
10
|
+
// @concord-file
|
|
11
11
|
// @concord-implements docs/feature/assertions/library/scoped-assertions.md
|
|
12
12
|
// @concord-implements docs/feature/assertions/architecture/evidence.md
|
|
13
13
|
// @concord-implements docs/feature/eval/use-case/calledtool.md
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collection.js","sourceRoot":"","sources":["collection.ts"],"names":[],"mappings":";;AAoGA,wDA6BC;AACD,8DAIC;AAWD,sEAKC;AACD,4EAIC;AA4BD,4CASC;AACD,8CAWC;AAmCD,kEAqOC;AApdD,8CAA8C;AAC9C,2EAA2E;AAC3E,uEAAuE;AACvE,+DAA+D;AAC/D,mCAAgC;AAEhC,+DAA+J;AAE/J,yCAAuc;AACvc,6CAA0D;AAC1D,6CAAwD;AAmBxD,MAAM,wBAAwB,GAAG,IAAI,OAAO,EAAmC,CAAC;AAYhF,MAAM,+BAA+B,GAAG,IAAI,OAAO,EAA0C,CAAC;AAC9F,SAAS,cAAc,CAAC,GAAuE;IAC3F,IAAI,GAAG,CAAC,SAAS,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;QACtC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IAC9C,CAAC;IACD,MAAM,UAAU,GAAG,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC;IACvC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS;QAC3F,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ;QAC1B,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,IAAI;QACJ,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,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EAAE,QAAQ,CAAC,WAAW;QACjC,0BAA0B,EAAE,IAAA,gDAA0B,EAAC;YACnD,cAAc,EAAE,qBAAqB;YACrC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM;YAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC7D,IAAI,EAAE,kBAAkB;SAC3B,CAAC;QACF,QAAQ,EAAE,GAAG,EAAE,CAAC,eAAM,CAAC,UAAU,CAAC;YAC9B,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,cAAc,CAAC,MAAM,IAAA,0CAAoB,EAAC;gBACvD,cAAc,EAAE,qBAAqB;gBACrC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,OAAO;aACV,CAAC,EAAE,OAAO,CAAC;YACZ,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;SAC1B,CAAC;KACL,CAAC,CAAC;AACP,CAAC","sourcesContent":["// @concord-file ne-eval-assertions-collection\n// @concord-implements docs/feature/assertions/library/scoped-assertions.md\n// @concord-implements docs/feature/assertions/architecture/evidence.md\n// @concord-implements docs/feature/eval/use-case/calledtool.md\nimport { Effect } from \"effect\";\nimport type { AssertionCoverage, AssertionCriterion, AssertionLimitation, BooleanAssertionEvaluation, BooleanAssertionRegistration, MatcherSourceSnapshot, } from \"./api.ts\";\nimport { evaluateMatcherCollection, evaluateMatcherOrder, interruptedMatcherArtifact, type MatcherQuery, type MatcherSourceRow, } from \"./matcher-artifact.ts\";\nimport type { LogicalToolOccurrence } from \"../o11y/types.ts\";\nimport { collectionMatchSpecOf, assertionEventOccurrence, evaluateBooleanMatch, isManagedEventMatch, isManagedCollectionMatch, isManagedToolMatch, isNumericComparisonMatch, looksLikeCollectionMatch, type BooleanMatchEvaluation, type CollectionMatch, type EventMatch, type EventOccurrenceView, type ManagedEventOccurrences, type ManagedToolCalls, type NumericMaterial, type ToolMatch, type ToolMatchQuantifier, type ToolOccurrenceView, } from \"./match.ts\";\nimport { numericBooleanRegistration } from \"./numeric.ts\";\nimport { captureAssertionSnapshot } from \"./runtime.ts\";\ntype ProjectedMatcherCandidate<Candidate> = {\n readonly state: \"available\";\n readonly value: Candidate;\n} | {\n readonly state: \"unavailable\";\n readonly reason: string;\n};\nexport interface ManagedToolCallsSidecar {\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly cardinality: NumericMaterial;\n readonly sourceSnapshot: MatcherSourceSnapshot;\n readonly rows: readonly MatcherSourceRow<ProjectedMatcherCandidate<LogicalToolOccurrence>>[];\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n readonly actionsCoverage: unknown;\n readonly orphanFinishCount: number;\n readonly snapshot: unknown;\n}\nconst managedToolCallsSidecars = new WeakMap<object, ManagedToolCallsSidecar>();\nexport interface ManagedEventOccurrencesSidecar {\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly sourceSnapshot: MatcherSourceSnapshot;\n readonly rows: readonly MatcherSourceRow<{\n readonly state: \"available\";\n readonly value: EventOccurrenceView;\n }>[];\n readonly coverage: unknown;\n readonly snapshot: unknown;\n readonly unassociatedOperation: boolean;\n}\nconst managedEventOccurrencesSidecars = new WeakMap<object, ManagedEventOccurrencesSidecar>();\nfunction occurrenceView(row: MatcherSourceRow<ProjectedMatcherCandidate<LogicalToolOccurrence>>): ToolOccurrenceView {\n if (row.candidate.state !== \"available\") {\n return Object.freeze({ name: \"unknown\" });\n }\n const occurrence = row.candidate.value;\n const name = occurrence.name.canonical === undefined || occurrence.name.canonical === \"unknown\"\n ? occurrence.name.original\n : occurrence.name.canonical;\n return Object.freeze({\n name,\n ...(occurrence.input.state === \"unavailable\" ? {} : { input: occurrence.input.value }),\n ...(occurrence.output.state === \"unavailable\" ? {} : { output: occurrence.output.value }),\n ...(occurrence.lifecycle.state === \"available\" ? { status: occurrence.lifecycle.status } : {}),\n });\n}\nfunction foldedSourceSnapshot(snapshot: MatcherSourceSnapshot, incompleteReason: string | undefined): MatcherSourceSnapshot {\n if (snapshot.collectionAtCut === \"unavailable\")\n return snapshot;\n if (snapshot.collectionAtCut === \"partial\" || incompleteReason !== undefined) {\n return snapshot.collectionAtCut === \"partial\"\n ? snapshot\n : Object.freeze({ ...snapshot, collectionAtCut: \"partial\" as const });\n }\n return snapshot;\n}\nfunction cardinalityMaterial(input: {\n readonly collectionAtCut: MatcherSourceSnapshot[\"collectionAtCut\"];\n readonly knownLength: number;\n}): NumericMaterial {\n if (input.collectionAtCut === \"unavailable\") {\n return Object.freeze({ state: \"unavailable\" as const, reason: \"source-unavailable\" });\n }\n if (input.collectionAtCut === \"complete\") {\n return Object.freeze({ state: \"exact\" as const, value: input.knownLength });\n }\n return Object.freeze({ state: \"lower-bound\" as const, value: input.knownLength });\n}\nfunction cardinalityCoverage(material: NumericMaterial): {\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n} {\n if (material.state === \"unavailable\") {\n return Object.freeze({\n coverage: Object.freeze({ state: \"unavailable\" as const, reason: \"source-unavailable\" as const }),\n limitations: Object.freeze([]),\n });\n }\n if (material.state === \"lower-bound\") {\n return Object.freeze({\n coverage: Object.freeze({ state: \"partial\" as const, reason: \"provider-limited\" as const }),\n limitations: Object.freeze([{ kind: \"provider-limited\" as const }]),\n });\n }\n return Object.freeze({\n coverage: Object.freeze({ state: \"complete\" as const }),\n limitations: Object.freeze([]),\n });\n}\nexport function freezeManagedToolCalls(input: {\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly sourceSnapshot: MatcherSourceSnapshot;\n readonly rows: readonly MatcherSourceRow<ProjectedMatcherCandidate<LogicalToolOccurrence>>[];\n readonly incompleteReason?: string;\n readonly actionsCoverage: unknown;\n readonly orphanFinishCount: number;\n readonly snapshot: unknown;\n}): ManagedToolCalls {\n const views = Object.freeze(input.rows.map(occurrenceView));\n const collection = Object.freeze(views) as ManagedToolCalls;\n const sourceSnapshot = foldedSourceSnapshot(input.sourceSnapshot, input.incompleteReason);\n const cardinality = cardinalityMaterial({\n collectionAtCut: sourceSnapshot.collectionAtCut,\n knownLength: input.rows.length,\n });\n const coverage = cardinalityCoverage(cardinality);\n managedToolCallsSidecars.set(collection, Object.freeze({\n scope: input.scope,\n cardinality,\n sourceSnapshot,\n rows: input.rows,\n coverage: coverage.coverage,\n limitations: coverage.limitations,\n actionsCoverage: input.actionsCoverage,\n orphanFinishCount: input.orphanFinishCount,\n snapshot: input.snapshot,\n }));\n return collection;\n}\nexport function managedToolCallsSidecarOf(value: unknown): ManagedToolCallsSidecar | undefined {\n return typeof value === \"object\" && value !== null\n ? managedToolCallsSidecars.get(value)\n : undefined;\n}\nfunction eventOccurrenceView(event: EventOccurrenceView): EventOccurrenceView {\n if (event.type === \"message\") {\n return Object.freeze({ type: event.type, role: event.role, text: event.text });\n }\n return Object.freeze({\n type: event.type,\n tool: Object.freeze({ name: event.tool.name }),\n ...(event.type === \"operation.finished\" ? { status: event.status } : {}),\n }) as EventOccurrenceView;\n}\nexport function freezeManagedEventOccurrences(input: ManagedEventOccurrencesSidecar): ManagedEventOccurrences {\n const views = Object.freeze(input.rows.map((row) => eventOccurrenceView(row.candidate.value)));\n const collection = Object.freeze(views) as ManagedEventOccurrences;\n managedEventOccurrencesSidecars.set(collection, Object.freeze({ ...input }));\n return collection;\n}\nexport function managedEventOccurrencesSidecarOf(value: unknown): ManagedEventOccurrencesSidecar | undefined {\n return typeof value === \"object\" && value !== null\n ? managedEventOccurrencesSidecars.get(value)\n : undefined;\n}\nfunction unavailableMatcherCandidate(reason: string): BooleanMatchEvaluation<never> {\n return Object.freeze({\n state: \"unavailable\" as const,\n reason,\n diagnostic: Object.freeze({\n code: \"source-candidate-unavailable\",\n message: \"the matcher candidate could not be resolved from the immutable source ledger\",\n path: Object.freeze([]),\n reason,\n }),\n });\n}\nfunction toolMatchEvaluation(occurrence: LogicalToolOccurrence, result: BooleanMatchEvaluation<unknown>): BooleanMatchEvaluation<unknown> {\n if (occurrence.lifecycle.state === \"opaque\" && result.state === \"matched\") {\n return Object.freeze({\n state: \"unavailable\" as const,\n reason: `tool-lifecycle-unavailable:${occurrence.lifecycle.reason}`,\n diagnostic: Object.freeze({\n code: \"tool-lifecycle-unavailable\",\n message: \"the matching tool lifecycle is incomplete\",\n path: Object.freeze([]),\n reason: occurrence.lifecycle.reason,\n }),\n });\n }\n return result;\n}\nexport function toolMatcherQuery(match: ToolMatch, summary: import(\"./api.ts\").AssertionSnapshotValue = Object.freeze({\n matcher: match.name,\n})): MatcherQuery<ProjectedMatcherCandidate<LogicalToolOccurrence>> {\n return Object.freeze({\n summary,\n evaluate: async (candidate: ProjectedMatcherCandidate<LogicalToolOccurrence>) => candidate.state === \"unavailable\"\n ? unavailableMatcherCandidate(candidate.reason)\n : toolMatchEvaluation(candidate.value, await evaluateBooleanMatch(match, candidate.value)),\n });\n}\nexport function eventMatcherQuery(match: EventMatch, summary: import(\"./api.ts\").AssertionSnapshotValue = Object.freeze({ matcher: match.name })): MatcherQuery<ProjectedMatcherCandidate<EventOccurrenceView>> {\n return Object.freeze({\n summary,\n evaluate: async (candidate: ProjectedMatcherCandidate<EventOccurrenceView>) => {\n if (candidate.state === \"unavailable\")\n return unavailableMatcherCandidate(candidate.reason);\n const result = await evaluateBooleanMatch(match, candidate.value);\n const occurrence = assertionEventOccurrence(candidate.value);\n return occurrence === undefined ? result : toolMatchEvaluation(occurrence, result);\n },\n });\n}\nfunction occurrenceAssertion(quantifier: ToolMatchQuantifier): \"present\" | \"absent\" | \"count\" {\n if (quantifier.kind === \"absent\")\n return \"absent\";\n if (quantifier.kind === \"exact\")\n return \"count\";\n return quantifier.kind === \"at-least\" && quantifier.count === 1 ? \"present\" : \"count\";\n}\nfunction occurrenceCriterion(scope: \"turn\" | \"session\" | \"attempt\", matcher: string | undefined, quantifier: ToolMatchQuantifier): AssertionCriterion {\n return Object.freeze({\n kind: \"occurrence\" as const,\n scope,\n occurrence: \"tool\" as const,\n assertion: occurrenceAssertion(quantifier),\n ...(matcher === undefined ? {} : { matcher }),\n quantifier: Object.freeze(quantifier.kind === \"absent\"\n ? { kind: \"absent\" as const }\n : { kind: quantifier.kind, count: quantifier.count }),\n });\n}\nfunction orderCriterion(scope: \"turn\" | \"session\", matches: readonly ToolMatch[]): AssertionCriterion {\n return Object.freeze({\n kind: \"occurrence\" as const,\n scope,\n occurrence: \"tool\" as const,\n assertion: \"order\" as const,\n matcher: matches.map((match) => match.name).join(\", \"),\n });\n}\nfunction matchedSubject<Subject>(evaluation: BooleanAssertionEvaluation<void>, subject: Subject): BooleanAssertionEvaluation<Subject> {\n if (evaluation.state === \"matched\") {\n return Object.freeze({ ...evaluation, value: subject });\n }\n return evaluation as BooleanAssertionEvaluation<Subject>;\n}\nexport function collectionMatchRegistration<Subject>(subject: Subject, match: unknown): BooleanAssertionRegistration<Subject> {\n const sidecar = managedToolCallsSidecarOf(subject);\n const eventSidecar = managedEventOccurrencesSidecarOf(subject);\n if (isNumericComparisonMatch(match)) {\n if (eventSidecar !== undefined) {\n throw new TypeError(\"numeric Match cannot be used with managed eventOccurrences\");\n }\n if (sidecar !== undefined) {\n const captured = captureAssertionSnapshot(Object.freeze({\n ...sidecar.cardinality,\n cut: sidecar.snapshot,\n coverage: sidecar.coverage,\n collection: \"tool-calls\",\n scope: sidecar.scope,\n }));\n return numericBooleanRegistration({\n match,\n criterionSubject: Object.freeze({\n kind: \"collection-cardinality\" as const,\n collection: \"tool-calls\" as const,\n scope: sidecar.scope,\n }),\n material: sidecar.cardinality,\n captured: Object.freeze({\n ...captured,\n coverage: sidecar.coverage,\n limitations: sidecar.limitations,\n }),\n matchedValue: () => subject,\n });\n }\n if (!Array.isArray(subject)) {\n throw new TypeError(\"a numeric collection Match requires an array subject\");\n }\n const material = Object.freeze({ state: \"exact\" as const, value: subject.length });\n const captured = captureAssertionSnapshot(Object.freeze({\n ...material,\n cut: Object.freeze({ kind: \"author-array\" as const }),\n coverage: Object.freeze({ state: \"complete\" as const }),\n derivation: Object.freeze({ kind: \"explicit-value\" as const }),\n }));\n return numericBooleanRegistration({\n match,\n criterionSubject: Object.freeze({ kind: \"explicit-value\" as const }),\n material,\n captured,\n matchedValue: () => subject,\n });\n }\n const spec = isManagedToolMatch(match) || isManagedEventMatch(match)\n ? Object.freeze({\n kind: \"occurrence\" as const,\n domain: isManagedEventMatch(match) ? \"event\" as const : \"tool\" as const,\n item: match,\n quantifier: Object.freeze({ kind: \"at-least\" as const, count: 1 }),\n })\n : (() => {\n if (!isManagedCollectionMatch(match)) {\n if (looksLikeCollectionMatch(match)) {\n throw new TypeError(\"t.check() match must be a collection Match created by niceeval/expect\");\n }\n throw new TypeError(\"t.check() match must be a ToolMatch or collection Match created by niceeval/expect\");\n }\n return collectionMatchSpecOf(match);\n })();\n const domainSidecar = spec.domain === \"event\" ? eventSidecar : sidecar;\n if (domainSidecar === undefined) {\n throw new TypeError(spec.kind === \"in-order\"\n ? `inOrder() requires managed ${spec.domain === \"event\" ? \"eventOccurrences\" : \"toolCalls\"}`\n : `${spec.domain === \"event\" ? \"EventMatch\" : \"ToolMatch\"} occurrence checks require managed ${spec.domain === \"event\" ? \"eventOccurrences\" : \"toolCalls\"}`);\n }\n if (spec.domain === \"event\") {\n const managed = eventSidecar!;\n if (spec.kind === \"occurrence\") {\n const item = spec.item as EventMatch;\n const query = eventMatcherQuery(item, Object.freeze({ matcher: item.name, quantifier: spec.quantifier }));\n const captured = captureAssertionSnapshot({\n scope: managed.scope,\n occurrence: \"event\",\n matcher: item.name,\n quantifier: spec.quantifier,\n candidateCount: managed.rows.length,\n unassociatedOperation: managed.unassociatedOperation,\n coverage: managed.coverage,\n snapshot: managed.snapshot,\n });\n return Object.freeze({\n criterion: Object.freeze({\n ...occurrenceCriterion(managed.scope, item.name, spec.quantifier),\n occurrence: \"event\" as const,\n }),\n subject: captured.material,\n coverage: captured.coverage,\n limitations: captured.limitations,\n interruptedMatcherArtifact: interruptedMatcherArtifact({\n sourceSnapshot: managed.sourceSnapshot,\n sourceRows: managed.rows.length,\n queries: Object.freeze([query.summary]),\n kind: \"collection-filter\",\n }),\n evaluate: () => Effect.tryPromise({\n try: async () => matchedSubject(await evaluateMatcherCollection({\n sourceSnapshot: managed.sourceSnapshot,\n rows: managed.rows,\n query,\n quantifier: spec.quantifier,\n }), subject),\n catch: (error) => error,\n }),\n });\n }\n if (managed.scope === \"attempt\" || managed.sourceSnapshot.scope === \"attempt\") {\n throw new TypeError(\"inOrder() is unavailable at Attempt scope\");\n }\n const orderedSourceSnapshot = managed.sourceSnapshot as Exclude<MatcherSourceSnapshot, {\n readonly scope: \"attempt\";\n }>;\n const matches = spec.matches as readonly EventMatch[];\n const queries = Object.freeze(matches.map(eventMatcherQuery));\n const captured = captureAssertionSnapshot({\n scope: managed.scope,\n occurrence: \"event\",\n assertion: \"event-order\",\n matches: matches.map((item) => item.name),\n candidateCount: managed.rows.length,\n coverage: managed.coverage,\n snapshot: managed.snapshot,\n });\n return Object.freeze({\n criterion: Object.freeze({\n kind: \"occurrence\" as const,\n scope: managed.scope,\n occurrence: \"event\" as const,\n assertion: \"order\" as const,\n matcher: matches.map((item) => item.name).join(\", \"),\n }),\n subject: captured.material,\n coverage: captured.coverage,\n limitations: captured.limitations,\n interruptedMatcherArtifact: interruptedMatcherArtifact({\n sourceSnapshot: orderedSourceSnapshot,\n sourceRows: managed.rows.length,\n queries: Object.freeze(queries.map((query) => query.summary)),\n kind: \"ordered-sequence\",\n }),\n evaluate: () => Effect.tryPromise({\n try: async () => matchedSubject(await evaluateMatcherOrder({\n sourceSnapshot: orderedSourceSnapshot,\n rows: managed.rows,\n queries,\n }), subject),\n catch: (error) => error,\n }),\n });\n }\n if (sidecar === undefined)\n throw new TypeError(\"ToolMatch occurrence checks require a managed toolCalls collection\");\n if (spec.kind === \"occurrence\") {\n const item = spec.item as ToolMatch;\n const query = toolMatcherQuery(item, Object.freeze({\n matcher: item.name,\n quantifier: spec.quantifier,\n }));\n const captured = captureAssertionSnapshot({\n scope: sidecar.scope,\n occurrence: \"tool\",\n matcher: item.name,\n quantifier: spec.quantifier,\n candidateCount: sidecar.rows.length,\n orphanFinishCount: sidecar.orphanFinishCount,\n coverage: sidecar.actionsCoverage,\n snapshot: sidecar.snapshot,\n });\n return Object.freeze({\n criterion: occurrenceCriterion(sidecar.scope, item.name, spec.quantifier),\n subject: captured.material,\n coverage: captured.coverage,\n limitations: captured.limitations,\n interruptedMatcherArtifact: interruptedMatcherArtifact({\n sourceSnapshot: sidecar.sourceSnapshot,\n sourceRows: sidecar.rows.length,\n queries: Object.freeze([query.summary]),\n kind: \"collection-filter\",\n }),\n evaluate: () => Effect.tryPromise({\n try: async () => matchedSubject(await evaluateMatcherCollection({\n sourceSnapshot: sidecar.sourceSnapshot,\n rows: sidecar.rows,\n query,\n quantifier: spec.quantifier,\n }), subject),\n catch: (error) => error,\n }),\n });\n }\n if (sidecar.sourceSnapshot.scope === \"attempt\" || sidecar.scope === \"attempt\") {\n throw new TypeError(\"inOrder() is unavailable at Attempt scope\");\n }\n const orderedSourceSnapshot = sidecar.sourceSnapshot;\n const toolMatches = spec.matches as readonly ToolMatch[];\n const queries = Object.freeze(toolMatches.map(toolMatcherQuery));\n const captured = captureAssertionSnapshot({\n scope: sidecar.scope,\n assertion: \"tool-order\",\n matches: toolMatches.map((item) => item.name),\n candidateCount: sidecar.rows.length,\n coverage: sidecar.coverage,\n snapshot: sidecar.snapshot,\n });\n return Object.freeze({\n criterion: orderCriterion(sidecar.scope, toolMatches),\n subject: captured.material,\n coverage: captured.coverage,\n limitations: captured.limitations,\n interruptedMatcherArtifact: interruptedMatcherArtifact({\n sourceSnapshot: orderedSourceSnapshot,\n sourceRows: sidecar.rows.length,\n queries: Object.freeze(queries.map((query) => query.summary)),\n kind: \"ordered-sequence\",\n }),\n evaluate: () => Effect.tryPromise({\n try: async () => matchedSubject(await evaluateMatcherOrder({\n sourceSnapshot: orderedSourceSnapshot,\n rows: sidecar.rows,\n queries,\n }), subject),\n catch: (error) => error,\n }),\n });\n}\nexport type { CollectionMatch };\n"]}
|
|
1
|
+
{"version":3,"file":"collection.js","sourceRoot":"","sources":["collection.ts"],"names":[],"mappings":";;AAoGA,wDA6BC;AACD,8DAIC;AAWD,sEAKC;AACD,4EAIC;AA4BD,4CASC;AACD,8CAWC;AAmCD,kEAqOC;AApdD,gBAAgB;AAChB,2EAA2E;AAC3E,uEAAuE;AACvE,+DAA+D;AAC/D,mCAAgC;AAEhC,+DAA+J;AAE/J,yCAAuc;AACvc,6CAA0D;AAC1D,6CAAwD;AAmBxD,MAAM,wBAAwB,GAAG,IAAI,OAAO,EAAmC,CAAC;AAYhF,MAAM,+BAA+B,GAAG,IAAI,OAAO,EAA0C,CAAC;AAC9F,SAAS,cAAc,CAAC,GAAuE;IAC3F,IAAI,GAAG,CAAC,SAAS,CAAC,KAAK,KAAK,WAAW,EAAE,CAAC;QACtC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IAC9C,CAAC;IACD,MAAM,UAAU,GAAG,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC;IACvC,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS;QAC3F,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ;QAC1B,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,IAAI;QACJ,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACtF,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,KAAK,aAAa,CAAC,CAAC,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C,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,MAAM;YAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC7D,IAAI,EAAE,kBAAkB;SAC3B,CAAC;QACF,QAAQ,EAAE,GAAG,EAAE,CAAC,eAAM,CAAC,UAAU,CAAC;YAC9B,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,cAAc,CAAC,MAAM,IAAA,0CAAoB,EAAC;gBACvD,cAAc,EAAE,qBAAqB;gBACrC,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,OAAO;aACV,CAAC,EAAE,OAAO,CAAC;YACZ,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;SAC1B,CAAC;KACL,CAAC,CAAC;AACP,CAAC","sourcesContent":["// @concord-file\n// @concord-implements docs/feature/assertions/library/scoped-assertions.md\n// @concord-implements docs/feature/assertions/architecture/evidence.md\n// @concord-implements docs/feature/eval/use-case/calledtool.md\nimport { Effect } from \"effect\";\nimport type { AssertionCoverage, AssertionCriterion, AssertionLimitation, BooleanAssertionEvaluation, BooleanAssertionRegistration, MatcherSourceSnapshot, } from \"./api.ts\";\nimport { evaluateMatcherCollection, evaluateMatcherOrder, interruptedMatcherArtifact, type MatcherQuery, type MatcherSourceRow, } from \"./matcher-artifact.ts\";\nimport type { LogicalToolOccurrence } from \"../o11y/types.ts\";\nimport { collectionMatchSpecOf, assertionEventOccurrence, evaluateBooleanMatch, isManagedEventMatch, isManagedCollectionMatch, isManagedToolMatch, isNumericComparisonMatch, looksLikeCollectionMatch, type BooleanMatchEvaluation, type CollectionMatch, type EventMatch, type EventOccurrenceView, type ManagedEventOccurrences, type ManagedToolCalls, type NumericMaterial, type ToolMatch, type ToolMatchQuantifier, type ToolOccurrenceView, } from \"./match.ts\";\nimport { numericBooleanRegistration } from \"./numeric.ts\";\nimport { captureAssertionSnapshot } from \"./runtime.ts\";\ntype ProjectedMatcherCandidate<Candidate> = {\n readonly state: \"available\";\n readonly value: Candidate;\n} | {\n readonly state: \"unavailable\";\n readonly reason: string;\n};\nexport interface ManagedToolCallsSidecar {\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly cardinality: NumericMaterial;\n readonly sourceSnapshot: MatcherSourceSnapshot;\n readonly rows: readonly MatcherSourceRow<ProjectedMatcherCandidate<LogicalToolOccurrence>>[];\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n readonly actionsCoverage: unknown;\n readonly orphanFinishCount: number;\n readonly snapshot: unknown;\n}\nconst managedToolCallsSidecars = new WeakMap<object, ManagedToolCallsSidecar>();\nexport interface ManagedEventOccurrencesSidecar {\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly sourceSnapshot: MatcherSourceSnapshot;\n readonly rows: readonly MatcherSourceRow<{\n readonly state: \"available\";\n readonly value: EventOccurrenceView;\n }>[];\n readonly coverage: unknown;\n readonly snapshot: unknown;\n readonly unassociatedOperation: boolean;\n}\nconst managedEventOccurrencesSidecars = new WeakMap<object, ManagedEventOccurrencesSidecar>();\nfunction occurrenceView(row: MatcherSourceRow<ProjectedMatcherCandidate<LogicalToolOccurrence>>): ToolOccurrenceView {\n if (row.candidate.state !== \"available\") {\n return Object.freeze({ name: \"unknown\" });\n }\n const occurrence = row.candidate.value;\n const name = occurrence.name.canonical === undefined || occurrence.name.canonical === \"unknown\"\n ? occurrence.name.original\n : occurrence.name.canonical;\n return Object.freeze({\n name,\n ...(occurrence.input.state === \"unavailable\" ? {} : { input: occurrence.input.value }),\n ...(occurrence.output.state === \"unavailable\" ? {} : { output: occurrence.output.value }),\n ...(occurrence.lifecycle.state === \"available\" ? { status: occurrence.lifecycle.status } : {}),\n });\n}\nfunction foldedSourceSnapshot(snapshot: MatcherSourceSnapshot, incompleteReason: string | undefined): MatcherSourceSnapshot {\n if (snapshot.collectionAtCut === \"unavailable\")\n return snapshot;\n if (snapshot.collectionAtCut === \"partial\" || incompleteReason !== undefined) {\n return snapshot.collectionAtCut === \"partial\"\n ? snapshot\n : Object.freeze({ ...snapshot, collectionAtCut: \"partial\" as const });\n }\n return snapshot;\n}\nfunction cardinalityMaterial(input: {\n readonly collectionAtCut: MatcherSourceSnapshot[\"collectionAtCut\"];\n readonly knownLength: number;\n}): NumericMaterial {\n if (input.collectionAtCut === \"unavailable\") {\n return Object.freeze({ state: \"unavailable\" as const, reason: \"source-unavailable\" });\n }\n if (input.collectionAtCut === \"complete\") {\n return Object.freeze({ state: \"exact\" as const, value: input.knownLength });\n }\n return Object.freeze({ state: \"lower-bound\" as const, value: input.knownLength });\n}\nfunction cardinalityCoverage(material: NumericMaterial): {\n readonly coverage: AssertionCoverage;\n readonly limitations: readonly AssertionLimitation[];\n} {\n if (material.state === \"unavailable\") {\n return Object.freeze({\n coverage: Object.freeze({ state: \"unavailable\" as const, reason: \"source-unavailable\" as const }),\n limitations: Object.freeze([]),\n });\n }\n if (material.state === \"lower-bound\") {\n return Object.freeze({\n coverage: Object.freeze({ state: \"partial\" as const, reason: \"provider-limited\" as const }),\n limitations: Object.freeze([{ kind: \"provider-limited\" as const }]),\n });\n }\n return Object.freeze({\n coverage: Object.freeze({ state: \"complete\" as const }),\n limitations: Object.freeze([]),\n });\n}\nexport function freezeManagedToolCalls(input: {\n readonly scope: \"turn\" | \"session\" | \"attempt\";\n readonly sourceSnapshot: MatcherSourceSnapshot;\n readonly rows: readonly MatcherSourceRow<ProjectedMatcherCandidate<LogicalToolOccurrence>>[];\n readonly incompleteReason?: string;\n readonly actionsCoverage: unknown;\n readonly orphanFinishCount: number;\n readonly snapshot: unknown;\n}): ManagedToolCalls {\n const views = Object.freeze(input.rows.map(occurrenceView));\n const collection = Object.freeze(views) as ManagedToolCalls;\n const sourceSnapshot = foldedSourceSnapshot(input.sourceSnapshot, input.incompleteReason);\n const cardinality = cardinalityMaterial({\n collectionAtCut: sourceSnapshot.collectionAtCut,\n knownLength: input.rows.length,\n });\n const coverage = cardinalityCoverage(cardinality);\n managedToolCallsSidecars.set(collection, Object.freeze({\n scope: input.scope,\n cardinality,\n sourceSnapshot,\n rows: input.rows,\n coverage: coverage.coverage,\n limitations: coverage.limitations,\n actionsCoverage: input.actionsCoverage,\n orphanFinishCount: input.orphanFinishCount,\n snapshot: input.snapshot,\n }));\n return collection;\n}\nexport function managedToolCallsSidecarOf(value: unknown): ManagedToolCallsSidecar | undefined {\n return typeof value === \"object\" && value !== null\n ? managedToolCallsSidecars.get(value)\n : undefined;\n}\nfunction eventOccurrenceView(event: EventOccurrenceView): EventOccurrenceView {\n if (event.type === \"message\") {\n return Object.freeze({ type: event.type, role: event.role, text: event.text });\n }\n return Object.freeze({\n type: event.type,\n tool: Object.freeze({ name: event.tool.name }),\n ...(event.type === \"operation.finished\" ? { status: event.status } : {}),\n }) as EventOccurrenceView;\n}\nexport function freezeManagedEventOccurrences(input: ManagedEventOccurrencesSidecar): ManagedEventOccurrences {\n const views = Object.freeze(input.rows.map((row) => eventOccurrenceView(row.candidate.value)));\n const collection = Object.freeze(views) as ManagedEventOccurrences;\n managedEventOccurrencesSidecars.set(collection, Object.freeze({ ...input }));\n return collection;\n}\nexport function managedEventOccurrencesSidecarOf(value: unknown): ManagedEventOccurrencesSidecar | undefined {\n return typeof value === \"object\" && value !== null\n ? managedEventOccurrencesSidecars.get(value)\n : undefined;\n}\nfunction unavailableMatcherCandidate(reason: string): BooleanMatchEvaluation<never> {\n return Object.freeze({\n state: \"unavailable\" as const,\n reason,\n diagnostic: Object.freeze({\n code: \"source-candidate-unavailable\",\n message: \"the matcher candidate could not be resolved from the immutable source ledger\",\n path: Object.freeze([]),\n reason,\n }),\n });\n}\nfunction toolMatchEvaluation(occurrence: LogicalToolOccurrence, result: BooleanMatchEvaluation<unknown>): BooleanMatchEvaluation<unknown> {\n if (occurrence.lifecycle.state === \"opaque\" && result.state === \"matched\") {\n return Object.freeze({\n state: \"unavailable\" as const,\n reason: `tool-lifecycle-unavailable:${occurrence.lifecycle.reason}`,\n diagnostic: Object.freeze({\n code: \"tool-lifecycle-unavailable\",\n message: \"the matching tool lifecycle is incomplete\",\n path: Object.freeze([]),\n reason: occurrence.lifecycle.reason,\n }),\n });\n }\n return result;\n}\nexport function toolMatcherQuery(match: ToolMatch, summary: import(\"./api.ts\").AssertionSnapshotValue = Object.freeze({\n matcher: match.name,\n})): MatcherQuery<ProjectedMatcherCandidate<LogicalToolOccurrence>> {\n return Object.freeze({\n summary,\n evaluate: async (candidate: ProjectedMatcherCandidate<LogicalToolOccurrence>) => candidate.state === \"unavailable\"\n ? unavailableMatcherCandidate(candidate.reason)\n : toolMatchEvaluation(candidate.value, await evaluateBooleanMatch(match, candidate.value)),\n });\n}\nexport function eventMatcherQuery(match: EventMatch, summary: import(\"./api.ts\").AssertionSnapshotValue = Object.freeze({ matcher: match.name })): MatcherQuery<ProjectedMatcherCandidate<EventOccurrenceView>> {\n return Object.freeze({\n summary,\n evaluate: async (candidate: ProjectedMatcherCandidate<EventOccurrenceView>) => {\n if (candidate.state === \"unavailable\")\n return unavailableMatcherCandidate(candidate.reason);\n const result = await evaluateBooleanMatch(match, candidate.value);\n const occurrence = assertionEventOccurrence(candidate.value);\n return occurrence === undefined ? result : toolMatchEvaluation(occurrence, result);\n },\n });\n}\nfunction occurrenceAssertion(quantifier: ToolMatchQuantifier): \"present\" | \"absent\" | \"count\" {\n if (quantifier.kind === \"absent\")\n return \"absent\";\n if (quantifier.kind === \"exact\")\n return \"count\";\n return quantifier.kind === \"at-least\" && quantifier.count === 1 ? \"present\" : \"count\";\n}\nfunction occurrenceCriterion(scope: \"turn\" | \"session\" | \"attempt\", matcher: string | undefined, quantifier: ToolMatchQuantifier): AssertionCriterion {\n return Object.freeze({\n kind: \"occurrence\" as const,\n scope,\n occurrence: \"tool\" as const,\n assertion: occurrenceAssertion(quantifier),\n ...(matcher === undefined ? {} : { matcher }),\n quantifier: Object.freeze(quantifier.kind === \"absent\"\n ? { kind: \"absent\" as const }\n : { kind: quantifier.kind, count: quantifier.count }),\n });\n}\nfunction orderCriterion(scope: \"turn\" | \"session\", matches: readonly ToolMatch[]): AssertionCriterion {\n return Object.freeze({\n kind: \"occurrence\" as const,\n scope,\n occurrence: \"tool\" as const,\n assertion: \"order\" as const,\n matcher: matches.map((match) => match.name).join(\", \"),\n });\n}\nfunction matchedSubject<Subject>(evaluation: BooleanAssertionEvaluation<void>, subject: Subject): BooleanAssertionEvaluation<Subject> {\n if (evaluation.state === \"matched\") {\n return Object.freeze({ ...evaluation, value: subject });\n }\n return evaluation as BooleanAssertionEvaluation<Subject>;\n}\nexport function collectionMatchRegistration<Subject>(subject: Subject, match: unknown): BooleanAssertionRegistration<Subject> {\n const sidecar = managedToolCallsSidecarOf(subject);\n const eventSidecar = managedEventOccurrencesSidecarOf(subject);\n if (isNumericComparisonMatch(match)) {\n if (eventSidecar !== undefined) {\n throw new TypeError(\"numeric Match cannot be used with managed eventOccurrences\");\n }\n if (sidecar !== undefined) {\n const captured = captureAssertionSnapshot(Object.freeze({\n ...sidecar.cardinality,\n cut: sidecar.snapshot,\n coverage: sidecar.coverage,\n collection: \"tool-calls\",\n scope: sidecar.scope,\n }));\n return numericBooleanRegistration({\n match,\n criterionSubject: Object.freeze({\n kind: \"collection-cardinality\" as const,\n collection: \"tool-calls\" as const,\n scope: sidecar.scope,\n }),\n material: sidecar.cardinality,\n captured: Object.freeze({\n ...captured,\n coverage: sidecar.coverage,\n limitations: sidecar.limitations,\n }),\n matchedValue: () => subject,\n });\n }\n if (!Array.isArray(subject)) {\n throw new TypeError(\"a numeric collection Match requires an array subject\");\n }\n const material = Object.freeze({ state: \"exact\" as const, value: subject.length });\n const captured = captureAssertionSnapshot(Object.freeze({\n ...material,\n cut: Object.freeze({ kind: \"author-array\" as const }),\n coverage: Object.freeze({ state: \"complete\" as const }),\n derivation: Object.freeze({ kind: \"explicit-value\" as const }),\n }));\n return numericBooleanRegistration({\n match,\n criterionSubject: Object.freeze({ kind: \"explicit-value\" as const }),\n material,\n captured,\n matchedValue: () => subject,\n });\n }\n const spec = isManagedToolMatch(match) || isManagedEventMatch(match)\n ? Object.freeze({\n kind: \"occurrence\" as const,\n domain: isManagedEventMatch(match) ? \"event\" as const : \"tool\" as const,\n item: match,\n quantifier: Object.freeze({ kind: \"at-least\" as const, count: 1 }),\n })\n : (() => {\n if (!isManagedCollectionMatch(match)) {\n if (looksLikeCollectionMatch(match)) {\n throw new TypeError(\"t.check() match must be a collection Match created by niceeval/expect\");\n }\n throw new TypeError(\"t.check() match must be a ToolMatch or collection Match created by niceeval/expect\");\n }\n return collectionMatchSpecOf(match);\n })();\n const domainSidecar = spec.domain === \"event\" ? eventSidecar : sidecar;\n if (domainSidecar === undefined) {\n throw new TypeError(spec.kind === \"in-order\"\n ? `inOrder() requires managed ${spec.domain === \"event\" ? \"eventOccurrences\" : \"toolCalls\"}`\n : `${spec.domain === \"event\" ? \"EventMatch\" : \"ToolMatch\"} occurrence checks require managed ${spec.domain === \"event\" ? \"eventOccurrences\" : \"toolCalls\"}`);\n }\n if (spec.domain === \"event\") {\n const managed = eventSidecar!;\n if (spec.kind === \"occurrence\") {\n const item = spec.item as EventMatch;\n const query = eventMatcherQuery(item, Object.freeze({ matcher: item.name, quantifier: spec.quantifier }));\n const captured = captureAssertionSnapshot({\n scope: managed.scope,\n occurrence: \"event\",\n matcher: item.name,\n quantifier: spec.quantifier,\n candidateCount: managed.rows.length,\n unassociatedOperation: managed.unassociatedOperation,\n coverage: managed.coverage,\n snapshot: managed.snapshot,\n });\n return Object.freeze({\n criterion: Object.freeze({\n ...occurrenceCriterion(managed.scope, item.name, spec.quantifier),\n occurrence: \"event\" as const,\n }),\n subject: captured.material,\n coverage: captured.coverage,\n limitations: captured.limitations,\n interruptedMatcherArtifact: interruptedMatcherArtifact({\n sourceSnapshot: managed.sourceSnapshot,\n sourceRows: managed.rows.length,\n queries: Object.freeze([query.summary]),\n kind: \"collection-filter\",\n }),\n evaluate: () => Effect.tryPromise({\n try: async () => matchedSubject(await evaluateMatcherCollection({\n sourceSnapshot: managed.sourceSnapshot,\n rows: managed.rows,\n query,\n quantifier: spec.quantifier,\n }), subject),\n catch: (error) => error,\n }),\n });\n }\n if (managed.scope === \"attempt\" || managed.sourceSnapshot.scope === \"attempt\") {\n throw new TypeError(\"inOrder() is unavailable at Attempt scope\");\n }\n const orderedSourceSnapshot = managed.sourceSnapshot as Exclude<MatcherSourceSnapshot, {\n readonly scope: \"attempt\";\n }>;\n const matches = spec.matches as readonly EventMatch[];\n const queries = Object.freeze(matches.map(eventMatcherQuery));\n const captured = captureAssertionSnapshot({\n scope: managed.scope,\n occurrence: \"event\",\n assertion: \"event-order\",\n matches: matches.map((item) => item.name),\n candidateCount: managed.rows.length,\n coverage: managed.coverage,\n snapshot: managed.snapshot,\n });\n return Object.freeze({\n criterion: Object.freeze({\n kind: \"occurrence\" as const,\n scope: managed.scope,\n occurrence: \"event\" as const,\n assertion: \"order\" as const,\n matcher: matches.map((item) => item.name).join(\", \"),\n }),\n subject: captured.material,\n coverage: captured.coverage,\n limitations: captured.limitations,\n interruptedMatcherArtifact: interruptedMatcherArtifact({\n sourceSnapshot: orderedSourceSnapshot,\n sourceRows: managed.rows.length,\n queries: Object.freeze(queries.map((query) => query.summary)),\n kind: \"ordered-sequence\",\n }),\n evaluate: () => Effect.tryPromise({\n try: async () => matchedSubject(await evaluateMatcherOrder({\n sourceSnapshot: orderedSourceSnapshot,\n rows: managed.rows,\n queries,\n }), subject),\n catch: (error) => error,\n }),\n });\n }\n if (sidecar === undefined)\n throw new TypeError(\"ToolMatch occurrence checks require a managed toolCalls collection\");\n if (spec.kind === \"occurrence\") {\n const item = spec.item as ToolMatch;\n const query = toolMatcherQuery(item, Object.freeze({\n matcher: item.name,\n quantifier: spec.quantifier,\n }));\n const captured = captureAssertionSnapshot({\n scope: sidecar.scope,\n occurrence: \"tool\",\n matcher: item.name,\n quantifier: spec.quantifier,\n candidateCount: sidecar.rows.length,\n orphanFinishCount: sidecar.orphanFinishCount,\n coverage: sidecar.actionsCoverage,\n snapshot: sidecar.snapshot,\n });\n return Object.freeze({\n criterion: occurrenceCriterion(sidecar.scope, item.name, spec.quantifier),\n subject: captured.material,\n coverage: captured.coverage,\n limitations: captured.limitations,\n interruptedMatcherArtifact: interruptedMatcherArtifact({\n sourceSnapshot: sidecar.sourceSnapshot,\n sourceRows: sidecar.rows.length,\n queries: Object.freeze([query.summary]),\n kind: \"collection-filter\",\n }),\n evaluate: () => Effect.tryPromise({\n try: async () => matchedSubject(await evaluateMatcherCollection({\n sourceSnapshot: sidecar.sourceSnapshot,\n rows: sidecar.rows,\n query,\n quantifier: spec.quantifier,\n }), subject),\n catch: (error) => error,\n }),\n });\n }\n if (sidecar.sourceSnapshot.scope === \"attempt\" || sidecar.scope === \"attempt\") {\n throw new TypeError(\"inOrder() is unavailable at Attempt scope\");\n }\n const orderedSourceSnapshot = sidecar.sourceSnapshot;\n const toolMatches = spec.matches as readonly ToolMatch[];\n const queries = Object.freeze(toolMatches.map(toolMatcherQuery));\n const captured = captureAssertionSnapshot({\n scope: sidecar.scope,\n assertion: \"tool-order\",\n matches: toolMatches.map((item) => item.name),\n candidateCount: sidecar.rows.length,\n coverage: sidecar.coverage,\n snapshot: sidecar.snapshot,\n });\n return Object.freeze({\n criterion: orderCriterion(sidecar.scope, toolMatches),\n subject: captured.material,\n coverage: captured.coverage,\n limitations: captured.limitations,\n interruptedMatcherArtifact: interruptedMatcherArtifact({\n sourceSnapshot: orderedSourceSnapshot,\n sourceRows: sidecar.rows.length,\n queries: Object.freeze(queries.map((query) => query.summary)),\n kind: \"ordered-sequence\",\n }),\n evaluate: () => Effect.tryPromise({\n try: async () => matchedSubject(await evaluateMatcherOrder({\n sourceSnapshot: orderedSourceSnapshot,\n rows: sidecar.rows,\n queries,\n }), subject),\n catch: (error) => error,\n }),\n });\n}\nexport type { CollectionMatch };\n"]}
|
|
@@ -13,7 +13,7 @@ exports.interruptibleByCaller = interruptibleByCaller;
|
|
|
13
13
|
exports.responseByteCap = responseByteCap;
|
|
14
14
|
exports.readJudgeResponseCapped = readJudgeResponseCapped;
|
|
15
15
|
exports.requestScoreMatchProvider = requestScoreMatchProvider;
|
|
16
|
-
// @concord-file
|
|
16
|
+
// @concord-file
|
|
17
17
|
// @concord-implements docs/feature/judge/README.md
|
|
18
18
|
// @concord-implements docs/feature/judge/library.md
|
|
19
19
|
// @concord-implements docs/feature/judge/use-case/verify-judge.md
|