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":"match.js","sourceRoot":"","sources":["match.ts"],"names":[],"mappings":";;;AAsOA,kDAEC;AA+JD,wCAEC;AAED,wCAKC;AAED,kDAEC;AAED,4DAEC;AAED,0DAKC;AAyDD,8DAqCC;AAYD,4BAEC;AACD,wBAEC;AACD,kCAEC;AACD,0BAEC;AA8BD,8DAoBC;AAED,wDAkCC;AAED,4DAEC;AAED,oDAIC;AAED,gDAcC;AAwHD,kBAUC;AAKD,gBA4BC;AACD,kBAqBC;AAmBD,4BAcC;AACD,4BAcC;AACD,0BAkBC;AAED,gCAYC;AAmBD,kCAYC;AAED,kCAYC;AASD,8BAQC;AAED,wBAOC;AAED,0BAOC;AAED,4CAcC;AAED,8BAEC;AAwCD,wBAOC;AAqBD,0BA8BC;AAKD,wCAUC;AAGD,8BAYC;AAiBD,4CAyBC;AAMD,4CAmCC;AAiCD,0CAkBC;AAkLD,8CAkBC;AAmBD,8BAYC;AAgKD,8BA4DC;AAED,wDAGC;AAED,gDAIC;AAED,0DAGC;AAED,kDAIC;AA+ED,oCAqBC;AAkDD,gCA4CC;AAkHD,0BAwBC;AA6CD,4DAEC;AACD,4DAEC;AACD,sDAMC;AA4FD,4BAeC;AAED,0BAg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AG,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;YAC/D,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvC,MAAM,MAAM,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC;gBAChF,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACzE,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS;gBAC1B,KAAK,IAAI,CAAC,CAAC;YACf,IAAI,MAAM,CAAC,KAAK,KAAK,aAAa;gBAC9B,OAAO,KAAK,MAAM,CAAC;YACvB,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACjG,CAAC;QACD,IAAI,OAAO,KAAK,SAAS;YACrB,OAAO,iBAAiB,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC/D,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACvD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACtE,OAAO,iBAAiB,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["// @concord-file ne-eval-assertions-match\n// @concord-implements docs/feature/assertions/library/value-assertions.md\n// @concord-implements docs/feature/assertions/library/scoped-assertions.md\n// @concord-implements docs/feature/judge/library.md\n// Match 内核:纯候选比较、三态结果与领域 matcher。\n//\n// 这里不登记 Assertion,也不决定 Verdict / Score。调用方先冻结 subject,再把同一\n// candidate 交给本模块;因此组合 matcher 不会自行重读证据,也不会把 evaluator defect\n// 折成 mismatch 或 unavailable。\nimport type { StandardSchemaV1 as StandardSchema } from \"@standard-schema/spec\";\nimport { Effect } from \"effect\";\nimport type { CommandProjection, LogicalToolOccurrence, } from \"../o11y/types.ts\";\nimport { matchesJson } from \"../shared/json-match.ts\";\nimport type { JsonMatch, JsonValue } from \"../shared/types.ts\";\nimport type { JudgeMaterial } from \"../judge/image.ts\";\nimport { stripComments } from \"../util.ts\";\nimport { assertionRuntimeLimits } from \"./limits.ts\";\nimport type { MaterialCollection, MaterialItem } from \"./context-match.ts\";\nexport type MatchDomain = \"value\" | \"tool\" | \"event\";\ntype MatchPathSegment = string | number;\n/** 可序列化的候选诊断;组合 matcher 用 children 保留声明顺序与嵌套位置。 */\nexport interface MatchDiagnostic {\n readonly code: string;\n readonly message: string;\n /** 相对当前 matcher 的路径;组合节点的 child index 也由 children 明确给出。 */\n readonly path: readonly MatchPathSegment[];\n readonly expected?: string;\n readonly received?: string;\n readonly reason?: string;\n readonly locator?: {\n readonly kind: \"json-pointer\";\n readonly pointer: string;\n } | {\n readonly kind: \"tool-occurrence\";\n readonly id: string;\n };\n readonly children?: readonly MatchDiagnosticChild[];\n /** Collection matchers retain only a bounded, representative candidate set. */\n readonly truncation?: {\n readonly code: \"diagnostic-truncated\";\n readonly reason: \"sampled\";\n readonly captured: number;\n readonly knownTotal: number;\n };\n}\nexport interface MatchDiagnosticChild {\n readonly index: number;\n readonly label?: string;\n readonly state: MatchEvaluationState;\n readonly diagnostic?: MatchDiagnostic;\n}\nexport type MatchEvaluationState = \"matched\" | \"mismatched\" | \"unavailable\";\nexport interface CollectionEvaluationReceipt {\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}\n/** 一个单候选 matcher 的内部三态结果。 */\nexport type BooleanMatchEvaluation<R> = {\n readonly state: \"matched\";\n /** 永远是传入 candidate 本身,只是在类型层收窄。 */\n readonly value: R;\n readonly diagnostic?: MatchDiagnostic;\n readonly receipt?: CollectionEvaluationReceipt;\n} | {\n readonly state: \"mismatched\";\n readonly diagnostic: MatchDiagnostic;\n readonly receipt?: CollectionEvaluationReceipt;\n} | {\n readonly state: \"unavailable\";\n readonly reason: string;\n readonly diagnostic: MatchDiagnostic;\n readonly receipt?: CollectionEvaluationReceipt;\n};\n// 这些 symbol 不导出。外部作者无法构造看似可消费的 Match;输入 variance 与 refinement\n// variance 也保持分离,连续 measurement 不会伪造一个没有含义的输出 refinement。\nconst matchInputBrand: unique symbol = Symbol(\"niceeval.match.input\");\nconst matchRefinementBrand: unique symbol = Symbol(\"niceeval.match.refinement\");\nconst matchEvaluatorBrand: unique symbol = Symbol(\"niceeval.match.evaluator\");\nconst positiveWitnessBrand: unique symbol = Symbol(\"niceeval.match.positive-witness\");\nconst numericComparisonMatchBrand: unique symbol = Symbol(\"niceeval.numericComparisonMatch\");\nconst assertionEventIdentityBrand: unique symbol = Symbol(\"niceeval.assertionEventIdentity\");\nconst assertionEventPositionBrand: unique symbol = Symbol(\"niceeval.assertionEventPosition\");\nconst toolOccurrenceIdentityBrand: unique symbol = Symbol(\"niceeval.toolOccurrenceIdentity\");\nconst matchBrands = new WeakSet<object>();\nconst numericComparisons = new WeakMap<object, NumericComparison>();\nexport const NUMERIC_COMPARATORS = [\"less-than\", \"at-most\", \"greater-than\", \"at-least\"] as const;\nexport type NumericComparator = (typeof NUMERIC_COMPARATORS)[number];\nexport interface NumericComparison {\n readonly comparator: NumericComparator;\n readonly threshold: number;\n}\nexport type NumericMaterial = {\n readonly provenance?: {\n readonly source: string;\n readonly scope: string;\n readonly unit: string;\n readonly cut: string;\n };\n} & ({\n readonly state: \"exact\";\n readonly value: number;\n} | {\n readonly state: \"lower-bound\";\n readonly value: number;\n} | {\n readonly state: \"unavailable\";\n readonly reason: string;\n});\nexport interface Match<in T, D extends MatchDomain> {\n readonly domain: D;\n readonly name: string;\n readonly [matchInputBrand]: (candidate: T) => void;\n readonly [matchEvaluatorBrand]: (candidate: T) => Promise<unknown>;\n}\nexport interface BooleanMatch<in T, out R extends T, D extends MatchDomain = \"value\"> extends Match<T, D> {\n readonly kind: \"boolean\";\n readonly [matchRefinementBrand]: () => R;\n}\nexport interface NumericComparisonMatch extends BooleanMatch<number, number, \"value\"> {\n readonly [numericComparisonMatchBrand]: true;\n}\nexport interface ScoreMatch<in T> extends Match<T, \"value\"> {\n readonly kind: \"score\";\n}\nexport interface ScoreMatchAnchor {\n readonly measurement: number;\n readonly description: string;\n}\nexport type ScoreMatchLlmFailure = {\n readonly _tag: \"ScoreMatchLlmUnavailable\";\n readonly code: string;\n readonly message: string;\n} | {\n readonly _tag: \"ScoreMatchLlmErrored\";\n readonly code: string;\n readonly message: string;\n};\nexport type ScoreMatchResult = number | {\n readonly state: \"measured\";\n readonly measurement: number;\n readonly rationale?: string;\n readonly citations?: readonly string[];\n} | {\n readonly state: \"unavailable\";\n readonly reason: string;\n readonly rationale?: string;\n readonly citations?: readonly string[];\n} | {\n readonly state: \"errored\";\n readonly code: string;\n readonly message: string;\n};\nexport interface ScoreMatchContext {\n readonly llm: {\n score(input: {\n readonly rubric: string;\n readonly anchors: readonly ScoreMatchAnchor[];\n readonly material: JudgeMaterial;\n }): Effect.Effect<{\n readonly measurement: number;\n readonly rationale: string;\n }, ScoreMatchLlmFailure>;\n classify(input: {\n readonly rubric: string;\n readonly choices: readonly string[];\n readonly evidenceIds?: readonly string[];\n readonly material: JudgeMaterial;\n }): Effect.Effect<{\n readonly choice: string;\n readonly rationale: string;\n readonly citations?: readonly string[];\n }, ScoreMatchLlmFailure>;\n extract(input: {\n readonly rubric: string;\n readonly maxItems: number;\n readonly material: JudgeMaterial;\n }): Effect.Effect<{\n readonly items: readonly string[];\n readonly rationale: string;\n readonly complete: boolean;\n }, ScoreMatchLlmFailure>;\n batchClassify(input: {\n readonly rubric: string;\n readonly choices: readonly string[];\n readonly items: readonly {\n readonly id: string;\n readonly text: string;\n }[];\n readonly material: JudgeMaterial;\n }): Effect.Effect<{\n readonly items: readonly {\n readonly id: string;\n readonly choice: string;\n readonly rationale: string;\n }[];\n }, ScoreMatchLlmFailure>;\n };\n}\nexport interface ManagedScoreMatchOptions<T, E = ScoreMatchLlmFailure> {\n readonly name: string;\n readonly version: string;\n readonly config: JsonValue;\n readonly llm: {\n readonly maxCalls?: number;\n readonly maxMaterialBytes?: number;\n readonly maxAuditBytes?: number;\n };\n readonly score: (value: T, context: ScoreMatchContext) => Effect.Effect<ScoreMatchResult, E>;\n}\n/** @internal Canonical, deeply frozen definition consumed by identity and the managed gateway. */\nexport interface ManagedScoreMatchDefinition<T = unknown, E = unknown> {\n readonly name: string;\n readonly version: string;\n readonly config: JsonValue;\n readonly canonicalConfig: string;\n readonly llm: {\n readonly maxCalls: number;\n readonly maxMaterialBytes: number;\n readonly maxAuditBytes: number;\n };\n readonly score: (value: T, context: ScoreMatchContext) => Effect.Effect<ScoreMatchResult, E>;\n}\nconst managedScoreMatches = new WeakMap<object, ManagedScoreMatchDefinition<unknown, unknown>>();\nconst scoreEvaluators = new WeakMap<object, (candidate: unknown) => Effect.Effect<number, unknown>>();\nexport function managedScoreMatchOf(value: unknown): ManagedScoreMatchDefinition<unknown, unknown> | undefined {\n return typeof value === \"object\" && value !== null ? managedScoreMatches.get(value) : undefined;\n}\nexport type ValueMatch<T, R extends T = T> = BooleanMatch<T, R, \"value\"> | ScoreMatch<T>;\nexport type LogicalCommandOccurrence = LogicalToolOccurrence & {\n readonly command: Extract<CommandProjection, {\n readonly kind: \"command\";\n }>;\n};\nexport interface ToolOccurrenceQuantifiers {\n atLeast(count: number): ToolOccurrenceMatch;\n lessThan(count: number): ToolUpperBoundOccurrenceMatch;\n atMost(count: number): ToolUpperBoundOccurrenceMatch;\n greaterThan(count: number): ToolOccurrenceMatch;\n exactly(count: number): ToolOccurrenceMatch;\n}\nexport type ToolMatch<R extends LogicalToolOccurrence = LogicalToolOccurrence> = BooleanMatch<LogicalToolOccurrence, R, \"tool\"> & ToolOccurrenceQuantifiers;\ntype BooleanMatchForDomain<T, R extends T, D extends MatchDomain> = BooleanMatch<T, R, D> & (D extends \"tool\" ? ToolOccurrenceQuantifiers : D extends \"event\" ? EventOccurrenceQuantifiers : object);\nexport type AssertionEventIdentity = string & {\n readonly [assertionEventIdentityBrand]: true;\n};\nexport type ToolOccurrenceIdentity = string & {\n readonly [toolOccurrenceIdentityBrand]: true;\n};\nexport interface AssertionEventPosition {\n readonly turnOrdinal: number;\n readonly eventOrdinal: number;\n readonly [assertionEventPositionBrand]: true;\n}\nexport interface AssertionToolReference {\n readonly id: ToolOccurrenceIdentity;\n readonly name: string;\n}\n/** Public, identity-free projection exposed by managed eventOccurrences. */\nexport type EventOccurrenceView = {\n readonly type: \"message\";\n readonly role: \"assistant\" | \"user\";\n readonly text: string;\n} | {\n readonly type: \"operation.started\";\n readonly tool: {\n readonly name: string;\n };\n} | {\n readonly type: \"operation.finished\";\n readonly tool: {\n readonly name: string;\n };\n readonly status: \"completed\" | \"failed\" | \"rejected\";\n};\nexport type AssertionEvent = {\n readonly id: AssertionEventIdentity;\n readonly position: AssertionEventPosition;\n readonly type: \"message\";\n readonly role: \"assistant\" | \"user\";\n readonly text: string;\n} | {\n readonly id: AssertionEventIdentity;\n readonly position: AssertionEventPosition;\n readonly type: \"operation.started\";\n readonly tool: AssertionToolReference;\n} | {\n readonly id: AssertionEventIdentity;\n readonly position: AssertionEventPosition;\n readonly type: \"operation.finished\";\n readonly tool: AssertionToolReference;\n readonly status: \"completed\" | \"failed\" | \"rejected\";\n};\nexport type MatchableEvent = AssertionEvent;\nexport interface EventOccurrenceQuantifiers {\n atLeast(count: number): EventOccurrenceMatch;\n lessThan(count: number): EventUpperBoundOccurrenceMatch;\n atMost(count: number): EventUpperBoundOccurrenceMatch;\n greaterThan(count: number): EventOccurrenceMatch;\n exactly(count: number): EventOccurrenceMatch;\n}\nexport type EventMatch<R extends EventOccurrenceView = EventOccurrenceView> = BooleanMatch<EventOccurrenceView, R, \"event\"> & EventOccurrenceQuantifiers;\nconst assertionEventOccurrences = new WeakMap<object, LogicalToolOccurrence>();\nexport type RefinementOf<M> = M extends BooleanMatch<infer _T, infer R, infer _D> ? R : never;\nexport type RefinementIntersection<M extends readonly unknown[]> = M extends readonly [\n infer Head,\n ...infer Tail\n] ? RefinementOf<Head> & RefinementIntersection<Tail> : unknown;\ninterface InternalMatch {\n readonly domain: MatchDomain;\n readonly name: string;\n readonly kind: \"boolean\" | \"score\";\n readonly [matchEvaluatorBrand]: (candidate: unknown) => Promise<unknown>;\n readonly [positiveWitnessBrand]?: true;\n}\ninterface CreateBooleanMatchOptions {\n readonly positiveWitness?: true;\n}\nfunction isRecord(value: unknown): value is globalThis.Record<PropertyKey, unknown> {\n return value !== null && typeof value === \"object\";\n}\nfunction diagnostic(code: string, message: string, options: Omit<MatchDiagnostic, \"code\" | \"message\" | \"path\"> & {\n readonly path?: readonly MatchPathSegment[];\n} = {}): MatchDiagnostic {\n return Object.freeze({\n code,\n message,\n path: Object.freeze([...(options.path ?? [])]),\n ...(options.expected === undefined ? {} : { expected: options.expected }),\n ...(options.received === undefined ? {} : { received: options.received }),\n ...(options.reason === undefined ? {} : { reason: options.reason }),\n ...(options.locator === undefined ? {} : { locator: options.locator }),\n ...(options.children === undefined ? {} : { children: Object.freeze([...options.children]) }),\n ...(options.truncation === undefined ? {} : { truncation: Object.freeze({ ...options.truncation }) }),\n });\n}\nfunction matched<R>(value: R, detail?: MatchDiagnostic): BooleanMatchEvaluation<R> {\n return Object.freeze({ state: \"matched\" as const, value, ...(detail === undefined ? {} : { diagnostic: detail }) });\n}\nfunction mismatched<R = never>(detail: MatchDiagnostic): BooleanMatchEvaluation<R> {\n return Object.freeze({ state: \"mismatched\" as const, diagnostic: detail });\n}\nfunction unavailable<R = never>(reason: string, detail: MatchDiagnostic): BooleanMatchEvaluation<R> {\n return Object.freeze({ state: \"unavailable\" as const, reason, diagnostic: detail });\n}\nfunction assertDiagnostic(value: unknown, label: string): asserts value is MatchDiagnostic {\n if (!isRecord(value) || typeof value.code !== \"string\" || typeof value.message !== \"string\" || !Array.isArray(value.path)) {\n throw new TypeError(`${label} returned an invalid diagnostic`);\n }\n}\nfunction assertBooleanEvaluation<R>(value: unknown, label: string): BooleanMatchEvaluation<R> {\n if (!isRecord(value) || typeof value.state !== \"string\") {\n throw new TypeError(`${label} returned an invalid boolean matcher result`);\n }\n if (value.state === \"matched\") {\n if (!(\"value\" in value))\n throw new TypeError(`${label} returned a matched result without the original candidate`);\n return value as BooleanMatchEvaluation<R>;\n }\n if (value.state === \"mismatched\") {\n assertDiagnostic(value.diagnostic, label);\n return value as BooleanMatchEvaluation<R>;\n }\n if (value.state === \"unavailable\") {\n if (typeof value.reason !== \"string\" || value.reason.length === 0) {\n throw new TypeError(`${label} returned unavailable without a reason`);\n }\n assertDiagnostic(value.diagnostic, label);\n return value as BooleanMatchEvaluation<R>;\n }\n throw new TypeError(`${label} returned an unknown matcher state`);\n}\nfunction internalMatchOf(value: unknown, label: string): InternalMatch {\n if (!isRecord(value) || !matchBrands.has(value)) {\n throw new TypeError(`${label} must be a Match created by niceeval/expect`);\n }\n const match = value as unknown as InternalMatch;\n if ((match.domain !== \"value\" && match.domain !== \"tool\" && match.domain !== \"event\") ||\n (match.kind !== \"boolean\" && match.kind !== \"score\") ||\n typeof match.name !== \"string\" ||\n typeof match[matchEvaluatorBrand] !== \"function\") {\n throw new TypeError(`${label} must be a Match created by niceeval/expect`);\n }\n return match;\n}\n/** @internal Runtime brand guard used by the context overload dispatcher. */\nexport function isManagedMatch(value: unknown): boolean {\n return isRecord(value) && matchBrands.has(value);\n}\n/** @internal Reject Match-shaped raw subjects instead of silently treating them as ordinary values. */\nexport function looksLikeMatch(value: unknown): boolean {\n if (!isRecord(value))\n return false;\n return (value.domain === \"value\" || value.domain === \"tool\" || value.domain === \"event\") &&\n (value.kind === \"boolean\" || value.kind === \"score\") && typeof value.name === \"string\";\n}\n/** @internal Returns the durable numeric identity of a managed matcher, when present. */\nexport function numericComparisonOf(value: unknown): NumericComparison | undefined {\n return isRecord(value) ? numericComparisons.get(value) : undefined;\n}\n/** @internal Nominal guard backed by the private managed-match registry. */\nexport function isNumericComparisonMatch(value: unknown): value is NumericComparisonMatch {\n return numericComparisonOf(value) !== undefined;\n}\n/** @internal The value-side consumer accepts only a real, value-domain Match. */\nexport function assertManagedValueMatch(value: unknown, label = \"match\"): BooleanMatch<unknown, unknown, \"value\"> | ScoreMatch<unknown> {\n const match = internalMatchOf(value, label);\n if (match.domain !== \"value\")\n throw new TypeError(`${label} must be a value-domain Match`);\n return value as BooleanMatch<unknown, unknown, \"value\"> | ScoreMatch<unknown>;\n}\nfunction assertBooleanMatch(value: unknown, label: string, domain?: MatchDomain): InternalMatch {\n const match = internalMatchOf(value, label);\n if (match.kind !== \"boolean\")\n throw new TypeError(`${label} must be a BooleanMatch`);\n if (domain !== undefined && match.domain !== domain) {\n throw new TypeError(`${label} must have ${domain} domain, received ${match.domain}`);\n }\n return match;\n}\nfunction createBooleanMatch<T, R extends T, D extends MatchDomain>(domain: D, name: string, evaluate: (candidate: T) => BooleanMatchEvaluation<R> | Promise<BooleanMatchEvaluation<R>>, options: CreateBooleanMatchOptions = {}): BooleanMatchForDomain<T, R, D> {\n let match: BooleanMatchForDomain<T, R, D>;\n const result = {\n domain,\n name,\n kind: \"boolean\" as const,\n [matchInputBrand]: (_candidate: T) => undefined,\n [matchRefinementBrand]: () => undefined as unknown as R,\n [matchEvaluatorBrand]: async (candidate: T) => evaluate(candidate),\n ...(options.positiveWitness === true ? { [positiveWitnessBrand]: true as const } : {}),\n ...(domain === \"tool\" || domain === \"event\"\n ? {\n atLeast: (count: number) => quantifiedOccurrenceMatch(match as unknown as ToolMatch | EventMatch, \"at-least\", count),\n lessThan: (count: number) => quantifiedOccurrenceMatch(match as unknown as ToolMatch | EventMatch, \"less-than\", count),\n atMost: (count: number) => quantifiedOccurrenceMatch(match as unknown as ToolMatch | EventMatch, \"at-most\", count),\n greaterThan: (count: number) => quantifiedOccurrenceMatch(match as unknown as ToolMatch | EventMatch, \"greater-than\", count),\n exactly: (count: number) => quantifiedOccurrenceMatch(match as unknown as ToolMatch | EventMatch, \"exact\", count),\n }\n : {}),\n };\n match = Object.freeze(result) as BooleanMatchForDomain<T, R, D>;\n matchBrands.add(match);\n return match;\n}\nfunction numericDiagnostic(comparison: NumericComparison, material: NumericMaterial, code: string, message: string): MatchDiagnostic {\n return diagnostic(code, message, {\n expected: `${comparison.comparator} ${comparison.threshold}`,\n received: material.state === \"unavailable\" ? material.reason : String(material.value),\n ...(material.state === \"unavailable\" ? { reason: material.reason } : {}),\n });\n}\nfunction compareExact(value: number, comparison: NumericComparison): boolean {\n switch (comparison.comparator) {\n case \"less-than\":\n return value < comparison.threshold;\n case \"at-most\":\n return value <= comparison.threshold;\n case \"greater-than\":\n return value > comparison.threshold;\n case \"at-least\":\n return value >= comparison.threshold;\n }\n}\n/**\n * The sole numeric comparison evaluator. A lower bound can only decide a\n * monotone result; all other partial observations remain unavailable.\n */\nexport function evaluateNumericComparison(material: NumericMaterial, comparison: NumericComparison): BooleanMatchEvaluation<number> {\n if (material.state === \"unavailable\") {\n return unavailable(material.reason, numericDiagnostic(comparison, material, \"numeric-value-unavailable\", \"the numeric value is unavailable\"));\n }\n if (!Number.isFinite(material.value)) {\n const unavailableMaterial = Object.freeze({\n state: \"unavailable\" as const,\n reason: \"non-finite-number\",\n });\n return unavailable(unavailableMaterial.reason, numericDiagnostic(comparison, unavailableMaterial, \"numeric-value-non-finite\", \"the numeric value is not finite\"));\n }\n if (material.state === \"exact\") {\n return compareExact(material.value, comparison)\n ? matched(material.value)\n : mismatched(numericDiagnostic(comparison, material, \"numeric-comparison-failed\", \"the numeric comparison did not match\"));\n }\n const decided = comparison.comparator === \"at-most\"\n ? material.value > comparison.threshold\n ? \"mismatched\"\n : undefined\n : comparison.comparator === \"less-than\"\n ? material.value >= comparison.threshold\n ? \"mismatched\"\n : undefined\n : comparison.comparator === \"at-least\"\n ? material.value >= comparison.threshold\n ? \"matched\"\n : undefined\n : material.value > comparison.threshold\n ? \"matched\"\n : undefined;\n if (decided === \"matched\")\n return matched(material.value);\n if (decided === \"mismatched\") {\n return mismatched(numericDiagnostic(comparison, material, \"numeric-lower-bound-exceeded\", \"the known lower bound decides the numeric comparison\"));\n }\n return unavailable(\"partial-numeric-material\", numericDiagnostic(comparison, material, \"numeric-lower-bound-inconclusive\", \"the known lower bound cannot decide the numeric comparison\"));\n}\nfunction numericMatch(comparator: NumericComparator, threshold: number): NumericComparisonMatch {\n if (typeof threshold !== \"number\" || !Number.isFinite(threshold)) {\n throw new TypeError(`${comparator} threshold must be a finite number`);\n }\n const comparison = Object.freeze({ comparator, threshold });\n const match = createBooleanMatch<number, number, \"value\">(\"value\", `${comparator}(${threshold})`, (candidate) => evaluateNumericComparison(Number.isFinite(candidate)\n ? Object.freeze({ state: \"exact\" as const, value: candidate })\n : Object.freeze({ state: \"unavailable\" as const, reason: \"non-finite-number\" }), comparison)) as NumericComparisonMatch;\n numericComparisons.set(match, comparison);\n return match;\n}\nexport function lessThan(threshold: number): NumericComparisonMatch {\n return numericMatch(\"less-than\", threshold);\n}\nexport function atMost(threshold: number): NumericComparisonMatch {\n return numericMatch(\"at-most\", threshold);\n}\nexport function greaterThan(threshold: number): NumericComparisonMatch {\n return numericMatch(\"greater-than\", threshold);\n}\nexport function atLeast(threshold: number): NumericComparisonMatch {\n return numericMatch(\"at-least\", threshold);\n}\nfunction createScoreMatch<T>(name: string, evaluate: (candidate: T) => number | Promise<number>): ScoreMatch<T> {\n const result = {\n domain: \"value\" as const,\n name,\n kind: \"score\" as const,\n [matchInputBrand]: (_candidate: T) => undefined,\n [matchEvaluatorBrand]: async (candidate: T) => evaluate(candidate),\n };\n const match = Object.freeze(result) as ScoreMatch<T>;\n matchBrands.add(match);\n scoreEvaluators.set(match, (candidate) => Effect.tryPromise({\n try: () => Promise.resolve(evaluate(candidate as T)),\n catch: (cause) => cause,\n }));\n return match;\n}\nfunction freezeEventPosition(turnOrdinal: number, eventOrdinal: number): AssertionEventPosition {\n return Object.freeze({ turnOrdinal, eventOrdinal }) as AssertionEventPosition;\n}\nfunction assertionEventId(session: string, turn: string, turnOrdinal: number, eventOrdinal: number): AssertionEventIdentity {\n return JSON.stringify([\n \"niceeval.assertion-event/1\",\n session,\n turn,\n turnOrdinal,\n eventOrdinal,\n ]) as AssertionEventIdentity;\n}\n/** @internal Project a raw message into the closed assertion-event surface. */\nexport function makeAssertionMessageEvent(input: {\n readonly eventId?: string;\n readonly session: string;\n readonly turn: string;\n readonly turnOrdinal: number;\n readonly eventOrdinal: number;\n readonly role: \"assistant\" | \"user\";\n readonly text: string;\n}): Extract<AssertionEvent, {\n readonly type: \"message\";\n}> {\n return Object.freeze({\n id: input.eventId === undefined\n ? assertionEventId(input.session, input.turn, input.turnOrdinal, input.eventOrdinal)\n : input.eventId as AssertionEventIdentity,\n position: freezeEventPosition(input.turnOrdinal, input.eventOrdinal),\n type: \"message\" as const,\n role: input.role,\n text: input.text,\n });\n}\n/** @internal Project a correlated tool lifecycle row without exposing raw adapter fields. */\nexport function makeAssertionToolEvent(input: {\n readonly eventId?: string;\n readonly toolOccurrenceId?: string;\n readonly session: string;\n readonly turn: string;\n readonly turnOrdinal: number;\n readonly eventOrdinal: number;\n readonly type: \"operation.started\" | \"operation.finished\";\n readonly occurrence: LogicalToolOccurrence;\n readonly status?: \"completed\" | \"failed\" | \"rejected\";\n}): Extract<AssertionEvent, {\n readonly type: \"operation.started\" | \"operation.finished\";\n}> {\n const base = {\n id: input.eventId === undefined\n ? assertionEventId(input.session, input.turn, input.turnOrdinal, input.eventOrdinal)\n : input.eventId as AssertionEventIdentity,\n position: freezeEventPosition(input.turnOrdinal, input.eventOrdinal),\n tool: Object.freeze({\n id: (input.toolOccurrenceId ?? input.occurrence.id) as ToolOccurrenceIdentity,\n name: input.occurrence.name.canonical ?? input.occurrence.name.original,\n }),\n };\n const event = input.type === \"operation.started\"\n ? Object.freeze({ ...base, type: \"operation.started\" as const })\n : Object.freeze({\n ...base,\n type: \"operation.finished\" as const,\n status: input.status ?? (() => {\n throw new TypeError(\"operation.finished assertion event requires status\");\n })(),\n });\n assertionEventOccurrences.set(event, input.occurrence);\n return event;\n}\n/** @internal Retrieve the correlated occurrence for eventMatch(tool). */\nexport function assertionEventOccurrence(event: EventOccurrenceView): LogicalToolOccurrence | undefined {\n return assertionEventOccurrences.get(event);\n}\n/** 供 Assertion runtime / scope owner 消费 BooleanMatch;普通作者面不会导出此 evaluator。 */\nexport async function evaluateBooleanMatch<T, R extends T, D extends MatchDomain>(match: BooleanMatch<T, R, D>, candidate: T): Promise<BooleanMatchEvaluation<R>> {\n const internal = assertBooleanMatch(match, \"match\");\n const result = await internal[matchEvaluatorBrand](candidate);\n return assertBooleanEvaluation<R>(result, `matcher ${internal.name}`);\n}\n/** 供 Assertion runtime 消费 ScoreMatch。范围非法是 evaluator defect,绝不 clamp。 */\nexport function evaluateScoreMatch<T>(match: ScoreMatch<T>, candidate: T): Effect.Effect<number, unknown> {\n const internal = internalMatchOf(match, \"match\");\n if (internal.kind !== \"score\" || internal.domain !== \"value\") {\n throw new TypeError(\"match must be a value-domain ScoreMatch\");\n }\n const evaluate = scoreEvaluators.get(match);\n if (evaluate === undefined)\n throw new TypeError(\"match must be a managed ScoreMatch\");\n return evaluate(candidate).pipe(Effect.map((score) => {\n if (typeof score !== \"number\" || !Number.isFinite(score) || score < 0 || score > 1) {\n throw new TypeError(`matcher ${internal.name} returned a score outside finite [0, 1]`);\n }\n return score;\n }));\n}\nfunction hasPositiveWitnessCapability(match: BooleanMatch<unknown, unknown, \"value\">): boolean {\n return (internalMatchOf(match, \"input matcher\") as InternalMatch)[positiveWitnessBrand] === true;\n}\nfunction assertNonEmptyString(value: unknown, label: string): asserts value is string {\n if (typeof value !== \"string\" || value.length === 0)\n throw new TypeError(`${label} must be a non-empty string`);\n}\nfunction assertPlainOptions(value: unknown, label: string, allowed: readonly string[]): globalThis.Record<string, unknown> {\n if (value === undefined)\n return {};\n if (!isRecord(value) || Array.isArray(value))\n throw new TypeError(`${label} must be an options object`);\n for (const key of Object.keys(value)) {\n if (!allowed.includes(key))\n throw new TypeError(`${label} does not support option ${JSON.stringify(key)}`);\n }\n return value as globalThis.Record<string, unknown>;\n}\nfunction quoted(value: string): string {\n return JSON.stringify(value);\n}\nfunction jsonPreview(value: JsonValue): string {\n const serialized = JSON.stringify(value);\n const characters = Array.from(serialized);\n const limit = assertionRuntimeLimits.displayCodePoints;\n return characters.length <= limit\n ? serialized\n : `${characters.slice(0, limit - 1).join(\"\")}…`;\n}\nfunction resultChild(result: BooleanMatchEvaluation<unknown>, index: number, label?: string): MatchDiagnosticChild {\n return Object.freeze({\n index,\n ...(label === undefined ? {} : { label }),\n state: result.state,\n ...(result.diagnostic === undefined ? {} : { diagnostic: result.diagnostic }),\n });\n}\nfunction combineConjunction<T, R extends T>(candidate: T, name: string, fields: readonly {\n readonly label: string;\n readonly result: BooleanMatchEvaluation<unknown>;\n}[]): BooleanMatchEvaluation<R> {\n const children = fields.map((field, index) => resultChild(field.result, index, field.label));\n const mismatch = fields.find((field) => field.result.state === \"mismatched\");\n if (mismatch !== undefined) {\n return mismatched(diagnostic(\"all-of-mismatch\", `${name} had a definite mismatch`, {\n expected: \"all matcher fields matched\",\n children,\n }));\n }\n const missing = fields.find((field) => field.result.state === \"unavailable\");\n if (missing !== undefined) {\n const reason = (missing.result as Extract<BooleanMatchEvaluation<unknown>, {\n readonly state: \"unavailable\";\n }>).reason;\n return unavailable(reason, diagnostic(\"all-of-unavailable\", `${name} could not be decided from available evidence`, {\n expected: \"all matcher fields matched\",\n reason,\n children,\n }));\n }\n return matched(candidate as R, diagnostic(\"all-of-match\", `${name} matched all fields`, { children }));\n}\nasync function evaluateFields(fields: readonly {\n readonly label: string;\n readonly evaluate: () => Promise<BooleanMatchEvaluation<unknown>>;\n}[]): Promise<readonly {\n readonly label: string;\n readonly result: BooleanMatchEvaluation<unknown>;\n}[]> {\n const results: {\n label: string;\n result: BooleanMatchEvaluation<unknown>;\n }[] = [];\n let hasDefect = false;\n let firstDefect: unknown;\n // 不短路:组合的结构化诊断必须保留每个 child;defect 在所有可执行 child 完成后原样抛出。\n for (const field of fields) {\n try {\n results.push({ label: field.label, result: await field.evaluate() });\n }\n catch (error) {\n if (!hasDefect) {\n hasDefect = true;\n firstDefect = error;\n }\n }\n }\n if (hasDefect)\n throw firstDefect;\n return results;\n}\nfunction booleanCompositionName(operator: \"and\" | \"or\", matches: readonly {\n readonly name: string;\n}[]): string {\n return `${operator}(${matches.map((match) => match.name).join(\", \")})`;\n}\nfunction assertComposableMatches(first: unknown, rest: readonly unknown[], operator: \"and\" | \"or\"): {\n readonly domain: MatchDomain;\n readonly matches: readonly BooleanMatch<unknown, unknown, MatchDomain>[];\n} {\n if (rest.length === 0)\n throw new TypeError(`${operator}() requires at least two BooleanMatch values`);\n const firstInternal = assertBooleanMatch(first, `${operator}() first argument`);\n const matches: BooleanMatch<unknown, unknown, MatchDomain>[] = [\n first as BooleanMatch<unknown, unknown, MatchDomain>,\n ];\n for (const [index, match] of rest.entries()) {\n const internal = assertBooleanMatch(match, `${operator}() argument ${index + 2}`);\n if (internal.domain !== firstInternal.domain) {\n throw new TypeError(`${operator}() cannot combine ${firstInternal.domain}-domain and ${internal.domain}-domain matchers`);\n }\n matches.push(match as BooleanMatch<unknown, unknown, MatchDomain>);\n }\n return { domain: firstInternal.domain, matches };\n}\nexport function and<T, R extends T, D extends MatchDomain, const Rest extends readonly [\n BooleanMatch<NoInfer<T>, T, NoInfer<D>>,\n ...BooleanMatch<NoInfer<T>, T, NoInfer<D>>[]\n]>(first: BooleanMatch<T, R, D>, ...rest: Rest): BooleanMatchForDomain<T, T & R & RefinementIntersection<Rest>, D>;\nexport function and(first: BooleanMatch<unknown, unknown, MatchDomain>, ...rest: readonly BooleanMatch<unknown, unknown, MatchDomain>[]): BooleanMatch<unknown, unknown, MatchDomain> {\n const composition = assertComposableMatches(first, rest, \"and\");\n const name = booleanCompositionName(\"and\", composition.matches);\n return createBooleanMatch(composition.domain, name, async (candidate: unknown) => {\n const fields = await evaluateFields(composition.matches.map((match, index) => ({\n label: match.name || `matcher ${index}`,\n evaluate: () => evaluateBooleanMatch(match, candidate),\n })));\n return combineConjunction(candidate, name, fields);\n });\n}\nexport function or<T, R extends T, D extends MatchDomain, const Rest extends readonly [\n BooleanMatch<NoInfer<T>, T, NoInfer<D>>,\n ...BooleanMatch<NoInfer<T>, T, NoInfer<D>>[]\n]>(first: BooleanMatch<T, R, D>, ...rest: Rest): BooleanMatchForDomain<T, T & (R | RefinementOf<Rest[number]>), D>;\nexport function or(first: BooleanMatch<unknown, unknown, MatchDomain>, ...rest: readonly BooleanMatch<unknown, unknown, MatchDomain>[]): BooleanMatch<unknown, unknown, MatchDomain> {\n const composition = assertComposableMatches(first, rest, \"or\");\n const name = booleanCompositionName(\"or\", composition.matches);\n return createBooleanMatch(composition.domain, name, async (candidate: unknown) => {\n const fields = await evaluateFields(composition.matches.map((match, index) => ({\n label: match.name || `matcher ${index}`,\n evaluate: () => evaluateBooleanMatch(match, candidate),\n })));\n const children = fields.map((field, index) => resultChild(field.result, index, field.label));\n if (fields.some((field) => field.result.state === \"matched\")) {\n return matched(candidate, diagnostic(\"any-of-match\", `${name} matched at least one child`, { children }));\n }\n const missing = fields.find((field) => field.result.state === \"unavailable\");\n if (missing !== undefined) {\n const reason = (missing.result as Extract<BooleanMatchEvaluation<unknown>, {\n readonly state: \"unavailable\";\n }>).reason;\n return unavailable(reason, diagnostic(\"any-of-unavailable\", `${name} had no definite match and incomplete evidence`, {\n expected: \"at least one matcher matched\",\n reason,\n children,\n }));\n }\n return mismatched(diagnostic(\"any-of-mismatch\", `${name} had no matching child`, {\n expected: \"at least one matcher matched\",\n children,\n }));\n });\n}\nexport function not<T, R extends T>(match: BooleanMatch<T, R, \"value\">): BooleanMatch<T, T, \"value\"> {\n assertBooleanMatch(match, \"not() argument\", \"value\");\n return createBooleanMatch(\"value\", `not(${match.name})`, async (candidate) => {\n const result = await evaluateBooleanMatch(match, candidate);\n if (result.state === \"matched\") {\n return mismatched(diagnostic(\"not-mismatch\", `not(${match.name}) failed because its child matched`, {\n expected: `not ${match.name}`,\n children: [resultChild(result, 0, match.name)],\n }));\n }\n if (result.state === \"mismatched\") {\n return matched(candidate, diagnostic(\"not-match\", `not(${match.name}) matched`, {\n children: [resultChild(result, 0, match.name)],\n }));\n }\n return unavailable(result.reason, diagnostic(\"not-unavailable\", `not(${match.name}) could not decide its child`, {\n expected: `not ${match.name}`,\n reason: result.reason,\n children: [resultChild(result, 0, match.name)],\n }));\n });\n}\nexport interface TextMatchOptions {\n readonly stripComments?: boolean;\n}\nfunction normalizeTextOptions(value: unknown, label: string): Readonly<TextMatchOptions> {\n const options = assertPlainOptions(value, label, [\"stripComments\"]);\n if (options.stripComments !== undefined && typeof options.stripComments !== \"boolean\") {\n throw new TypeError(`${label}.stripComments must be a boolean`);\n }\n return Object.freeze(options as TextMatchOptions);\n}\nfunction textCandidate(value: unknown, options: TextMatchOptions): string | undefined {\n if (typeof value !== \"string\")\n return undefined;\n return options.stripComments === true ? stripComments(value) : value;\n}\n// @concord-code ne-eval-assertions-includes-match\n// @concord-implements docs/feature/assertions/library/value-assertions.md\n// @concord-implements docs/feature/eval/use-case/first-single-turn.md\nexport function includes(text: string, options?: TextMatchOptions): BooleanMatch<string, string> {\n assertNonEmptyString(text, \"includes() text\");\n const normalizedOptions = normalizeTextOptions(options, \"includes() options\");\n const name = `includes(${quoted(text)})`;\n return createBooleanMatch(\"value\", name, (value) => {\n const candidate = textCandidate(value, normalizedOptions);\n if (candidate === undefined) {\n return mismatched(diagnostic(\"text-candidate-type\", `${name} only accepts string candidates`, { expected: \"string\" }));\n }\n if (candidate.includes(text)) {\n return matched(value, diagnostic(\"text-includes-match\", `${name} found the literal text`, { expected: quoted(text) }));\n }\n return mismatched(diagnostic(\"text-includes-mismatch\", `${name} did not find the literal text`, { expected: quoted(text) }));\n });\n}\nexport function excludes(text: string, options?: TextMatchOptions): BooleanMatch<string, string> {\n assertNonEmptyString(text, \"excludes() text\");\n const normalizedOptions = normalizeTextOptions(options, \"excludes() options\");\n const name = `excludes(${quoted(text)})`;\n return createBooleanMatch(\"value\", name, (value) => {\n const candidate = textCandidate(value, normalizedOptions);\n if (candidate === undefined) {\n return mismatched(diagnostic(\"text-candidate-type\", `${name} only accepts string candidates`, { expected: \"string\" }));\n }\n if (!candidate.includes(text)) {\n return matched(value, diagnostic(\"text-excludes-match\", `${name} did not find the literal text`, { expected: quoted(text) }));\n }\n return mismatched(diagnostic(\"text-excludes-mismatch\", `${name} found excluded literal text`, { expected: quoted(text) }));\n });\n}\nexport function pattern(expression: RegExp, options?: TextMatchOptions): BooleanMatch<string, string> {\n if (!(expression instanceof RegExp))\n throw new TypeError(\"pattern() expression must be a RegExp\");\n const normalizedOptions = normalizeTextOptions(options, \"pattern() options\");\n const name = `pattern(${expression.toString()})`;\n return createBooleanMatch(\"value\", name, (value) => {\n const candidate = textCandidate(value, normalizedOptions);\n if (candidate === undefined) {\n return mismatched(diagnostic(\"text-candidate-type\", `${name} only accepts string candidates`, { expected: \"string\" }));\n }\n // 新 clone 的 lastIndex 从零开始,既满足 g/y 每次独立求值,也完全不修改作者实例。\n const isolatedExpression = new RegExp(expression.source, expression.flags);\n isolatedExpression.lastIndex = 0;\n if (isolatedExpression.test(candidate)) {\n return matched(value, diagnostic(\"pattern-match\", `${name} matched`, { expected: expression.toString() }));\n }\n return mismatched(diagnostic(\"pattern-mismatch\", `${name} did not match`, { expected: expression.toString() }));\n });\n}\n/** 归一化 Levenshtein similarity;它是连续分数,不携带默认阈值或 verdict 策略。 */\nexport function similarity(expected: string): ScoreMatch<string> {\n if (typeof expected !== \"string\")\n throw new TypeError(\"similarity() expected must be a string\");\n const name = `similarity(${quoted(expected)})`;\n return createScoreMatch(name, (value) => {\n if (typeof value !== \"string\")\n throw new TypeError(`${name} only accepts string candidates`);\n const maxLength = Math.max(value.length, expected.length);\n if (maxLength === 0)\n return 1;\n return 1 - levenshtein(value, expected) / maxLength;\n });\n}\nfunction levenshtein(a: string, b: string): number {\n if (a.length === 0)\n return b.length;\n if (b.length === 0)\n return a.length;\n let previous = Array.from({ length: b.length + 1 }, (_unused, index) => index);\n let current = new Array<number>(b.length + 1);\n for (let row = 1; row <= a.length; row += 1) {\n current[0] = row;\n for (let column = 1; column <= b.length; column += 1) {\n const substitution = a.charCodeAt(row - 1) === b.charCodeAt(column - 1) ? 0 : 1;\n current[column] = Math.min(previous[column]! + 1, current[column - 1]! + 1, previous[column - 1]! + substitution);\n }\n [previous, current] = [current, previous];\n }\n return previous[b.length]!;\n}\n/** 至少含 min 个去重 http(s) URL 的纯文本 matcher。 */\nexport function includesUrl(min = 1): BooleanMatch<string, string> {\n const name = `includesUrl(min=${min})`;\n return createBooleanMatch(\"value\", name, (value) => {\n if (typeof value !== \"string\") {\n return mismatched(diagnostic(\"text-candidate-type\", `${name} only accepts string candidates`, { expected: \"string\" }));\n }\n const urls = new Set(value.match(/https?:\\/\\/[^\\s<>()\"'\\x60]+/g) ?? []);\n if (urls.size >= min) {\n return matched(value, diagnostic(\"url-count-match\", `${name} found enough distinct URLs`, { expected: `>= ${min}` }));\n }\n return mismatched(diagnostic(\"url-count-mismatch\", `${name} did not find enough distinct URLs`, { expected: `>= ${min}` }));\n });\n}\n/** 至少含 min 个 Markdown heading 的纯文本 matcher。 */\nexport function hasSections(min = 2): BooleanMatch<string, string> {\n const name = `hasSections(min=${min})`;\n return createBooleanMatch(\"value\", name, (value) => {\n if (typeof value !== \"string\") {\n return mismatched(diagnostic(\"text-candidate-type\", `${name} only accepts string candidates`, { expected: \"string\" }));\n }\n const count = (value.match(/^#{1,6}\\s+\\S/gm) ?? []).length;\n if (count >= min) {\n return matched(value, diagnostic(\"heading-count-match\", `${name} found enough headings`, { expected: `>= ${min}` }));\n }\n return mismatched(diagnostic(\"heading-count-mismatch\", `${name} did not find enough headings`, { expected: `>= ${min}` }));\n });\n}\nfunction optionalLabel(label: string | undefined, factory: string): string {\n if (label !== undefined && typeof label !== \"string\")\n throw new TypeError(`${factory}() label must be a string`);\n return label === undefined || label.length === 0 ? `${factory}()` : `${factory}(${label})`;\n}\n/** 非 null / undefined 的 value matcher;泛型调用可保留原 candidate 的非空收窄。 */\nexport function isDefined(label?: string): BooleanMatch<unknown, {}>;\nexport function isDefined<T>(label?: string): BooleanMatch<T, Exclude<T, null | undefined>>;\nexport function isDefined<T = unknown>(label?: string): BooleanMatch<T, Exclude<T, null | undefined>> {\n const name = optionalLabel(label, \"isDefined\");\n return createBooleanMatch(\"value\", name, (value) => {\n if (value !== null && value !== undefined) {\n return matched(value as Exclude<T, null | undefined>, diagnostic(\"defined-match\", `${name} matched`, { expected: \"defined\" }));\n }\n return mismatched(diagnostic(\"defined-mismatch\", `${name} did not match`, { expected: \"defined\" }));\n });\n}\n/** value === true 的 refinement matcher。 */\nexport function isTrue<T = unknown>(label?: string): BooleanMatch<T, T & true> {\n const name = optionalLabel(label, \"isTrue\");\n return createBooleanMatch(\"value\", name, (value) => {\n if (value === true)\n return matched(value as T & true, diagnostic(\"true-match\", `${name} matched`, { expected: \"true\" }));\n return mismatched(diagnostic(\"true-mismatch\", `${name} did not match`, { expected: \"true\" }));\n });\n}\n/** value === false 的 refinement matcher。 */\nexport function isFalse<T = unknown>(label?: string): BooleanMatch<T, T & false> {\n const name = optionalLabel(label, \"isFalse\");\n return createBooleanMatch(\"value\", name, (value) => {\n if (value === false)\n return matched(value as T & false, diagnostic(\"false-match\", `${name} matched`, { expected: \"false\" }));\n return mismatched(diagnostic(\"false-mismatch\", `${name} did not match`, { expected: \"false\" }));\n });\n}\n/** CommandResult-like candidate 的 exitCode === 0 matcher;不读取 stdout / stderr。 */\nexport function commandSucceeded<T = unknown>(): BooleanMatch<T, T & {\n readonly exitCode: 0;\n}> {\n const name = \"commandSucceeded()\";\n return createBooleanMatch(\"value\", name, (value) => {\n if (value !== null && typeof value === \"object\" && (value as {\n readonly exitCode?: unknown;\n }).exitCode === 0) {\n return matched(value as T & {\n readonly exitCode: 0;\n }, diagnostic(\"command-succeeded\", `${name} matched`, { expected: \"exit 0\" }));\n }\n return mismatched(diagnostic(\"command-failed\", `${name} did not match`, { expected: \"exit 0\" }));\n });\n}\n/** 小而稳定的深相等:基本值、NaN、Array、Date 与 enumerable object properties。 */\nexport function deepEqual(a: unknown, b: unknown): boolean {\n return deepEqualInner(a, b, new Map<object, object>());\n}\nfunction deepEqualInner(a: unknown, b: unknown, seen: Map<object, object>): boolean {\n if (a === b)\n return true;\n if (typeof a === \"number\" && typeof b === \"number\" && Number.isNaN(a) && Number.isNaN(b))\n return true;\n if (a === null || b === null || typeof a !== \"object\" || typeof b !== \"object\")\n return false;\n if (a instanceof Date || b instanceof Date)\n return a instanceof Date && b instanceof Date && a.getTime() === b.getTime();\n const seenB = seen.get(a);\n if (seenB !== undefined)\n return seenB === b;\n seen.set(a, b);\n const aIsArray = Array.isArray(a);\n const bIsArray = Array.isArray(b);\n if (aIsArray !== bIsArray)\n return false;\n if (aIsArray && bIsArray) {\n if (a.length !== b.length)\n return false;\n for (let index = 0; index < a.length; index += 1) {\n if (!deepEqualInner(a[index], b[index], seen))\n return false;\n }\n return true;\n }\n const aObject = a as globalThis.Record<string, unknown>;\n const bObject = b as globalThis.Record<string, unknown>;\n const aKeys = Object.keys(aObject);\n const bKeys = Object.keys(bObject);\n if (aKeys.length !== bKeys.length)\n return false;\n for (const key of aKeys) {\n if (!Object.prototype.hasOwnProperty.call(bObject, key) || !deepEqualInner(aObject[key], bObject[key], seen)) {\n return false;\n }\n }\n return true;\n}\nexport function equals<const T>(expected: T): BooleanMatch<unknown, T> {\n const name = \"equals(value)\";\n return createBooleanMatch<unknown, T, \"value\">(\"value\", name, (candidate) => {\n if (deepEqual(candidate, expected))\n return matched(expected, diagnostic(\"equals-match\", `${name} matched`));\n return mismatched(diagnostic(\"equals-mismatch\", `${name} did not match`));\n });\n}\nfunction isStandardSchema(value: unknown): value is StandardSchema {\n if (!isRecord(value))\n return false;\n const standard = value[\"~standard\"];\n return isRecord(standard) && typeof standard.validate === \"function\";\n}\nfunction standardIssuePath(value: unknown, label: string): readonly MatchPathSegment[] {\n if (value === undefined)\n return [];\n if (!Array.isArray(value))\n throw new TypeError(`${label} returned a schema issue with an invalid path`);\n return value.map((segment) => {\n const key = isRecord(segment) && \"key\" in segment ? segment.key : segment;\n if (typeof key === \"string\" || typeof key === \"number\")\n return key;\n if (typeof key === \"symbol\")\n return String(key);\n throw new TypeError(`${label} returned a schema issue with an invalid path segment`);\n });\n}\nexport function matches<S extends StandardSchema>(schema: S): BooleanMatch<unknown, StandardSchema.InferInput<S>, \"value\"> {\n if (!isStandardSchema(schema))\n throw new TypeError(\"matches() schema must implement Standard Schema v1\");\n const name = \"matches(schema)\";\n return createBooleanMatch(\"value\", name, async (candidate) => {\n const result = await schema[\"~standard\"].validate(candidate);\n if (!isRecord(result))\n throw new TypeError(`${name} schema returned an invalid result`);\n if (result.issues === undefined) {\n // Standard Schema output (including transforms) is intentionally ignored: Match refines the original candidate.\n return matched(candidate as StandardSchema.InferInput<S>, diagnostic(\"schema-match\", `${name} validated the original candidate`));\n }\n if (!Array.isArray(result.issues))\n throw new TypeError(`${name} schema returned invalid issues`);\n const children = result.issues.map((issue, index) => {\n if (!isRecord(issue) || typeof issue.message !== \"string\") {\n throw new TypeError(`${name} schema returned an invalid issue`);\n }\n const path = standardIssuePath(issue.path, name);\n return Object.freeze({\n index,\n state: \"mismatched\" as const,\n diagnostic: diagnostic(\"schema-issue\", issue.message, { path }),\n });\n });\n return mismatched(diagnostic(\"schema-mismatch\", `${name} rejected the candidate`, {\n expected: \"Standard Schema validation success\",\n children,\n }));\n });\n}\n/**\n * 旧 context 接线还会调用这一个内部 helper。它不再接受 Zod-style fallback;新的公共 matches()\n * 使用上面的严格 Standard Schema 入口,异常则由 evaluator 作为 defect 处理。\n */\nexport async function validateSchema(value: unknown, schema: unknown): Promise<boolean> {\n if (!isStandardSchema(schema))\n return false;\n try {\n const result = await schema[\"~standard\"].validate(value);\n return isRecord(result) && result.issues === undefined;\n }\n catch {\n return false;\n }\n}\nexport function satisfies<T, R extends T>(label: string, predicate: (value: T) => value is R): BooleanMatch<T, R>;\nexport function satisfies<T>(label: string, predicate: (value: T) => boolean | Promise<boolean>): BooleanMatch<T, T>;\nexport function satisfies<T, R extends T = T>(label: string, predicate: (value: T) => boolean | Promise<boolean>): BooleanMatch<T, R> | BooleanMatch<T, T> {\n assertNonEmptyString(label, \"satisfies() label\");\n if (typeof predicate !== \"function\")\n throw new TypeError(\"satisfies() predicate must be a function\");\n return createBooleanMatch<T, R, \"value\">(\"value\", `satisfies(${label})`, async (candidate) => {\n const value = await predicate(candidate);\n if (typeof value !== \"boolean\")\n throw new TypeError(`matcher satisfies(${label}) returned a non-boolean result`);\n if (value)\n return matched(candidate as R, diagnostic(\"value-match\", `satisfies(${label}) matched`));\n return mismatched(diagnostic(\"value-mismatch\", `satisfies(${label}) did not match`));\n });\n}\nexport function defineValueMatch<T, R extends T>(spec: {\n readonly name: string;\n readonly evaluate: (value: T) => value is R;\n}): BooleanMatch<T, R>;\nexport function defineValueMatch<T>(spec: {\n readonly name: string;\n readonly evaluate: (value: T) => boolean | {\n readonly state: \"unavailable\";\n readonly reason: string;\n } | Promise<boolean | {\n readonly state: \"unavailable\";\n readonly reason: string;\n }>;\n}): BooleanMatch<T, T>;\n// @concord-code ne-eval-assertions-define-value-match\n// @concord-implements docs/feature/assertions/library/value-assertions.md\nexport function defineValueMatch<T, R extends T = T>(spec: {\n readonly name: string;\n readonly evaluate: (value: T) => boolean | {\n readonly state: \"unavailable\";\n readonly reason: string;\n } | Promise<boolean | {\n readonly state: \"unavailable\";\n readonly reason: string;\n }>;\n}): BooleanMatch<T, R> | BooleanMatch<T, T> {\n if (!isRecord(spec))\n throw new TypeError(\"defineValueMatch() spec must be an object\");\n assertNonEmptyString(spec.name, \"defineValueMatch() spec.name\");\n if (typeof spec.evaluate !== \"function\")\n throw new TypeError(\"defineValueMatch() spec.evaluate must be a function\");\n return createBooleanMatch<T, R, \"value\">(\"value\", spec.name, async (candidate) => {\n const value = await spec.evaluate(candidate);\n if (typeof value === \"object\" && value !== null && value.state === \"unavailable\" && typeof value.reason === \"string\" && value.reason.trim() !== \"\")\n return unavailable(value.reason, diagnostic(\"value-unavailable\", value.reason));\n if (typeof value !== \"boolean\")\n throw new TypeError(`matcher ${spec.name} returned a non-boolean result`);\n if (value)\n return matched(candidate as R, diagnostic(\"value-match\", `${spec.name} matched`));\n return mismatched(diagnostic(\"value-mismatch\", `${spec.name} did not match`));\n });\n}\nexport function defineScoreMatch<T, E = ScoreMatchLlmFailure>(spec: ManagedScoreMatchOptions<T, E>): ScoreMatch<T>;\nexport function defineScoreMatch<T>(spec: {\n readonly name: string;\n readonly score: (value: T) => number | Promise<number>;\n}): ScoreMatch<T>;\nexport function defineScoreMatch<T, E = ScoreMatchLlmFailure>(spec: ManagedScoreMatchOptions<T, E> | {\n readonly name: string;\n readonly score: (value: T) => number | Promise<number>;\n}): ScoreMatch<T> {\n const input = exactScoreMatchOptions(spec);\n assertNonEmptyString(input.name, \"defineScoreMatch() spec.name\");\n if (typeof input.score !== \"function\")\n throw new TypeError(\"defineScoreMatch() spec.score must be a function\");\n const managed = Object.hasOwn(input, \"llm\");\n const match = createScoreMatch<T>(input.name, async (candidate) => {\n if (managed)\n throw new TypeError(\"managed ScoreMatch must be evaluated by the Assertion runtime\");\n const score = await (input.score as (value: T) => number | Promise<number>)(candidate);\n if (typeof score !== \"number\" || !Number.isFinite(score) || score < 0 || score > 1) {\n throw new TypeError(`matcher ${input.name} returned a score outside finite [0, 1]`);\n }\n return score;\n });\n if (managed) {\n assertNonEmptyString(input.version, \"defineScoreMatch() spec.version\");\n if (!Object.hasOwn(input, \"config\"))\n throw new TypeError(\"defineScoreMatch() managed spec requires config\");\n const config = snapshotScoreMatchJson(input.config, \"defineScoreMatch() spec.config\");\n const llm = exactLlmOptions(input.llm);\n const definition: ManagedScoreMatchDefinition<unknown, unknown> = Object.freeze({\n name: input.name,\n version: input.version,\n config,\n canonicalConfig: canonicalScoreMatchJson(config),\n llm,\n score: input.score as ManagedScoreMatchDefinition<unknown, unknown>[\"score\"],\n });\n managedScoreMatches.set(match, definition);\n }\n return match;\n}\nfunction exactScoreMatchOptions(value: unknown): Readonly<Record<string, unknown>> {\n if (!isRecord(value) || Array.isArray(value))\n throw new TypeError(\"defineScoreMatch() spec must be an object\");\n const managed = Object.hasOwn(value, \"llm\") || Object.hasOwn(value, \"version\") || Object.hasOwn(value, \"config\");\n const allowed = managed ? [\"name\", \"version\", \"config\", \"llm\", \"score\"] : [\"name\", \"score\"];\n const output: Record<string, unknown> = {};\n for (const key of Reflect.ownKeys(value)) {\n if (typeof key !== \"string\" || !allowed.includes(key)) {\n throw new TypeError(`defineScoreMatch() spec has unknown option ${String(key)}`);\n }\n const descriptor = Reflect.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !descriptor.enumerable || !(\"value\" in descriptor)) {\n throw new TypeError(`defineScoreMatch() spec.${key} must be an enumerable data property`);\n }\n output[key] = descriptor.value;\n }\n if (!Object.hasOwn(output, \"name\") || !Object.hasOwn(output, \"score\")) {\n throw new TypeError(\"defineScoreMatch() spec requires name and score\");\n }\n if (managed && (!Object.hasOwn(output, \"version\") || !Object.hasOwn(output, \"config\") || !Object.hasOwn(output, \"llm\"))) {\n throw new TypeError(\"defineScoreMatch() managed spec requires version, config, and llm\");\n }\n return Object.freeze(output);\n}\nfunction boundedPositiveInteger(value: unknown, fallback: number, maximum: number, label: string): number {\n const resolved = value ?? fallback;\n if (typeof resolved !== \"number\" || !Number.isSafeInteger(resolved) || resolved <= 0 || resolved > maximum) {\n throw new TypeError(`${label} must be a positive integer at most ${maximum}`);\n }\n return resolved;\n}\n/** @internal Shared managed-model budget validation. */\nexport function exactLlmOptions(value: unknown): ManagedScoreMatchDefinition[\"llm\"] {\n if (!isRecord(value) || Array.isArray(value))\n throw new TypeError(\"defineScoreMatch() spec.llm must be an object\");\n const allowed = [\"maxCalls\", \"maxMaterialBytes\", \"maxAuditBytes\"];\n const output: Record<string, unknown> = {};\n for (const key of Reflect.ownKeys(value)) {\n if (typeof key !== \"string\" || !allowed.includes(key))\n throw new TypeError(`defineScoreMatch() spec.llm has unknown option ${String(key)}`);\n const descriptor = Reflect.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !descriptor.enumerable || !(\"value\" in descriptor))\n throw new TypeError(`defineScoreMatch() spec.llm.${key} must be an enumerable data property`);\n output[key] = descriptor.value;\n }\n return Object.freeze({\n maxCalls: boundedPositiveInteger(output.maxCalls, 4, 16, \"defineScoreMatch() spec.llm.maxCalls\"),\n maxMaterialBytes: boundedPositiveInteger(output.maxMaterialBytes, 32 * 1024, 4 * 1024 * 1024, \"defineScoreMatch() spec.llm.maxMaterialBytes\"),\n maxAuditBytes: boundedPositiveInteger(output.maxAuditBytes, 96 * 1024, 8 * 1024 * 1024, \"defineScoreMatch() spec.llm.maxAuditBytes\"),\n });\n}\nfunction snapshotScoreMatchJson(value: unknown, label: string, state: {\n nodes: number;\n} = { nodes: 0 }, ancestors = new WeakSet<object>(), depth = 0): JsonValue {\n state.nodes += 1;\n if (state.nodes > 16384)\n throw new TypeError(`${label} exceeds 16,384 JSON nodes`);\n if (depth > 32)\n throw new TypeError(`${label} exceeds depth 32`);\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\")\n return value;\n if (typeof value === \"number\") {\n if (!Number.isFinite(value))\n throw new TypeError(`${label} numbers must be finite`);\n return Object.is(value, -0) ? 0 : value;\n }\n if (typeof value !== \"object\" || value === null)\n throw new TypeError(`${label} must contain only JSON values`);\n if (ancestors.has(value))\n throw new TypeError(`${label} cannot contain cycles`);\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n const keys = Reflect.ownKeys(value);\n if (keys.some((key) => key !== \"length\" && !(typeof key === \"string\" && /^(?:0|[1-9][0-9]*)$/u.test(key) && Number(key) < value.length))) {\n throw new TypeError(`${label} arrays cannot contain custom properties`);\n }\n const output: JsonValue[] = [];\n for (let index = 0; index < value.length; index += 1) {\n const descriptor = Reflect.getOwnPropertyDescriptor(value, String(index));\n if (descriptor === undefined || !(\"value\" in descriptor) || descriptor.value === undefined)\n throw new TypeError(`${label} arrays cannot contain holes, accessors, or undefined`);\n output.push(snapshotScoreMatchJson(descriptor.value, `${label}[${index}]`, state, ancestors, depth + 1));\n }\n return Object.freeze(output) as unknown as JsonValue;\n }\n const prototype = Reflect.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null)\n throw new TypeError(`${label} objects must be plain objects`);\n const entries: Array<readonly [\n string,\n JsonValue\n ]> = [];\n for (const key of Reflect.ownKeys(value)) {\n if (typeof key !== \"string\")\n throw new TypeError(`${label} cannot contain symbol keys`);\n const descriptor = Reflect.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !descriptor.enumerable)\n continue;\n if (!(\"value\" in descriptor) || descriptor.value === undefined)\n throw new TypeError(`${label}.${key} must be a JSON data property`);\n entries.push([key, snapshotScoreMatchJson(descriptor.value, `${label}.${key}`, state, ancestors, depth + 1)]);\n }\n return Object.freeze(Object.fromEntries(entries.sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0))) as JsonValue;\n }\n finally {\n ancestors.delete(value);\n }\n}\nfunction canonicalScoreMatchJson(value: JsonValue): string {\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\" || typeof value === \"number\")\n return JSON.stringify(value);\n if (Array.isArray(value))\n return `[${value.map(canonicalScoreMatchJson).join(\",\")}]`;\n return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonicalScoreMatchJson(value[key]!)}`).join(\",\")}}`;\n}\ninterface ReferencePathPattern {\n readonly original: string;\n readonly components: readonly string[];\n readonly matcher: RegExp;\n}\nfunction escapeRegExp(value: string): string {\n return value.replace(/[\\\\^$.*+?()[\\]{}|]/g, \"\\\\$&\");\n}\nfunction normalizeReferencePath(value: unknown, label: string): readonly string[] {\n assertNonEmptyString(value, label);\n const components = value.split(/[\\\\/]+/u).filter((component) => component.length > 0 && component !== \".\");\n if (components.length === 0)\n throw new TypeError(`${label} normalizes to an empty path`);\n return Object.freeze(components);\n}\nfunction pathPattern(components: readonly string[]): RegExp {\n // Whitespace / quoting can bound a path embedded in a tool input, while '-' and '.' stay in a component so\n // `agents` cannot match `agents-old` and `.niceeval` cannot match `.niceevaluation`.\n const componentChar = \"\\\\p{L}\\\\p{N}_.-\";\n const betweenComponents = \"[\\\\\\\\/]+(?:\\\\.[\\\\\\\\/]+)*\";\n const source = components.map(escapeRegExp).join(betweenComponents);\n return new RegExp(`(?<![${componentChar}])${source}(?![${componentChar}])`, \"u\");\n}\nfunction normalizeReferencePatterns(paths: readonly [\n string,\n ...string[]\n]): readonly ReferencePathPattern[] {\n if (!Array.isArray(paths) || paths.length === 0)\n throw new TypeError(\"referencesAnyPath() requires at least one path\");\n const seen = new Set<string>();\n const patterns = paths.map((path, index) => {\n const components = normalizeReferencePath(path, `referencesAnyPath() paths[${index}]`);\n const identity = components.join(\"\\u0000\");\n if (seen.has(identity))\n throw new TypeError(`referencesAnyPath() has duplicate normalized path ${quoted(path)}`);\n seen.add(identity);\n return Object.freeze({ original: path, components, matcher: pathPattern(components) });\n });\n return Object.freeze(patterns);\n}\ninterface PathWitness {\n readonly pointer: string;\n readonly pattern: ReferencePathPattern;\n}\nfunction jsonPointerSegment(value: string | number): string {\n return String(value).replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\nfunction isPlainJsonObject(value: object): value is globalThis.Record<string, unknown> {\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\nfunction isArrayIndexKey(key: string, length: number): boolean {\n if (!/^(?:0|[1-9][0-9]*)$/u.test(key))\n return false;\n const index = Number(key);\n return Number.isSafeInteger(index) && index >= 0 && index < length;\n}\nfunction findReferencedPath(value: unknown, patterns: readonly ReferencePathPattern[], pointer = \"\", ancestors = new WeakSet<object>()): PathWitness | undefined {\n if (typeof value === \"string\") {\n const pattern = patterns.find((candidate) => {\n candidate.matcher.lastIndex = 0;\n return candidate.matcher.test(value);\n });\n return pattern === undefined ? undefined : { pointer, pattern };\n }\n if (value === null || typeof value === \"boolean\")\n return undefined;\n if (typeof value === \"number\") {\n if (!Number.isFinite(value))\n throw new TypeError(\"referencesAnyPath() received a non-JSON number\");\n return undefined;\n }\n if (typeof value !== \"object\")\n throw new TypeError(\"referencesAnyPath() received a non-JSON value\");\n if (ancestors.has(value))\n throw new TypeError(\"referencesAnyPath() received a cyclic JSON value\");\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n for (const key of Object.keys(value)) {\n if (!isArrayIndexKey(key, value.length)) {\n throw new TypeError(\"referencesAnyPath() received a non-JSON array property\");\n }\n }\n for (let index = 0; index < value.length; index += 1) {\n const descriptor = Object.getOwnPropertyDescriptor(value, String(index));\n if (descriptor === undefined || !(\"value\" in descriptor)) {\n throw new TypeError(\"referencesAnyPath() received a sparse array or accessor\");\n }\n const witness = findReferencedPath(descriptor.value, patterns, `${pointer}/${index}`, ancestors);\n if (witness !== undefined)\n return witness;\n }\n return undefined;\n }\n if (!isPlainJsonObject(value))\n throw new TypeError(\"referencesAnyPath() received a non-plain JSON object\");\n for (const key of Object.keys(value)) {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !(\"value\" in descriptor)) {\n throw new TypeError(\"referencesAnyPath() received an accessor property\");\n }\n const witness = findReferencedPath(descriptor.value, patterns, `${pointer}/${jsonPointerSegment(key)}`, ancestors);\n if (witness !== undefined)\n return witness;\n }\n return undefined;\n }\n finally {\n ancestors.delete(value);\n }\n}\nexport function referencesAnyPath(paths: readonly [\n string,\n ...string[]\n]): BooleanMatch<JsonValue, JsonValue, \"value\"> {\n const patterns = normalizeReferencePatterns(paths);\n const name = `referencesAnyPath(${patterns.length} paths)`;\n return createBooleanMatch(\"value\", name, (candidate) => {\n const witness = findReferencedPath(candidate, patterns);\n if (witness !== undefined) {\n return matched(candidate, diagnostic(\"path-reference-match\", `${name} found a referenced path`, {\n expected: witness.pattern.components.join(\"/\"),\n locator: { kind: \"json-pointer\", pointer: witness.pointer },\n }));\n }\n return mismatched(diagnostic(\"path-reference-mismatch\", `${name} found no referenced path`, {\n expected: patterns.map((pattern) => pattern.components.join(\"/\")).join(\" | \"),\n }));\n }, { positiveWitness: true });\n}\nexport type ToolStatus = Extract<LogicalToolOccurrence[\"lifecycle\"], {\n readonly state: \"available\";\n}>[\"status\"];\nexport interface CommandMatchOptions {\n readonly argsStart?: readonly string[];\n readonly excludes?: readonly string[];\n readonly status?: ToolStatus;\n}\nexport interface ToolMatchOptions {\n readonly input?: BooleanMatch<JsonValue, JsonValue, \"value\">;\n readonly output?: BooleanMatch<JsonValue, JsonValue, \"value\">;\n readonly status?: ToolStatus;\n}\n/**\n * Turns the recursive JsonMatch language into a managed value Match. Raw\n * JsonMatch stays at this explicit bridge; tool assertions consume only the\n * branded Match so every tool field follows the same evaluator path.\n */\nexport function jsonMatch(expected: JsonMatch): BooleanMatch<JsonValue, JsonValue, \"value\"> {\n const normalized = normalizeJsonMatch(expected, \"jsonMatch() expected\");\n const name = \"jsonMatch(...)\";\n return createBooleanMatch(\"value\", name, (candidate) => {\n if (matchesJson(candidate, normalized)) {\n return matched(candidate, diagnostic(\"json-match\", `${name} matched`));\n }\n return mismatched(diagnostic(\"json-mismatch\", `${name} did not match`, {\n expected: \"the supplied JsonMatch pattern\",\n received: \"the candidate JSON value\",\n }));\n });\n}\nfunction normalizeJsonMatch(value: unknown, label: string, active = new WeakSet<object>()): JsonMatch {\n if (value === null || typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n if (typeof value === \"number\" && !Number.isFinite(value)) {\n throw new TypeError(`${label} must not contain a non-finite number`);\n }\n return value;\n }\n if (value instanceof RegExp)\n return new RegExp(value.source, value.flags);\n if (typeof value === \"function\")\n return value as (candidate: unknown) => boolean;\n if (typeof value !== \"object\")\n throw new TypeError(`${label} must be a JsonMatch value`);\n if (active.has(value))\n throw new TypeError(`${label} must not be cyclic`);\n active.add(value);\n try {\n if (Array.isArray(value)) {\n return Object.freeze(value.map((item, index) => normalizeJsonMatch(item, `${label}[${index}]`, active)));\n }\n if (!isPlainJsonObject(value))\n throw new TypeError(`${label} must use a plain object`);\n const entries: [\n string,\n JsonMatch\n ][] = [];\n for (const key of Object.keys(value)) {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !(\"value\" in descriptor)) {\n throw new TypeError(`${label}.${key} must not be an accessor`);\n }\n entries.push([key, normalizeJsonMatch(descriptor.value, `${label}.${key}`, active)]);\n }\n return Object.freeze(Object.fromEntries(entries));\n }\n finally {\n active.delete(value);\n }\n}\nfunction normalizeStatus(value: unknown, label: string): ToolStatus | undefined {\n if (value === undefined)\n return undefined;\n if (value === \"pending\" || value === \"completed\" || value === \"failed\" || value === \"rejected\")\n return value;\n throw new TypeError(`${label} must be pending, completed, failed, or rejected`);\n}\nfunction normalizeTokens(value: unknown, label: string, unique: boolean): readonly string[] | undefined {\n if (value === undefined)\n return undefined;\n if (!Array.isArray(value))\n throw new TypeError(`${label} must be an array of command tokens`);\n const tokens = value.map((token, index) => {\n assertNonEmptyString(token, `${label}[${index}]`);\n return token;\n });\n if (unique && new Set(tokens).size !== tokens.length)\n throw new TypeError(`${label} must not contain duplicate tokens`);\n return Object.freeze(tokens);\n}\nfunction lifecycleResult(occurrence: LogicalToolOccurrence, expected: ToolStatus | undefined): BooleanMatchEvaluation<unknown> {\n const lifecycle = occurrence.lifecycle;\n if (!isRecord(lifecycle) || (lifecycle.state !== \"available\" && lifecycle.state !== \"opaque\")) {\n throw new TypeError(\"tool occurrence has an invalid lifecycle envelope\");\n }\n if (lifecycle.state === \"opaque\") {\n if (typeof lifecycle.reason !== \"string\" || lifecycle.reason.length === 0) {\n throw new TypeError(\"tool occurrence has an opaque lifecycle without a reason\");\n }\n return unavailable(lifecycle.reason, diagnostic(\"tool-lifecycle-unavailable\", \"tool lifecycle is not fully observed\", {\n expected,\n reason: lifecycle.reason,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n if (expected === undefined) {\n return matched(occurrence, diagnostic(\"lifecycle-unrestricted\", \"lifecycle is unrestricted\", {\n received: lifecycle.status,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n if (lifecycle.status !== expected) {\n return mismatched(diagnostic(\"tool-status-mismatch\", \"tool lifecycle status did not match\", {\n expected,\n received: typeof lifecycle.status === \"string\" ? lifecycle.status : undefined,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n return matched(occurrence, diagnostic(\"tool-status-match\", \"tool lifecycle status matched\", {\n expected,\n received: lifecycle.status,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n}\nfunction occurrenceNameResult(occurrence: LogicalToolOccurrence, expected: string): BooleanMatchEvaluation<unknown> {\n if (!isRecord(occurrence.name) || typeof occurrence.name.original !== \"string\") {\n throw new TypeError(\"tool occurrence has an invalid name envelope\");\n }\n // `unknown` means the adapter could not map this domain-specific tool onto\n // NiceEval's canonical vocabulary. It must not hide the original name that\n // the author can still check exactly.\n const observed = occurrence.name.canonical === undefined || occurrence.name.canonical === \"unknown\"\n ? occurrence.name.original\n : occurrence.name.canonical;\n if (observed !== expected) {\n return mismatched(diagnostic(\"tool-name-mismatch\", \"tool name did not match\", {\n expected: quoted(expected),\n received: quoted(observed),\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n return matched(occurrence, diagnostic(\"tool-name-match\", \"tool name matched exactly\", {\n expected: quoted(expected),\n received: quoted(observed),\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n}\nasync function toolEvidenceResult(occurrence: LogicalToolOccurrence, field: \"input\" | \"output\", match: BooleanMatch<JsonValue, JsonValue, \"value\">): Promise<BooleanMatchEvaluation<unknown>> {\n const evidence = occurrence[field];\n if (!isRecord(evidence) || (evidence.state !== \"complete\" && evidence.state !== \"partial\" && evidence.state !== \"unavailable\")) {\n throw new TypeError(`tool occurrence has an invalid ${field} envelope`);\n }\n if (evidence.state === \"unavailable\") {\n if (typeof evidence.reason !== \"string\" || evidence.reason.length === 0) {\n throw new TypeError(`tool occurrence has unavailable ${field} without a reason`);\n }\n return unavailable(evidence.reason, diagnostic(`tool-${field}-unavailable`, `tool ${field} is unavailable`, {\n reason: evidence.reason,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n const result = await evaluateBooleanMatch(match, evidence.value);\n const base = result.diagnostic;\n const observedResult = Object.freeze({\n ...result,\n diagnostic: diagnostic(base?.code ?? `tool-${field}-${result.state}`, base?.message ?? `tool ${field} ${result.state}`, {\n path: base?.path,\n expected: base?.expected ?? match.name,\n received: jsonPreview(evidence.value),\n reason: base?.reason,\n locator: base?.locator ?? { kind: \"tool-occurrence\", id: occurrence.id },\n children: base?.children,\n truncation: base?.truncation,\n }),\n }) as BooleanMatchEvaluation<unknown>;\n if (evidence.state === \"complete\")\n return observedResult;\n // partial input can only produce a positive result when the matcher itself carries the narrowed witness\n // capability. A visible reference hit survives hidden leaves; general predicates / schema checks do not.\n if (result.state === \"matched\" && hasPositiveWitnessCapability(match as BooleanMatch<unknown, unknown, \"value\">)) {\n return observedResult;\n }\n return unavailable(`tool-${field}-coverage-partial`, diagnostic(`tool-${field}-coverage-partial`, `tool ${field} is partial without a decisive positive witness`, {\n reason: `tool-${field}-coverage-partial`,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n ...(Array.isArray(evidence.opaquePointers) ? { received: evidence.opaquePointers.join(\",\") } : {}),\n }));\n}\nexport function toolMatch(name: string, options?: ToolMatchOptions): ToolMatch;\nexport function toolMatch(options: ToolMatchOptions | Record<string, never>): ToolMatch;\nexport function toolMatch(nameOrOptions: string | ToolMatchOptions, options?: ToolMatchOptions): ToolMatch {\n let expectedName: string | undefined;\n let input: BooleanMatch<JsonValue, JsonValue, \"value\"> | undefined;\n let output: BooleanMatch<JsonValue, JsonValue, \"value\"> | undefined;\n let status: ToolStatus | undefined;\n if (typeof nameOrOptions === \"string\") {\n assertNonEmptyString(nameOrOptions, \"toolMatch() name\");\n expectedName = nameOrOptions;\n const normalized = assertPlainOptions(options, \"toolMatch() options\", [\"input\", \"output\", \"status\"]);\n if (normalized.input !== undefined) {\n assertBooleanMatch(normalized.input, \"toolMatch() options.input\", \"value\");\n input = normalized.input as BooleanMatch<JsonValue, JsonValue, \"value\">;\n }\n if (normalized.output !== undefined) {\n assertBooleanMatch(normalized.output, \"toolMatch() options.output\", \"value\");\n output = normalized.output as BooleanMatch<JsonValue, JsonValue, \"value\">;\n }\n status = normalizeStatus(normalized.status, \"toolMatch() options.status\");\n }\n else {\n if (options !== undefined)\n throw new TypeError(\"toolMatch(options) does not accept a second argument\");\n const normalized = assertPlainOptions(nameOrOptions, \"toolMatch() options\", [\"input\", \"output\", \"status\"]);\n if (normalized.input !== undefined) {\n assertBooleanMatch(normalized.input, \"toolMatch() options.input\", \"value\");\n input = normalized.input as BooleanMatch<JsonValue, JsonValue, \"value\">;\n }\n if (normalized.output !== undefined) {\n assertBooleanMatch(normalized.output, \"toolMatch() options.output\", \"value\");\n output = normalized.output as BooleanMatch<JsonValue, JsonValue, \"value\">;\n }\n status = normalizeStatus(normalized.status, \"toolMatch() options.status\");\n }\n const unconstrained = expectedName === undefined\n && input === undefined\n && output === undefined\n && status === undefined;\n const name = expectedName === undefined\n ? unconstrained\n ? \"toolMatch({})\"\n : `toolMatch(${[\n input === undefined ? undefined : `input=${input.name}`,\n output === undefined ? undefined : `output=${output.name}`,\n status === undefined ? undefined : `status=${status}`,\n ].filter((part): part is string => part !== undefined).join(\", \")})`\n : `toolMatch(${quoted(expectedName)})`;\n if (unconstrained) {\n return createBooleanMatch(\"tool\", name, (occurrence) => matched(occurrence));\n }\n return createBooleanMatch(\"tool\", name, async (occurrence) => {\n const fields = await evaluateFields([\n ...(expectedName === undefined\n ? []\n : [{ label: \"name\", evaluate: async () => occurrenceNameResult(occurrence, expectedName!) }]),\n ...(input === undefined ? [] : [{ label: \"input\", evaluate: () => toolEvidenceResult(occurrence, \"input\", input!) }]),\n ...(output === undefined ? [] : [{ label: \"output\", evaluate: () => toolEvidenceResult(occurrence, \"output\", output!) }]),\n { label: \"status\", evaluate: async () => lifecycleResult(occurrence, status) },\n ]);\n return combineConjunction(occurrence, name, fields);\n });\n}\n/** @internal Assert-first accepts only branded tool-domain matches. */\nexport function assertManagedToolMatch(value: unknown, label = \"match\"): ToolMatch {\n assertBooleanMatch(value, label, \"tool\");\n return value as ToolMatch;\n}\n/** @internal Nominal guard for a managed tool-domain item predicate. */\nexport function isManagedToolMatch(value: unknown): value is ToolMatch {\n if (!isRecord(value) || !matchBrands.has(value))\n return false;\n return value.domain === \"tool\" && value.kind === \"boolean\";\n}\n/** @internal Assert-first accepts only branded event-domain matches. */\nexport function assertManagedEventMatch(value: unknown, label = \"match\"): EventMatch {\n assertBooleanMatch(value, label, \"event\");\n return value as EventMatch;\n}\n/** @internal Nominal guard for a managed event-domain item predicate. */\nexport function isManagedEventMatch(value: unknown): value is EventMatch {\n if (!isRecord(value) || !matchBrands.has(value))\n return false;\n return value.domain === \"event\" && value.kind === \"boolean\";\n}\nexport type ToolMatchQuantifier = {\n readonly kind: \"at-least\";\n readonly count: number;\n} | {\n readonly kind: \"less-than\";\n readonly count: number;\n} | {\n readonly kind: \"at-most\";\n readonly count: number;\n} | {\n readonly kind: \"greater-than\";\n readonly count: number;\n} | {\n readonly kind: \"exact\";\n readonly count: number;\n} | {\n readonly kind: \"absent\";\n};\nfunction commandResult(occurrence: LogicalToolOccurrence, executable: string, argsStart: readonly string[] | undefined, excludes: readonly string[] | undefined): BooleanMatchEvaluation<unknown> {\n const projection = occurrence.command;\n if (projection === undefined) {\n return unavailable(\"logical-command-unavailable\", diagnostic(\"logical-command-unavailable\", \"tool occurrence has no durable command projection\", {\n reason: \"logical-command-unavailable\",\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n if (!isRecord(projection) || (projection.kind !== \"command\" && projection.kind !== \"not-command\")) {\n throw new TypeError(\"tool occurrence has an invalid command projection\");\n }\n if (projection.kind === \"not-command\") {\n return mismatched(diagnostic(\"not-command\", \"tool occurrence is not a command\", {\n expected: quoted(executable),\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n const logical = projection.logical;\n if (!isRecord(logical) || (logical.state !== \"available\" && logical.state !== \"opaque\")) {\n throw new TypeError(\"command projection has an invalid logical envelope\");\n }\n if (logical.normalizer !== \"logical-command/v1\") {\n throw new TypeError(\"command projection does not use logical-command/v1\");\n }\n if (logical.state === \"opaque\") {\n if (typeof logical.reason !== \"string\" || logical.reason.length === 0) {\n throw new TypeError(\"opaque logical command has no reason\");\n }\n return unavailable(`logical-command-opaque:${logical.reason}`, diagnostic(\"logical-command-opaque\", \"logical command is opaque\", {\n reason: logical.reason,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n if (typeof logical.executable !== \"string\" || !Array.isArray(logical.args) || !logical.args.every((arg) => typeof arg === \"string\")) {\n throw new TypeError(\"available logical command has an invalid argv envelope\");\n }\n if (logical.executable !== executable) {\n return mismatched(diagnostic(\"logical-executable-mismatch\", \"logical executable did not match exactly\", {\n expected: quoted(executable),\n received: quoted(logical.executable),\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n if (argsStart !== undefined && !argsStart.every((token, index) => logical.args[index] === token)) {\n return mismatched(diagnostic(\"logical-args-prefix-mismatch\", \"logical argv did not start with the expected exact tokens\", {\n expected: argsStart.map(quoted).join(\" \"),\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n if (excludes !== undefined && excludes.some((token) => logical.args.includes(token))) {\n return mismatched(diagnostic(\"logical-args-excluded-token\", \"logical argv contained an excluded exact token\", {\n expected: `without ${excludes.map(quoted).join(\", \")}`,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n return matched(occurrence, diagnostic(\"logical-command-match\", \"logical command matched exact executable and token rules\", {\n expected: quoted(executable),\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n}\nexport function commandMatch(executable: string, options?: CommandMatchOptions): ToolMatch<LogicalCommandOccurrence> {\n assertNonEmptyString(executable, \"commandMatch() executable\");\n const normalized = assertPlainOptions(options, \"commandMatch() options\", [\"argsStart\", \"excludes\", \"status\"]);\n const argsStart = normalizeTokens(normalized.argsStart, \"commandMatch() options.argsStart\", false);\n const excludes = normalizeTokens(normalized.excludes, \"commandMatch() options.excludes\", true);\n const status = normalizeStatus(normalized.status, \"commandMatch() options.status\");\n const details = [\n argsStart === undefined ? undefined : `argsStart=[${argsStart.map(quoted).join(\", \")}]`,\n excludes === undefined ? undefined : `excludes=[${excludes.map(quoted).join(\", \")}]`,\n status === undefined ? undefined : `status=${status}`,\n ]\n .filter((detail): detail is string => detail !== undefined)\n .join(\", \");\n const name = `commandMatch(${quoted(executable)}${details.length === 0 ? \"\" : `, ${details}`})`;\n return createBooleanMatch(\"tool\", name, async (occurrence) => {\n const fields = await evaluateFields([\n { label: \"command\", evaluate: async () => commandResult(occurrence, executable, argsStart, excludes) },\n { label: \"status\", evaluate: async () => lifecycleResult(occurrence, status) },\n ]);\n return combineConjunction<LogicalToolOccurrence, LogicalCommandOccurrence>(occurrence, name, fields);\n });\n}\nexport interface EventOptionsByType {\n readonly message: {\n readonly role?: \"assistant\" | \"user\";\n readonly text?: BooleanMatch<string, string, \"value\">;\n };\n readonly \"operation.started\": {\n readonly tool?: ToolMatch;\n };\n readonly \"operation.finished\": {\n readonly tool?: ToolMatch;\n };\n}\ntype MatchableEventType = keyof EventOptionsByType;\nfunction isMatchableEventType(value: unknown): value is MatchableEventType {\n return value === \"message\" || value === \"operation.started\" || value === \"operation.finished\";\n}\nfunction messageEventResult(event: Extract<EventOccurrenceView, {\n readonly type: \"message\";\n}>, role: \"assistant\" | \"user\" | undefined, text: BooleanMatch<string, string, \"value\"> | undefined): Promise<BooleanMatchEvaluation<unknown>> {\n return evaluateFields([\n ...(role === undefined\n ? []\n : [\n {\n label: \"role\",\n evaluate: async () => event.role === role\n ? matched(event, diagnostic(\"message-role-match\", \"message role matched\", { expected: role }))\n : mismatched(diagnostic(\"message-role-mismatch\", \"message role did not match\", {\n expected: role,\n received: event.role,\n })),\n },\n ]),\n ...(text === undefined\n ? []\n : [{ label: \"text\", evaluate: () => evaluateBooleanMatch(text, event.text) }]),\n ]).then((fields) => combineConjunction(event, \"eventMatch(message)\", fields));\n}\nasync function toolEventResult(event: EventOccurrenceView, match: ToolMatch | undefined): Promise<BooleanMatchEvaluation<unknown>> {\n if (match === undefined)\n return matched(event, diagnostic(\"event-type-match\", \"event type matched\"));\n const occurrence = assertionEventOccurrence(event);\n if (occurrence === undefined) {\n return unavailable(\"event-tool-occurrence-unavailable\", diagnostic(\"event-tool-occurrence-unavailable\", \"operation event has no associated logical tool occurrence\", {\n reason: \"event-tool-occurrence-unavailable\",\n }));\n }\n return evaluateBooleanMatch(match, occurrence);\n}\nexport function eventMatch<K extends keyof EventOptionsByType>(type: K, options?: EventOptionsByType[K]): EventMatch<Extract<EventOccurrenceView, {\n readonly type: K;\n}>> {\n if (!isMatchableEventType(type))\n throw new TypeError(\"eventMatch() type is not supported\");\n if (type === \"message\") {\n const normalized = assertPlainOptions(options, \"eventMatch(message) options\", [\"role\", \"text\"]);\n const role = normalized.role;\n if (role !== undefined && role !== \"assistant\" && role !== \"user\") {\n throw new TypeError(\"eventMatch(message) options.role must be assistant or user\");\n }\n const text = normalized.text;\n if (text !== undefined)\n assertBooleanMatch(text, \"eventMatch(message) options.text\", \"value\");\n const name = \"eventMatch(message)\";\n return createBooleanMatch(\"event\", name, async (event) => {\n if (event.type !== \"message\") {\n return mismatched(diagnostic(\"event-type-mismatch\", \"event type did not match\", { expected: \"message\" }));\n }\n return messageEventResult(event, role as \"assistant\" | \"user\" | undefined, text as BooleanMatch<string, string, \"value\"> | undefined) as Promise<BooleanMatchEvaluation<Extract<EventOccurrenceView, {\n readonly type: K;\n }>>>;\n }) as EventMatch<Extract<EventOccurrenceView, {\n readonly type: K;\n }>>;\n }\n const normalized = assertPlainOptions(options, `eventMatch(${type}) options`, [\"tool\"]);\n const tool = normalized.tool;\n if (tool !== undefined)\n assertBooleanMatch(tool, `eventMatch(${type}) options.tool`, \"tool\");\n const name = `eventMatch(${type})`;\n return createBooleanMatch(\"event\", name, async (event) => {\n if (event.type !== type) {\n return mismatched(diagnostic(\"event-type-mismatch\", \"event type did not match\", { expected: type }));\n }\n const fields = await evaluateFields([\n { label: \"tool\", evaluate: () => toolEventResult(event, tool as ToolMatch | undefined) },\n ]);\n return combineConjunction<EventOccurrenceView, Extract<EventOccurrenceView, {\n readonly type: K;\n }>>(event, name, fields);\n }) as EventMatch<Extract<EventOccurrenceView, {\n readonly type: K;\n }>>;\n}\nconst collectionInputBrand: unique symbol = Symbol(\"niceeval.collection-match.input\");\nconst managedToolCallsBrand: unique symbol = Symbol(\"niceeval.managed-tool-calls\");\nconst managedEventOccurrencesBrand: unique symbol = Symbol(\"niceeval.managed-event-occurrences\");\nconst occurrenceMatchBrand: unique symbol = Symbol(\"niceeval.occurrence-match\");\nconst collectionMatches = new WeakMap<object, CollectionMatchSpec>();\nconst MAX_ORDER_STEPS = 64;\nexport interface CollectionMatch<in T> {\n readonly kind: \"collection-match\";\n readonly [collectionInputBrand]: (candidate: T) => void;\n}\nexport interface ToolOccurrenceView {\n readonly name: string;\n readonly input?: unknown;\n readonly output?: unknown;\n readonly status?: \"pending\" | \"completed\" | \"failed\" | \"rejected\";\n}\nexport type ManagedToolCalls<S extends \"turn\" | \"session\" | \"attempt\" = \"turn\" | \"session\" | \"attempt\"> = readonly ToolOccurrenceView[] & {\n readonly [managedToolCallsBrand]: S;\n};\n/** Identity-free event projection with an Attempt-owned matcher sidecar. */\nexport type ManagedEventOccurrences<S extends \"turn\" | \"session\" | \"attempt\" = \"turn\" | \"session\" | \"attempt\"> = readonly EventOccurrenceView[] & {\n readonly [managedEventOccurrencesBrand]: S;\n};\n/** Positive tool-occurrence query produced by atLeast, exactly, or greaterThan. */\nexport interface ToolOccurrenceMatch extends CollectionMatch<ManagedToolCalls> {\n readonly [occurrenceMatchBrand]: \"tool-positive\";\n}\n/** Upper-bound tool-occurrence query produced by atMost or lessThan. */\nexport interface ToolUpperBoundOccurrenceMatch extends CollectionMatch<ManagedToolCalls> {\n readonly [occurrenceMatchBrand]: \"tool-upper-bound\";\n}\n/** Ordered tool sequence accepted only by turn and session subjects. */\nexport interface ToolSequenceMatch extends CollectionMatch<ManagedToolCalls<\"turn\" | \"session\">> {\n readonly [occurrenceMatchBrand]: \"tool-sequence\";\n}\n/** Positive event-occurrence query produced by atLeast, exactly, or greaterThan. */\nexport interface EventOccurrenceMatch extends CollectionMatch<ManagedEventOccurrences> {\n readonly [occurrenceMatchBrand]: \"event-positive\";\n}\n/** Upper-bound event-occurrence query produced by atMost or lessThan. */\nexport interface EventUpperBoundOccurrenceMatch extends CollectionMatch<ManagedEventOccurrences> {\n readonly [occurrenceMatchBrand]: \"event-upper-bound\";\n}\n/** Ordered event sequence accepted only by turn and session subjects. */\nexport interface EventSequenceMatch extends CollectionMatch<ManagedEventOccurrences<\"turn\" | \"session\">> {\n readonly [occurrenceMatchBrand]: \"event-sequence\";\n}\nexport type CollectionMatchSpec = {\n readonly kind: \"occurrence\";\n readonly domain: \"tool\" | \"event\";\n readonly item: ToolMatch | EventMatch;\n readonly quantifier: ToolMatchQuantifier;\n} | {\n readonly kind: \"in-order\";\n readonly domain: \"tool\" | \"event\";\n readonly matches: readonly (ToolMatch | EventMatch)[];\n};\nfunction createCollectionMatch<T>(spec: CollectionMatchSpec, brand: string): CollectionMatch<T> {\n const match = Object.freeze({\n kind: \"collection-match\" as const,\n [collectionInputBrand]: (_candidate: T) => undefined,\n [occurrenceMatchBrand]: brand,\n }) as CollectionMatch<T>;\n collectionMatches.set(match, spec);\n return match;\n}\nfunction assertNonNegativeSafeInteger(value: unknown, label: string): asserts value is number {\n if (typeof value !== \"number\" || !Number.isSafeInteger(value) || value < 0) {\n throw new TypeError(`${label} must be a non-negative safe integer`);\n }\n}\nfunction quantifiedOccurrenceMatch(item: ToolMatch | EventMatch, kind: Exclude<ToolMatchQuantifier[\"kind\"], \"absent\">, count: number): ToolOccurrenceMatch | ToolUpperBoundOccurrenceMatch | EventOccurrenceMatch | EventUpperBoundOccurrenceMatch {\n const method = kind === \"at-least\"\n ? \"atLeast\"\n : kind === \"less-than\"\n ? \"lessThan\"\n : kind === \"at-most\"\n ? \"atMost\"\n : kind === \"greater-than\"\n ? \"greaterThan\"\n : \"exactly\";\n const domain = internalMatchOf(item, `${item.domain === \"event\" ? \"EventMatch\" : \"ToolMatch\"}.${method}() item`).domain;\n if (domain !== \"tool\" && domain !== \"event\")\n throw new TypeError(`${method}() requires a ToolMatch or EventMatch`);\n assertNonNegativeSafeInteger(count, `${domain === \"tool\" ? \"ToolMatch\" : \"EventMatch\"}.${method}() count`);\n const match = domain === \"tool\"\n ? assertManagedToolMatch(item, `ToolMatch.${method}() item`)\n : assertManagedEventMatch(item, `EventMatch.${method}() item`);\n const upperBound = kind === \"less-than\" || kind === \"at-most\";\n return createCollectionMatch({\n kind: \"occurrence\",\n domain,\n item: match,\n quantifier: kind === \"exact\" && count === 0\n ? Object.freeze({ kind: \"absent\" as const })\n : Object.freeze({ kind, count }),\n }, `${domain}-${upperBound ? \"upper-bound\" : \"positive\"}`) as ToolOccurrenceMatch | ToolUpperBoundOccurrenceMatch | EventOccurrenceMatch | EventUpperBoundOccurrenceMatch;\n}\nexport function inOrder(matches: readonly [\n EventMatch,\n EventMatch,\n ...EventMatch[]\n]): EventSequenceMatch;\nexport function inOrder(matches: readonly [\n ToolMatch,\n ToolMatch,\n ...ToolMatch[]\n]): ToolSequenceMatch;\nexport function inOrder<T, Subject extends CollectionValue<T>>(matches: readonly [\n BooleanMatch<T, NoInfer<T>>,\n BooleanMatch<T, NoInfer<T>>,\n ...BooleanMatch<T, NoInfer<T>>[]\n]): SubjectSequenceMatch<Subject>;\nexport function inOrder(matches: readonly unknown[]): ToolSequenceMatch | EventSequenceMatch | BooleanMatch<CollectionValue<unknown>, CollectionValue<unknown>> {\n if (!Array.isArray(matches) || matches.length < 2) {\n throw new TypeError(\"inOrder() requires at least two BooleanMatch values\");\n }\n if (matches.length > MAX_ORDER_STEPS) {\n throw new TypeError(`inOrder() supports at most ${MAX_ORDER_STEPS} steps`);\n }\n const first = internalMatchOf(matches[0], \"inOrder() match 1\");\n if (first.domain === \"value\") {\n const steps = Array.from(matches, (match, index) => {\n assertBooleanMatch(match, `inOrder() match ${index + 1}`, \"value\");\n return match as BooleanMatch<unknown, unknown>;\n });\n return valueSequenceMatch(Object.freeze(steps));\n }\n const domain = first.domain;\n const normalized = matches.map((match, index) => domain === \"tool\"\n ? assertManagedToolMatch(match, `inOrder() match ${index + 1}`)\n : assertManagedEventMatch(match, `inOrder() match ${index + 1}`));\n return createCollectionMatch({\n kind: \"in-order\",\n domain,\n matches: Object.freeze(normalized),\n }, `${domain}-sequence`) as ToolSequenceMatch | EventSequenceMatch;\n}\n// A sequence always refines to its input, including when nested under a NoInfer\n// composition argument. Keep that relationship available for contextual instantiation.\ninterface SubjectSequenceMatch<Subject> extends BooleanMatch<Subject, Subject> {\n readonly [matchRefinementBrand]: <Original extends Subject>() => Original;\n}\nfunction valueSequenceMatch(steps: readonly BooleanMatch<unknown, unknown>[]): BooleanMatch<CollectionValue<unknown>, CollectionValue<unknown>> {\n const name = `inOrder(${steps.map(step => step.name).join(\", \")})`;\n return createBooleanMatch(\"value\", name, async (subject) => {\n const collection = compositionCollection(subject, name);\n if (collection.state === \"unavailable\")\n return collection;\n const certain = new Array<boolean>(steps.length + 1).fill(false);\n const possible = new Array<boolean>(steps.length + 1).fill(false);\n certain[0] = possible[0] = true;\n const children: MatchDiagnosticChild[] = [];\n let unknownReason: string | undefined;\n for (let index = 0; index < collection.values.length; index += 1) {\n const value = collection.values[index];\n // Descending updates only consume prefixes reached by earlier items.\n for (let step = steps.length - 1; step >= 0; step -= 1) {\n if (!possible[step] || certain[step + 1])\n continue;\n const result = !Object.hasOwn(collection.values, index) || compositionUnknown(value)\n ? compositionMissing(name) : await evaluateBooleanMatch(steps[step], value);\n children.push(resultChild({ ...result, diagnostic: diagnostic(\"composition-order-item\", `${name} evaluated original item ${index}, step ${step}`, {\n path: [\"items\", index],\n children: [resultChild(result, step, steps[step].name)],\n }) }, index, collection.items?.[index]?.id));\n if (result.state !== \"mismatched\")\n possible[step + 1] = true;\n if (result.state === \"matched\" && certain[step])\n certain[step + 1] = true;\n if (result.state === \"unavailable\")\n unknownReason ??= result.reason;\n }\n if (certain[steps.length])\n return compositionResult(subject, name, children, matched(subject));\n }\n const result = possible[steps.length]\n ? unavailable(unknownReason ?? \"unknown-composition-value\", diagnostic(\"composition-order-unavailable\", \"Only an unknown sequence can satisfy the order\"))\n : mismatched(diagnostic(\"composition-order-mismatched\", \"No increasing sequence can satisfy the order\"));\n return compositionResult(subject, name, children, result);\n });\n}\nexport function isManagedCollectionMatch(value: unknown): value is CollectionMatch<unknown> {\n return isRecord(value) && collectionMatches.has(value);\n}\nexport function looksLikeCollectionMatch(value: unknown): boolean {\n return isRecord(value) && value.kind === \"collection-match\";\n}\nexport function collectionMatchSpecOf(value: unknown): CollectionMatchSpec {\n const spec = isRecord(value) ? collectionMatches.get(value) : undefined;\n if (spec === undefined) {\n throw new TypeError(\"match must be a collection Match created by niceeval/expect\");\n }\n return spec;\n}\n/** Ordinary arrays are complete; material collections carry explicit source coverage. */\nexport type CollectionValue<T> = readonly T[] | MaterialCollection<T>;\n// Only input variance matters: a child's refinement never replaces the outer subject.\ntype CompositionValueMatch<T> = Match<T, \"value\"> & {\n readonly kind: \"boolean\";\n};\nasync function compositionEvaluate<T>(match: CompositionValueMatch<T>, value: T): Promise<BooleanMatchEvaluation<T>> {\n return evaluateBooleanMatch(match as BooleanMatch<T, T>, value);\n}\nfunction compositionUnknown(value: unknown): boolean {\n return value === undefined || value === null || typeof value === \"number\" && !Number.isFinite(value);\n}\nfunction compositionMissing(name: string, path: readonly MatchPathSegment[] = []): BooleanMatchEvaluation<never> {\n return unavailable(\"unknown-composition-value\", diagnostic(\"composition-value-unavailable\", `${name} requires a known, finite value`, {\n path, reason: \"unknown-composition-value\",\n }));\n}\nfunction compositionProject<T, U>(name: string, project: (value: T) => U, value: T): U {\n const projected = project(value);\n if (projected !== null && (typeof projected === \"object\" || typeof projected === \"function\") &&\n typeof (projected as {\n readonly then?: unknown;\n }).then === \"function\") {\n throw new TypeError(`${name} projection must return a synchronous value`);\n }\n return projected;\n}\nfunction compositionResult<T>(subject: T, name: string, children: readonly MatchDiagnosticChild[], result: BooleanMatchEvaluation<unknown>): BooleanMatchEvaluation<T> {\n const detail = diagnostic(`composition-${result.state}`, `${name} ${result.state}`, {\n children, ...(result.state === \"unavailable\" ? { reason: result.reason } : {}),\n });\n if (result.state === \"unavailable\")\n return unavailable(result.reason, detail);\n if (result.state === \"mismatched\")\n return mismatched(detail);\n return matched(subject, detail);\n}\nfunction compositionCollection<T>(subject: CollectionValue<T>, name: string): {\n readonly state: \"complete\";\n readonly values: readonly T[];\n readonly items?: readonly MaterialItem<T>[];\n} | Extract<BooleanMatchEvaluation<never>, {\n readonly state: \"unavailable\";\n}> {\n if (Array.isArray(subject))\n return { state: \"complete\", values: subject };\n if (!isRecord(subject) || ![\"complete\", \"partial\", \"unavailable\"].includes(String(subject.state))) {\n throw new TypeError(`${name} subject must be an array or MaterialCollection`);\n }\n if (subject.state !== \"complete\") {\n if (typeof subject.reason !== \"string\" || subject.reason.trim() === \"\") {\n throw new TypeError(`${name} incomplete collection requires a reason`);\n }\n return unavailable(subject.reason, diagnostic(\"composition-collection-unavailable\", `${name} requires a complete collection`, {\n reason: subject.reason,\n })) as Extract<BooleanMatchEvaluation<never>, {\n readonly state: \"unavailable\";\n }>;\n }\n if (!Array.isArray(subject.items))\n throw new TypeError(`${name} material items must be an array`);\n const items = subject.items as readonly MaterialItem<T>[];\n const ids = new Set<string>();\n const values: T[] = new Array(items.length);\n for (let index = 0; index < items.length; index += 1) {\n if (!Object.hasOwn(items, index) || compositionUnknown(items[index]))\n continue;\n const item = items[index];\n if (!isRecord(item) || typeof item.id !== \"string\" || item.id.trim() === \"\" || ids.has(item.id)) {\n throw new TypeError(`${name} material items require unique nonempty IDs`);\n }\n ids.add(item.id);\n if (Object.hasOwn(item, \"value\"))\n values[index] = item.value as T;\n }\n return { state: \"complete\", values, items };\n}\nfunction compositionItemChild(result: BooleanMatchEvaluation<unknown>, index: number, id: string | undefined, label: string): MatchDiagnosticChild {\n return resultChild({ ...result, diagnostic: diagnostic(\"composition-item\", `${label} evaluated original item ${index}`, {\n path: [\"items\", index],\n children: [resultChild(result, 0, label)],\n }) }, index, id === undefined ? label : id);\n}\nfunction compositionSubset<T>(values: readonly T[], indices: readonly number[], items?: readonly MaterialItem<unknown>[]): CollectionValue<T> {\n if (items === undefined)\n return Object.freeze([...values]);\n return Object.freeze({ state: \"complete\", items: Object.freeze(values.map((value, index) => Object.freeze({\n id: items[indices[index]].id, value,\n }))) });\n}\n/** Project a single value without replacing the original subject's refinement. */\nexport function mapValue<T, U>(label: string, project: (value: T) => U, match: Match<NoInfer<U>, \"value\"> & {\n readonly kind: \"boolean\";\n}): BooleanMatch<T, T> {\n assertNonEmptyString(label, \"mapValue() label\");\n if (typeof project !== \"function\")\n throw new TypeError(\"mapValue() project must be a function\");\n assertBooleanMatch(match, \"mapValue() match\", \"value\");\n const name = `mapValue(${label}, ${match.name})`;\n return createBooleanMatch(\"value\", name, async (subject: T) => {\n if (compositionUnknown(subject))\n return compositionMissing(name);\n const value = compositionProject(name, project, subject);\n const result = compositionUnknown(value) ? compositionMissing(name) : await compositionEvaluate(match, value);\n return compositionResult(subject, name, [resultChild(result, 0, label)], result);\n });\n}\n/** Project each complete item, retaining its material identity and order. */\nexport function mapEach<T, U, Subject extends CollectionValue<T>>(project: (value: T) => U, aggregate: Match<CollectionValue<NoInfer<U>>, \"value\"> & {\n readonly kind: \"boolean\";\n}): BooleanMatch<Subject & CollectionValue<T>, Subject> {\n if (typeof project !== \"function\")\n throw new TypeError(\"mapEach() project must be a function\");\n assertBooleanMatch(aggregate, \"mapEach() aggregate\", \"value\");\n const name = `mapEach(${aggregate.name})`;\n return createBooleanMatch(\"value\", name, async (subject: Subject) => {\n const collection = compositionCollection(subject, name);\n if (collection.state === \"unavailable\")\n return collection;\n const values: U[] = [];\n const indices: number[] = [];\n const children: MatchDiagnosticChild[] = [];\n let unknown: BooleanMatchEvaluation<unknown> | undefined;\n for (let index = 0; index < collection.values.length; index += 1) {\n const item = collection.values[index];\n const value = !Object.hasOwn(collection.values, index) || compositionUnknown(item)\n ? undefined : compositionProject(name, project, item);\n const result = compositionUnknown(value) ? compositionMissing(name) : matched(value);\n if (result.state === \"unavailable\")\n unknown ??= result;\n values.push(value as U);\n indices.push(index);\n children.push(compositionItemChild(result, index, collection.items?.[index]?.id, \"projection\"));\n }\n if (unknown !== undefined)\n return compositionResult(subject, name, children, unknown);\n const result = await compositionEvaluate(aggregate, compositionSubset(values, indices, collection.items));\n children.push(resultChild(result, collection.values.length, \"aggregate\"));\n return compositionResult(subject, name, children, result);\n });\n}\n/** Select only definite matches; an unknown selector makes the aggregate unavailable. */\nexport function filterWhere<T, R extends T, Subject extends CollectionValue<T>>(selector: BooleanMatch<T, R>, aggregate: BooleanMatch<CollectionValue<R>, CollectionValue<R>>): BooleanMatch<Subject, Subject> {\n assertBooleanMatch(selector, \"filterWhere() selector\", \"value\");\n assertBooleanMatch(aggregate, \"filterWhere() aggregate\", \"value\");\n const name = `filterWhere(${selector.name}, ${aggregate.name})`;\n return createBooleanMatch(\"value\", name, async (subject: Subject) => {\n const collection = compositionCollection(subject, name);\n if (collection.state === \"unavailable\")\n return collection;\n const values: R[] = [];\n const indices: number[] = [];\n const children: MatchDiagnosticChild[] = [];\n let unknown: BooleanMatchEvaluation<unknown> | undefined;\n for (let index = 0; index < collection.values.length; index += 1) {\n const value = collection.values[index];\n const result = !Object.hasOwn(collection.values, index) || compositionUnknown(value)\n ? compositionMissing(name) : await evaluateBooleanMatch(selector, value);\n if (result.state === \"matched\") {\n values.push(value as R);\n indices.push(index);\n }\n if (result.state === \"unavailable\")\n unknown ??= result;\n children.push(compositionItemChild(result, index, collection.items?.[index]?.id, selector.name));\n }\n if (unknown !== undefined)\n return compositionResult(subject, name, children, unknown);\n const result = await compositionEvaluate(aggregate, compositionSubset(values, indices, collection.items));\n children.push(resultChild(result, collection.values.length, \"aggregate\"));\n return compositionResult(subject, name, children, result);\n });\n}\n/** Compare an exact match count only after every item in a complete collection is known. */\nexport function countWhere<T, Subject extends CollectionValue<T>>(item: BooleanMatch<T, NoInfer<T>>, count: Match<number, \"value\"> & {\n readonly kind: \"boolean\";\n}): BooleanMatch<Subject, Subject> {\n assertBooleanMatch(item, \"countWhere() item\", \"value\");\n assertBooleanMatch(count, \"countWhere() count\", \"value\");\n const name = `countWhere(${item.name}, ${count.name})`;\n return createBooleanMatch(\"value\", name, async (subject: Subject) => {\n const collection = compositionCollection(subject, name);\n if (collection.state === \"unavailable\")\n return collection;\n let total = 0;\n const children: MatchDiagnosticChild[] = [];\n let unknown: BooleanMatchEvaluation<unknown> | undefined;\n for (let index = 0; index < collection.values.length; index += 1) {\n const value = collection.values[index];\n const result = !Object.hasOwn(collection.values, index) || compositionUnknown(value)\n ? compositionMissing(name) : await evaluateBooleanMatch(item, value);\n if (result.state === \"matched\")\n total += 1;\n if (result.state === \"unavailable\")\n unknown ??= result;\n children.push(compositionItemChild(result, index, collection.items?.[index]?.id, item.name));\n }\n if (unknown !== undefined)\n return compositionResult(subject, name, children, unknown);\n const result = await compositionEvaluate(count, total);\n children.push(resultChild(result, collection.values.length, \"count\"));\n return compositionResult(subject, name, children, result);\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"match.js","sourceRoot":"","sources":["match.ts"],"names":[],"mappings":";;;AA0OA,kDAEC;AA+JD,wCAEC;AAED,wCAKC;AAED,kDAEC;AAED,4DAEC;AAED,0DAKC;AA2DD,8DA0CC;AA6BD,4BAEC;AAGD,wBAEC;AAGD,kCAEC;AAGD,0BAEC;AAID,0BAEC;AA8BD,8DAoBC;AAED,wDAkCC;AAED,4DAEC;AAED,oDAIC;AAED,gDAcC;AAwHD,kBAUC;AAKD,gBA4BC;AACD,kBAqBC;AAmBD,4BAcC;AACD,4BAcC;AACD,0BAkBC;AAED,gCAYC;AAmBD,kCAYC;AAED,kCAYC;AASD,8BAQC;AAED,wBAOC;AAED,0BAOC;AAED,4CAcC;AAED,8BAEC;AAwCD,wBAOC;AAqBD,0BA8BC;AAKD,wCAUC;AAGD,8BAYC;AAiBD,4CAyBC;AAMD,4CAmCC;AAiCD,0CAkBC;AAkLD,8CAkBC;AAmBD,8BAYC;AAgKD,8BA4DC;AAED,wDAGC;AAED,gDAIC;AAED,0DAGC;AAED,kDAIC;AA+ED,oCAqBC;AAkDD,gCA4CC;AAkHD,0BAwBC;AA6CD,4DAEC;AACD,4DAEC;AACD,sDAMC;AA4FD,4BAeC;AAED,0BAgCC;AAED,kCA8BC;AAED,gCA6BC;AAt0ED,gBAAgB;AAChB,0EAA0E;AAC1E,2EAA2E;AAC3E,oDAAoD;AACpD,+CAAwF;AAOxF,mCAAgC;AAEhC,2DAAsD;AAGtD,wCAA2C;AAC3C,2CAAqD;AA+DrD,8DAA8D;AAC9D,0DAA0D;AAC1D,MAAM,eAAe,GAAkB,MAAM,CAAC,sBAAsB,CAAC,CAAC;AACtE,MAAM,oBAAoB,GAAkB,MAAM,CAAC,2BAA2B,CAAC,CAAC;AAChF,MAAM,mBAAmB,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BAChF,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACzE,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS;gBAC1B,KAAK,IAAI,CAAC,CAAC;YACf,IAAI,MAAM,CAAC,KAAK,KAAK,aAAa;gBAC9B,OAAO,KAAK,MAAM,CAAC;YACvB,QAAQ,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACjG,CAAC;QACD,IAAI,OAAO,KAAK,SAAS;YACrB,OAAO,iBAAiB,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC/D,MAAM,MAAM,GAAG,MAAM,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACvD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACtE,OAAO,iBAAiB,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["// @concord-file\n// @concord-implements docs/feature/assertions/library/value-assertions.md\n// @concord-implements docs/feature/assertions/library/scoped-assertions.md\n// @concord-implements docs/feature/judge/library.md\nimport { isQuantity, type Quantity, type Unit, formatNumericUnit } from \"./quantity.ts\";\n// Match 内核:纯候选比较、三态结果与领域 matcher。\n//\n// 这里不登记 Assertion,也不决定 Verdict / Score。调用方先冻结 subject,再把同一\n// candidate 交给本模块;因此组合 matcher 不会自行重读证据,也不会把 evaluator defect\n// 折成 mismatch 或 unavailable。\nimport type { StandardSchemaV1 as StandardSchema } from \"@standard-schema/spec\";\nimport { Effect } from \"effect\";\nimport type { CommandProjection, LogicalToolOccurrence, } from \"../o11y/types.ts\";\nimport { matchesJson } from \"../shared/json-match.ts\";\nimport type { JsonMatch, JsonValue } from \"../shared/types.ts\";\nimport type { JudgeMaterial } from \"../judge/image.ts\";\nimport { stripComments } from \"../util.ts\";\nimport { assertionRuntimeLimits } from \"./limits.ts\";\nimport type { MaterialCollection, MaterialItem } from \"./context-match.ts\";\nexport type MatchDomain = \"value\" | \"tool\" | \"event\";\ntype MatchPathSegment = string | number;\n/** 可序列化的候选诊断;组合 matcher 用 children 保留声明顺序与嵌套位置。 */\nexport interface MatchDiagnostic {\n readonly code: string;\n readonly message: string;\n /** 相对当前 matcher 的路径;组合节点的 child index 也由 children 明确给出。 */\n readonly path: readonly MatchPathSegment[];\n readonly expected?: string;\n readonly received?: string;\n readonly reason?: string;\n readonly locator?: {\n readonly kind: \"json-pointer\";\n readonly pointer: string;\n } | {\n readonly kind: \"tool-occurrence\";\n readonly id: string;\n };\n readonly children?: readonly MatchDiagnosticChild[];\n /** Collection matchers retain only a bounded, representative candidate set. */\n readonly truncation?: {\n readonly code: \"diagnostic-truncated\";\n readonly reason: \"sampled\";\n readonly captured: number;\n readonly knownTotal: number;\n };\n}\nexport interface MatchDiagnosticChild {\n readonly index: number;\n readonly label?: string;\n readonly state: MatchEvaluationState;\n readonly diagnostic?: MatchDiagnostic;\n}\nexport type MatchEvaluationState = \"matched\" | \"mismatched\" | \"unavailable\";\nexport interface CollectionEvaluationReceipt {\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}\n/** 一个单候选 matcher 的内部三态结果。 */\nexport type BooleanMatchEvaluation<R> = {\n readonly state: \"matched\";\n /** 永远是传入 candidate 本身,只是在类型层收窄。 */\n readonly value: R;\n readonly diagnostic?: MatchDiagnostic;\n readonly receipt?: CollectionEvaluationReceipt;\n} | {\n readonly state: \"mismatched\";\n readonly diagnostic: MatchDiagnostic;\n readonly receipt?: CollectionEvaluationReceipt;\n} | {\n readonly state: \"unavailable\";\n readonly reason: string;\n readonly diagnostic: MatchDiagnostic;\n readonly receipt?: CollectionEvaluationReceipt;\n};\n// 这些 symbol 不导出。外部作者无法构造看似可消费的 Match;输入 variance 与 refinement\n// variance 也保持分离,连续 measurement 不会伪造一个没有含义的输出 refinement。\nconst matchInputBrand: unique symbol = Symbol(\"niceeval.match.input\");\nconst matchRefinementBrand: unique symbol = Symbol(\"niceeval.match.refinement\");\nconst matchEvaluatorBrand: unique symbol = Symbol(\"niceeval.match.evaluator\");\nconst positiveWitnessBrand: unique symbol = Symbol(\"niceeval.match.positive-witness\");\nconst numericComparisonMatchBrand: unique symbol = Symbol(\"niceeval.numericComparisonMatch\");\nconst assertionEventIdentityBrand: unique symbol = Symbol(\"niceeval.assertionEventIdentity\");\nconst assertionEventPositionBrand: unique symbol = Symbol(\"niceeval.assertionEventPosition\");\nconst toolOccurrenceIdentityBrand: unique symbol = Symbol(\"niceeval.toolOccurrenceIdentity\");\nconst matchBrands = new WeakSet<object>();\nconst numericComparisons = new WeakMap<object, NumericComparison>();\nexport const NUMERIC_COMPARATORS = [\"less-than\", \"at-most\", \"greater-than\", \"at-least\", \"between\"] as const;\nexport type NumericComparator = (typeof NUMERIC_COMPARATORS)[number];\nexport interface NumericComparison {\n readonly comparator: NumericComparator;\n readonly threshold: number;\n readonly upperThreshold?: number;\n readonly unit?: Unit;\n}\nexport type NumericMaterial<U extends Unit | undefined = undefined> = {\n readonly unit?: U;\n readonly provenance?: {\n readonly source: string;\n readonly scope: string;\n readonly unit: string;\n readonly cut: string;\n };\n} & ({\n readonly state: \"exact\";\n readonly value: number;\n} | {\n readonly state: \"lower-bound\";\n readonly value: number;\n} | {\n readonly state: \"unavailable\";\n readonly reason: string;\n});\nexport interface Match<in T, D extends MatchDomain> {\n readonly domain: D;\n readonly name: string;\n readonly [matchInputBrand]: (candidate: T) => void;\n readonly [matchEvaluatorBrand]: (candidate: T) => Promise<unknown>;\n}\nexport interface BooleanMatch<in T, out R extends T, D extends MatchDomain = \"value\"> extends Match<T, D> {\n readonly kind: \"boolean\";\n readonly [matchRefinementBrand]: () => R;\n}\nexport interface NumericComparisonMatch<U extends Unit | undefined = undefined> extends BooleanMatch<U extends Unit ? Quantity<U> : number, U extends Unit ? Quantity<U> : number, \"value\"> {\n readonly [numericComparisonMatchBrand]: (unit: U) => U;\n}\nexport interface ScoreMatch<in T> extends Match<T, \"value\"> {\n readonly kind: \"score\";\n}\nexport interface ScoreMatchAnchor {\n readonly measurement: number;\n readonly description: string;\n}\nexport type ScoreMatchLlmFailure = {\n readonly _tag: \"ScoreMatchLlmUnavailable\";\n readonly code: string;\n readonly message: string;\n} | {\n readonly _tag: \"ScoreMatchLlmErrored\";\n readonly code: string;\n readonly message: string;\n};\nexport type ScoreMatchResult = number | {\n readonly state: \"measured\";\n readonly measurement: number;\n readonly rationale?: string;\n readonly citations?: readonly string[];\n} | {\n readonly state: \"unavailable\";\n readonly reason: string;\n readonly rationale?: string;\n readonly citations?: readonly string[];\n} | {\n readonly state: \"errored\";\n readonly code: string;\n readonly message: string;\n};\nexport interface ScoreMatchContext {\n readonly llm: {\n score(input: {\n readonly rubric: string;\n readonly anchors: readonly ScoreMatchAnchor[];\n readonly material: JudgeMaterial;\n }): Effect.Effect<{\n readonly measurement: number;\n readonly rationale: string;\n }, ScoreMatchLlmFailure>;\n classify(input: {\n readonly rubric: string;\n readonly choices: readonly string[];\n readonly evidenceIds?: readonly string[];\n readonly material: JudgeMaterial;\n }): Effect.Effect<{\n readonly choice: string;\n readonly rationale: string;\n readonly citations?: readonly string[];\n }, ScoreMatchLlmFailure>;\n extract(input: {\n readonly rubric: string;\n readonly maxItems: number;\n readonly material: JudgeMaterial;\n }): Effect.Effect<{\n readonly items: readonly string[];\n readonly rationale: string;\n readonly complete: boolean;\n }, ScoreMatchLlmFailure>;\n batchClassify(input: {\n readonly rubric: string;\n readonly choices: readonly string[];\n readonly items: readonly {\n readonly id: string;\n readonly text: string;\n }[];\n readonly material: JudgeMaterial;\n }): Effect.Effect<{\n readonly items: readonly {\n readonly id: string;\n readonly choice: string;\n readonly rationale: string;\n }[];\n }, ScoreMatchLlmFailure>;\n };\n}\nexport interface ManagedScoreMatchOptions<T, E = ScoreMatchLlmFailure> {\n readonly name: string;\n readonly version: string;\n readonly config: JsonValue;\n readonly llm: {\n readonly maxCalls?: number;\n readonly maxMaterialBytes?: number;\n readonly maxAuditBytes?: number;\n };\n readonly score: (value: T, context: ScoreMatchContext) => Effect.Effect<ScoreMatchResult, E>;\n}\n/** @internal Canonical, deeply frozen definition consumed by identity and the managed gateway. */\nexport interface ManagedScoreMatchDefinition<T = unknown, E = unknown> {\n readonly name: string;\n readonly version: string;\n readonly config: JsonValue;\n readonly canonicalConfig: string;\n readonly llm: {\n readonly maxCalls: number;\n readonly maxMaterialBytes: number;\n readonly maxAuditBytes: number;\n };\n readonly score: (value: T, context: ScoreMatchContext) => Effect.Effect<ScoreMatchResult, E>;\n}\nconst managedScoreMatches = new WeakMap<object, ManagedScoreMatchDefinition<unknown, unknown>>();\nconst scoreEvaluators = new WeakMap<object, (candidate: unknown) => Effect.Effect<number, unknown>>();\nexport function managedScoreMatchOf(value: unknown): ManagedScoreMatchDefinition<unknown, unknown> | undefined {\n return typeof value === \"object\" && value !== null ? managedScoreMatches.get(value) : undefined;\n}\nexport type ValueMatch<T, R extends T = T> = BooleanMatch<T, R, \"value\"> | ScoreMatch<T>;\nexport type LogicalCommandOccurrence = LogicalToolOccurrence & {\n readonly command: Extract<CommandProjection, {\n readonly kind: \"command\";\n }>;\n};\nexport interface ToolOccurrenceQuantifiers {\n atLeast(count: number): ToolOccurrenceMatch;\n lessThan(count: number): ToolUpperBoundOccurrenceMatch;\n atMost(count: number): ToolUpperBoundOccurrenceMatch;\n greaterThan(count: number): ToolOccurrenceMatch;\n exactly(count: number): ToolOccurrenceMatch;\n}\nexport type ToolMatch<R extends LogicalToolOccurrence = LogicalToolOccurrence> = BooleanMatch<LogicalToolOccurrence, R, \"tool\"> & ToolOccurrenceQuantifiers;\ntype BooleanMatchForDomain<T, R extends T, D extends MatchDomain> = BooleanMatch<T, R, D> & (D extends \"tool\" ? ToolOccurrenceQuantifiers : D extends \"event\" ? EventOccurrenceQuantifiers : object);\nexport type AssertionEventIdentity = string & {\n readonly [assertionEventIdentityBrand]: true;\n};\nexport type ToolOccurrenceIdentity = string & {\n readonly [toolOccurrenceIdentityBrand]: true;\n};\nexport interface AssertionEventPosition {\n readonly turnOrdinal: number;\n readonly eventOrdinal: number;\n readonly [assertionEventPositionBrand]: true;\n}\nexport interface AssertionToolReference {\n readonly id: ToolOccurrenceIdentity;\n readonly name: string;\n}\n/** Public, identity-free projection exposed by managed eventOccurrences. */\nexport type EventOccurrenceView = {\n readonly type: \"message\";\n readonly role: \"assistant\" | \"user\";\n readonly text: string;\n} | {\n readonly type: \"operation.started\";\n readonly tool: {\n readonly name: string;\n };\n} | {\n readonly type: \"operation.finished\";\n readonly tool: {\n readonly name: string;\n };\n readonly status: \"completed\" | \"failed\" | \"rejected\";\n};\nexport type AssertionEvent = {\n readonly id: AssertionEventIdentity;\n readonly position: AssertionEventPosition;\n readonly type: \"message\";\n readonly role: \"assistant\" | \"user\";\n readonly text: string;\n} | {\n readonly id: AssertionEventIdentity;\n readonly position: AssertionEventPosition;\n readonly type: \"operation.started\";\n readonly tool: AssertionToolReference;\n} | {\n readonly id: AssertionEventIdentity;\n readonly position: AssertionEventPosition;\n readonly type: \"operation.finished\";\n readonly tool: AssertionToolReference;\n readonly status: \"completed\" | \"failed\" | \"rejected\";\n};\nexport type MatchableEvent = AssertionEvent;\nexport interface EventOccurrenceQuantifiers {\n atLeast(count: number): EventOccurrenceMatch;\n lessThan(count: number): EventUpperBoundOccurrenceMatch;\n atMost(count: number): EventUpperBoundOccurrenceMatch;\n greaterThan(count: number): EventOccurrenceMatch;\n exactly(count: number): EventOccurrenceMatch;\n}\nexport type EventMatch<R extends EventOccurrenceView = EventOccurrenceView> = BooleanMatch<EventOccurrenceView, R, \"event\"> & EventOccurrenceQuantifiers;\nconst assertionEventOccurrences = new WeakMap<object, LogicalToolOccurrence>();\nexport type RefinementOf<M> = M extends BooleanMatch<infer _T, infer R, infer _D> ? R : never;\nexport type RefinementIntersection<M extends readonly unknown[]> = M extends readonly [\n infer Head,\n ...infer Tail\n] ? RefinementOf<Head> & RefinementIntersection<Tail> : unknown;\ninterface InternalMatch {\n readonly domain: MatchDomain;\n readonly name: string;\n readonly kind: \"boolean\" | \"score\";\n readonly [matchEvaluatorBrand]: (candidate: unknown) => Promise<unknown>;\n readonly [positiveWitnessBrand]?: true;\n}\ninterface CreateBooleanMatchOptions {\n readonly positiveWitness?: true;\n}\nfunction isRecord(value: unknown): value is globalThis.Record<PropertyKey, unknown> {\n return value !== null && typeof value === \"object\";\n}\nfunction diagnostic(code: string, message: string, options: Omit<MatchDiagnostic, \"code\" | \"message\" | \"path\"> & {\n readonly path?: readonly MatchPathSegment[];\n} = {}): MatchDiagnostic {\n return Object.freeze({\n code,\n message,\n path: Object.freeze([...(options.path ?? [])]),\n ...(options.expected === undefined ? {} : { expected: options.expected }),\n ...(options.received === undefined ? {} : { received: options.received }),\n ...(options.reason === undefined ? {} : { reason: options.reason }),\n ...(options.locator === undefined ? {} : { locator: options.locator }),\n ...(options.children === undefined ? {} : { children: Object.freeze([...options.children]) }),\n ...(options.truncation === undefined ? {} : { truncation: Object.freeze({ ...options.truncation }) }),\n });\n}\nfunction matched<R>(value: R, detail?: MatchDiagnostic): BooleanMatchEvaluation<R> {\n return Object.freeze({ state: \"matched\" as const, value, ...(detail === undefined ? {} : { diagnostic: detail }) });\n}\nfunction mismatched<R = never>(detail: MatchDiagnostic): BooleanMatchEvaluation<R> {\n return Object.freeze({ state: \"mismatched\" as const, diagnostic: detail });\n}\nfunction unavailable<R = never>(reason: string, detail: MatchDiagnostic): BooleanMatchEvaluation<R> {\n return Object.freeze({ state: \"unavailable\" as const, reason, diagnostic: detail });\n}\nfunction assertDiagnostic(value: unknown, label: string): asserts value is MatchDiagnostic {\n if (!isRecord(value) || typeof value.code !== \"string\" || typeof value.message !== \"string\" || !Array.isArray(value.path)) {\n throw new TypeError(`${label} returned an invalid diagnostic`);\n }\n}\nfunction assertBooleanEvaluation<R>(value: unknown, label: string): BooleanMatchEvaluation<R> {\n if (!isRecord(value) || typeof value.state !== \"string\") {\n throw new TypeError(`${label} returned an invalid boolean matcher result`);\n }\n if (value.state === \"matched\") {\n if (!(\"value\" in value))\n throw new TypeError(`${label} returned a matched result without the original candidate`);\n return value as BooleanMatchEvaluation<R>;\n }\n if (value.state === \"mismatched\") {\n assertDiagnostic(value.diagnostic, label);\n return value as BooleanMatchEvaluation<R>;\n }\n if (value.state === \"unavailable\") {\n if (typeof value.reason !== \"string\" || value.reason.length === 0) {\n throw new TypeError(`${label} returned unavailable without a reason`);\n }\n assertDiagnostic(value.diagnostic, label);\n return value as BooleanMatchEvaluation<R>;\n }\n throw new TypeError(`${label} returned an unknown matcher state`);\n}\nfunction internalMatchOf(value: unknown, label: string): InternalMatch {\n if (!isRecord(value) || !matchBrands.has(value)) {\n throw new TypeError(`${label} must be a Match created by niceeval/expect`);\n }\n const match = value as unknown as InternalMatch;\n if ((match.domain !== \"value\" && match.domain !== \"tool\" && match.domain !== \"event\") ||\n (match.kind !== \"boolean\" && match.kind !== \"score\") ||\n typeof match.name !== \"string\" ||\n typeof match[matchEvaluatorBrand] !== \"function\") {\n throw new TypeError(`${label} must be a Match created by niceeval/expect`);\n }\n return match;\n}\n/** @internal Runtime brand guard used by the context overload dispatcher. */\nexport function isManagedMatch(value: unknown): boolean {\n return isRecord(value) && matchBrands.has(value);\n}\n/** @internal Reject Match-shaped raw subjects instead of silently treating them as ordinary values. */\nexport function looksLikeMatch(value: unknown): boolean {\n if (!isRecord(value))\n return false;\n return (value.domain === \"value\" || value.domain === \"tool\" || value.domain === \"event\") &&\n (value.kind === \"boolean\" || value.kind === \"score\") && typeof value.name === \"string\";\n}\n/** @internal Returns the durable numeric identity of a managed matcher, when present. */\nexport function numericComparisonOf(value: unknown): NumericComparison | undefined {\n return isRecord(value) ? numericComparisons.get(value) : undefined;\n}\n/** @internal Nominal guard backed by the private managed-match registry. */\nexport function isNumericComparisonMatch(value: unknown): value is NumericComparisonMatch {\n return numericComparisonOf(value) !== undefined;\n}\n/** @internal The value-side consumer accepts only a real, value-domain Match. */\nexport function assertManagedValueMatch(value: unknown, label = \"match\"): BooleanMatch<unknown, unknown, \"value\"> | ScoreMatch<unknown> {\n const match = internalMatchOf(value, label);\n if (match.domain !== \"value\")\n throw new TypeError(`${label} must be a value-domain Match`);\n return value as BooleanMatch<unknown, unknown, \"value\"> | ScoreMatch<unknown>;\n}\nfunction assertBooleanMatch(value: unknown, label: string, domain?: MatchDomain): InternalMatch {\n const match = internalMatchOf(value, label);\n if (match.kind !== \"boolean\")\n throw new TypeError(`${label} must be a BooleanMatch`);\n if (domain !== undefined && match.domain !== domain) {\n throw new TypeError(`${label} must have ${domain} domain, received ${match.domain}`);\n }\n return match;\n}\nfunction createBooleanMatch<T, R extends T, D extends MatchDomain>(domain: D, name: string, evaluate: (candidate: T) => BooleanMatchEvaluation<R> | Promise<BooleanMatchEvaluation<R>>, options: CreateBooleanMatchOptions = {}): BooleanMatchForDomain<T, R, D> {\n let match: BooleanMatchForDomain<T, R, D>;\n const result = {\n domain,\n name,\n kind: \"boolean\" as const,\n [matchInputBrand]: (_candidate: T) => undefined,\n [matchRefinementBrand]: () => undefined as unknown as R,\n [matchEvaluatorBrand]: async (candidate: T) => evaluate(candidate),\n ...(options.positiveWitness === true ? { [positiveWitnessBrand]: true as const } : {}),\n ...(domain === \"tool\" || domain === \"event\"\n ? {\n atLeast: (count: number) => quantifiedOccurrenceMatch(match as unknown as ToolMatch | EventMatch, \"at-least\", count),\n lessThan: (count: number) => quantifiedOccurrenceMatch(match as unknown as ToolMatch | EventMatch, \"less-than\", count),\n atMost: (count: number) => quantifiedOccurrenceMatch(match as unknown as ToolMatch | EventMatch, \"at-most\", count),\n greaterThan: (count: number) => quantifiedOccurrenceMatch(match as unknown as ToolMatch | EventMatch, \"greater-than\", count),\n exactly: (count: number) => quantifiedOccurrenceMatch(match as unknown as ToolMatch | EventMatch, \"exact\", count),\n }\n : {}),\n };\n match = Object.freeze(result) as BooleanMatchForDomain<T, R, D>;\n matchBrands.add(match);\n return match;\n}\nfunction numericDiagnostic(comparison: NumericComparison, material: NumericMaterial<Unit | undefined>, code: string, message: string): MatchDiagnostic {\n return diagnostic(code, message, {\n expected: `${comparison.comparator} ${formatNumericUnit(comparison.threshold, comparison.unit)}${comparison.upperThreshold === undefined ? \"\" : ` … ${formatNumericUnit(comparison.upperThreshold, comparison.unit)}`}`,\n received: material.state === \"unavailable\" ? material.reason : formatNumericUnit(material.value, material.unit),\n ...(material.state === \"unavailable\" ? { reason: material.reason } : {}),\n });\n}\nfunction compareExact(value: number, comparison: NumericComparison): boolean {\n switch (comparison.comparator) {\n case \"less-than\":\n return value < comparison.threshold;\n case \"at-most\":\n return value <= comparison.threshold;\n case \"greater-than\":\n return value > comparison.threshold;\n case \"at-least\":\n return value >= comparison.threshold;\n case \"between\":\n return value >= comparison.threshold && value <= comparison.upperThreshold!;\n }\n}\n/**\n * The sole numeric comparison evaluator. A lower bound can only decide a\n * monotone result; all other partial observations remain unavailable.\n */\nexport function evaluateNumericComparison(material: NumericMaterial<Unit | undefined>, comparison: NumericComparison): BooleanMatchEvaluation<number> {\n if (material.state === \"unavailable\") {\n return unavailable(material.reason, numericDiagnostic(comparison, material, \"numeric-value-unavailable\", \"the numeric value is unavailable\"));\n }\n if (material.unit !== comparison.unit) {\n return unavailable(\"numeric-unit-mismatch\", numericDiagnostic(comparison, material, \"numeric-unit-mismatch\", `numeric units differ: ${material.unit ?? \"unitless\"} and ${comparison.unit ?? \"unitless\"}`));\n }\n if (!Number.isFinite(material.value)) {\n const unavailableMaterial = Object.freeze({\n state: \"unavailable\" as const,\n reason: \"non-finite-number\",\n });\n return unavailable(unavailableMaterial.reason, numericDiagnostic(comparison, unavailableMaterial, \"numeric-value-non-finite\", \"the numeric value is not finite\"));\n }\n if (material.state === \"exact\") {\n return compareExact(material.value, comparison)\n ? matched(material.value)\n : mismatched(numericDiagnostic(comparison, material, \"numeric-comparison-failed\", \"the numeric comparison did not match\"));\n }\n const decided = comparison.comparator === \"between\"\n ? material.value > comparison.upperThreshold! ? \"mismatched\" : undefined\n : comparison.comparator === \"at-most\"\n ? material.value > comparison.threshold\n ? \"mismatched\"\n : undefined\n : comparison.comparator === \"less-than\"\n ? material.value >= comparison.threshold\n ? \"mismatched\"\n : undefined\n : comparison.comparator === \"at-least\"\n ? material.value >= comparison.threshold\n ? \"matched\"\n : undefined\n : material.value > comparison.threshold\n ? \"matched\"\n : undefined;\n if (decided === \"matched\")\n return matched(material.value);\n if (decided === \"mismatched\") {\n return mismatched(numericDiagnostic(comparison, material, \"numeric-lower-bound-exceeded\", \"the known lower bound decides the numeric comparison\"));\n }\n return unavailable(\"partial-numeric-material\", numericDiagnostic(comparison, material, \"numeric-lower-bound-inconclusive\", \"the known lower bound cannot decide the numeric comparison\"));\n}\nfunction numericMatch<U extends Unit | undefined>(comparator: NumericComparator, input: number | Quantity, upper?: number | Quantity): NumericComparisonMatch<U> {\n const threshold = isQuantity(input) ? input.value : input;\n const unit = isQuantity(input) ? input.unit : undefined;\n if (typeof threshold !== \"number\" || !Number.isFinite(threshold)) {\n throw new TypeError(`${comparator} threshold must be a finite number`);\n }\n const upperThreshold = isQuantity(upper) ? upper.value : upper;\n if (comparator === \"between\") {\n if ((isQuantity(upper) ? upper.unit : undefined) !== unit)\n throw new TypeError(\"between() bounds must have the same unit.\");\n if (typeof upperThreshold !== \"number\" || !Number.isFinite(upperThreshold) || upperThreshold < threshold) {\n throw new RangeError(\"between() requires finite, ordered inclusive bounds.\");\n }\n }\n const comparison = Object.freeze({ comparator, threshold, ...(upperThreshold === undefined ? {} : { upperThreshold }), ...(unit === undefined ? {} : { unit }) });\n const match = createBooleanMatch<number | Quantity, number | Quantity, \"value\">(\"value\", `${comparator}(${formatNumericUnit(threshold, unit)}${upperThreshold === undefined ? \"\" : `, ${formatNumericUnit(upperThreshold, unit)}`})`, (candidate) => {\n const result = evaluateNumericComparison(isQuantity(candidate)\n ? Object.freeze({ state: \"exact\" as const, value: candidate.value, unit: candidate.unit })\n : typeof candidate === \"number\" && Number.isFinite(candidate)\n ? Object.freeze({ state: \"exact\" as const, value: candidate })\n : Object.freeze({ state: \"unavailable\" as const, reason: \"non-finite-number\" }), comparison);\n return result.state === \"matched\" ? matched(candidate) : result;\n }) as unknown as NumericComparisonMatch<U>;\n numericComparisons.set(match, comparison);\n return match;\n}\nexport function lessThan<U extends Unit>(threshold: Quantity<U>): NumericComparisonMatch<U>;\nexport function lessThan(threshold: number): NumericComparisonMatch;\nexport function lessThan(threshold: number | Quantity): NumericComparisonMatch<any> {\n return numericMatch(\"less-than\", threshold);\n}\nexport function atMost<U extends Unit>(threshold: Quantity<U>): NumericComparisonMatch<U>;\nexport function atMost(threshold: number): NumericComparisonMatch;\nexport function atMost(threshold: number | Quantity): NumericComparisonMatch<any> {\n return numericMatch(\"at-most\", threshold);\n}\nexport function greaterThan<U extends Unit>(threshold: Quantity<U>): NumericComparisonMatch<U>;\nexport function greaterThan(threshold: number): NumericComparisonMatch;\nexport function greaterThan(threshold: number | Quantity): NumericComparisonMatch<any> {\n return numericMatch(\"greater-than\", threshold);\n}\nexport function atLeast<U extends Unit>(threshold: Quantity<U>): NumericComparisonMatch<U>;\nexport function atLeast(threshold: number): NumericComparisonMatch;\nexport function atLeast(threshold: number | Quantity): NumericComparisonMatch<any> {\n return numericMatch(\"at-least\", threshold);\n}\n/** Match a value inside inclusive bounds with the same unit. */\nexport function between<U extends Unit>(minimum: Quantity<U>, maximum: Quantity<NoInfer<U>>): NumericComparisonMatch<U>;\nexport function between(minimum: number, maximum: number): NumericComparisonMatch;\nexport function between(minimum: number | Quantity, maximum: number | Quantity): NumericComparisonMatch<any> {\n return numericMatch(\"between\", minimum, maximum);\n}\nfunction createScoreMatch<T>(name: string, evaluate: (candidate: T) => number | Promise<number>): ScoreMatch<T> {\n const result = {\n domain: \"value\" as const,\n name,\n kind: \"score\" as const,\n [matchInputBrand]: (_candidate: T) => undefined,\n [matchEvaluatorBrand]: async (candidate: T) => evaluate(candidate),\n };\n const match = Object.freeze(result) as ScoreMatch<T>;\n matchBrands.add(match);\n scoreEvaluators.set(match, (candidate) => Effect.tryPromise({\n try: () => Promise.resolve(evaluate(candidate as T)),\n catch: (cause) => cause,\n }));\n return match;\n}\nfunction freezeEventPosition(turnOrdinal: number, eventOrdinal: number): AssertionEventPosition {\n return Object.freeze({ turnOrdinal, eventOrdinal }) as AssertionEventPosition;\n}\nfunction assertionEventId(session: string, turn: string, turnOrdinal: number, eventOrdinal: number): AssertionEventIdentity {\n return JSON.stringify([\n \"niceeval.assertion-event/1\",\n session,\n turn,\n turnOrdinal,\n eventOrdinal,\n ]) as AssertionEventIdentity;\n}\n/** @internal Project a raw message into the closed assertion-event surface. */\nexport function makeAssertionMessageEvent(input: {\n readonly eventId?: string;\n readonly session: string;\n readonly turn: string;\n readonly turnOrdinal: number;\n readonly eventOrdinal: number;\n readonly role: \"assistant\" | \"user\";\n readonly text: string;\n}): Extract<AssertionEvent, {\n readonly type: \"message\";\n}> {\n return Object.freeze({\n id: input.eventId === undefined\n ? assertionEventId(input.session, input.turn, input.turnOrdinal, input.eventOrdinal)\n : input.eventId as AssertionEventIdentity,\n position: freezeEventPosition(input.turnOrdinal, input.eventOrdinal),\n type: \"message\" as const,\n role: input.role,\n text: input.text,\n });\n}\n/** @internal Project a correlated tool lifecycle row without exposing raw adapter fields. */\nexport function makeAssertionToolEvent(input: {\n readonly eventId?: string;\n readonly toolOccurrenceId?: string;\n readonly session: string;\n readonly turn: string;\n readonly turnOrdinal: number;\n readonly eventOrdinal: number;\n readonly type: \"operation.started\" | \"operation.finished\";\n readonly occurrence: LogicalToolOccurrence;\n readonly status?: \"completed\" | \"failed\" | \"rejected\";\n}): Extract<AssertionEvent, {\n readonly type: \"operation.started\" | \"operation.finished\";\n}> {\n const base = {\n id: input.eventId === undefined\n ? assertionEventId(input.session, input.turn, input.turnOrdinal, input.eventOrdinal)\n : input.eventId as AssertionEventIdentity,\n position: freezeEventPosition(input.turnOrdinal, input.eventOrdinal),\n tool: Object.freeze({\n id: (input.toolOccurrenceId ?? input.occurrence.id) as ToolOccurrenceIdentity,\n name: input.occurrence.name.canonical ?? input.occurrence.name.original,\n }),\n };\n const event = input.type === \"operation.started\"\n ? Object.freeze({ ...base, type: \"operation.started\" as const })\n : Object.freeze({\n ...base,\n type: \"operation.finished\" as const,\n status: input.status ?? (() => {\n throw new TypeError(\"operation.finished assertion event requires status\");\n })(),\n });\n assertionEventOccurrences.set(event, input.occurrence);\n return event;\n}\n/** @internal Retrieve the correlated occurrence for eventMatch(tool). */\nexport function assertionEventOccurrence(event: EventOccurrenceView): LogicalToolOccurrence | undefined {\n return assertionEventOccurrences.get(event);\n}\n/** 供 Assertion runtime / scope owner 消费 BooleanMatch;普通作者面不会导出此 evaluator。 */\nexport async function evaluateBooleanMatch<T, R extends T, D extends MatchDomain>(match: BooleanMatch<T, R, D>, candidate: T): Promise<BooleanMatchEvaluation<R>> {\n const internal = assertBooleanMatch(match, \"match\");\n const result = await internal[matchEvaluatorBrand](candidate);\n return assertBooleanEvaluation<R>(result, `matcher ${internal.name}`);\n}\n/** 供 Assertion runtime 消费 ScoreMatch。范围非法是 evaluator defect,绝不 clamp。 */\nexport function evaluateScoreMatch<T>(match: ScoreMatch<T>, candidate: T): Effect.Effect<number, unknown> {\n const internal = internalMatchOf(match, \"match\");\n if (internal.kind !== \"score\" || internal.domain !== \"value\") {\n throw new TypeError(\"match must be a value-domain ScoreMatch\");\n }\n const evaluate = scoreEvaluators.get(match);\n if (evaluate === undefined)\n throw new TypeError(\"match must be a managed ScoreMatch\");\n return evaluate(candidate).pipe(Effect.map((score) => {\n if (typeof score !== \"number\" || !Number.isFinite(score) || score < 0 || score > 1) {\n throw new TypeError(`matcher ${internal.name} returned a score outside finite [0, 1]`);\n }\n return score;\n }));\n}\nfunction hasPositiveWitnessCapability(match: BooleanMatch<unknown, unknown, \"value\">): boolean {\n return (internalMatchOf(match, \"input matcher\") as InternalMatch)[positiveWitnessBrand] === true;\n}\nfunction assertNonEmptyString(value: unknown, label: string): asserts value is string {\n if (typeof value !== \"string\" || value.length === 0)\n throw new TypeError(`${label} must be a non-empty string`);\n}\nfunction assertPlainOptions(value: unknown, label: string, allowed: readonly string[]): globalThis.Record<string, unknown> {\n if (value === undefined)\n return {};\n if (!isRecord(value) || Array.isArray(value))\n throw new TypeError(`${label} must be an options object`);\n for (const key of Object.keys(value)) {\n if (!allowed.includes(key))\n throw new TypeError(`${label} does not support option ${JSON.stringify(key)}`);\n }\n return value as globalThis.Record<string, unknown>;\n}\nfunction quoted(value: string): string {\n return JSON.stringify(value);\n}\nfunction jsonPreview(value: JsonValue): string {\n const serialized = JSON.stringify(value);\n const characters = Array.from(serialized);\n const limit = assertionRuntimeLimits.displayCodePoints;\n return characters.length <= limit\n ? serialized\n : `${characters.slice(0, limit - 1).join(\"\")}…`;\n}\nfunction resultChild(result: BooleanMatchEvaluation<unknown>, index: number, label?: string): MatchDiagnosticChild {\n return Object.freeze({\n index,\n ...(label === undefined ? {} : { label }),\n state: result.state,\n ...(result.diagnostic === undefined ? {} : { diagnostic: result.diagnostic }),\n });\n}\nfunction combineConjunction<T, R extends T>(candidate: T, name: string, fields: readonly {\n readonly label: string;\n readonly result: BooleanMatchEvaluation<unknown>;\n}[]): BooleanMatchEvaluation<R> {\n const children = fields.map((field, index) => resultChild(field.result, index, field.label));\n const mismatch = fields.find((field) => field.result.state === \"mismatched\");\n if (mismatch !== undefined) {\n return mismatched(diagnostic(\"all-of-mismatch\", `${name} had a definite mismatch`, {\n expected: \"all matcher fields matched\",\n children,\n }));\n }\n const missing = fields.find((field) => field.result.state === \"unavailable\");\n if (missing !== undefined) {\n const reason = (missing.result as Extract<BooleanMatchEvaluation<unknown>, {\n readonly state: \"unavailable\";\n }>).reason;\n return unavailable(reason, diagnostic(\"all-of-unavailable\", `${name} could not be decided from available evidence`, {\n expected: \"all matcher fields matched\",\n reason,\n children,\n }));\n }\n return matched(candidate as R, diagnostic(\"all-of-match\", `${name} matched all fields`, { children }));\n}\nasync function evaluateFields(fields: readonly {\n readonly label: string;\n readonly evaluate: () => Promise<BooleanMatchEvaluation<unknown>>;\n}[]): Promise<readonly {\n readonly label: string;\n readonly result: BooleanMatchEvaluation<unknown>;\n}[]> {\n const results: {\n label: string;\n result: BooleanMatchEvaluation<unknown>;\n }[] = [];\n let hasDefect = false;\n let firstDefect: unknown;\n // 不短路:组合的结构化诊断必须保留每个 child;defect 在所有可执行 child 完成后原样抛出。\n for (const field of fields) {\n try {\n results.push({ label: field.label, result: await field.evaluate() });\n }\n catch (error) {\n if (!hasDefect) {\n hasDefect = true;\n firstDefect = error;\n }\n }\n }\n if (hasDefect)\n throw firstDefect;\n return results;\n}\nfunction booleanCompositionName(operator: \"and\" | \"or\", matches: readonly {\n readonly name: string;\n}[]): string {\n return `${operator}(${matches.map((match) => match.name).join(\", \")})`;\n}\nfunction assertComposableMatches(first: unknown, rest: readonly unknown[], operator: \"and\" | \"or\"): {\n readonly domain: MatchDomain;\n readonly matches: readonly BooleanMatch<unknown, unknown, MatchDomain>[];\n} {\n if (rest.length === 0)\n throw new TypeError(`${operator}() requires at least two BooleanMatch values`);\n const firstInternal = assertBooleanMatch(first, `${operator}() first argument`);\n const matches: BooleanMatch<unknown, unknown, MatchDomain>[] = [\n first as BooleanMatch<unknown, unknown, MatchDomain>,\n ];\n for (const [index, match] of rest.entries()) {\n const internal = assertBooleanMatch(match, `${operator}() argument ${index + 2}`);\n if (internal.domain !== firstInternal.domain) {\n throw new TypeError(`${operator}() cannot combine ${firstInternal.domain}-domain and ${internal.domain}-domain matchers`);\n }\n matches.push(match as BooleanMatch<unknown, unknown, MatchDomain>);\n }\n return { domain: firstInternal.domain, matches };\n}\nexport function and<T, R extends T, D extends MatchDomain, const Rest extends readonly [\n BooleanMatch<NoInfer<T>, T, NoInfer<D>>,\n ...BooleanMatch<NoInfer<T>, T, NoInfer<D>>[]\n]>(first: BooleanMatch<T, R, D>, ...rest: Rest): BooleanMatchForDomain<T, T & R & RefinementIntersection<Rest>, D>;\nexport function and(first: BooleanMatch<unknown, unknown, MatchDomain>, ...rest: readonly BooleanMatch<unknown, unknown, MatchDomain>[]): BooleanMatch<unknown, unknown, MatchDomain> {\n const composition = assertComposableMatches(first, rest, \"and\");\n const name = booleanCompositionName(\"and\", composition.matches);\n return createBooleanMatch(composition.domain, name, async (candidate: unknown) => {\n const fields = await evaluateFields(composition.matches.map((match, index) => ({\n label: match.name || `matcher ${index}`,\n evaluate: () => evaluateBooleanMatch(match, candidate),\n })));\n return combineConjunction(candidate, name, fields);\n });\n}\nexport function or<T, R extends T, D extends MatchDomain, const Rest extends readonly [\n BooleanMatch<NoInfer<T>, T, NoInfer<D>>,\n ...BooleanMatch<NoInfer<T>, T, NoInfer<D>>[]\n]>(first: BooleanMatch<T, R, D>, ...rest: Rest): BooleanMatchForDomain<T, T & (R | RefinementOf<Rest[number]>), D>;\nexport function or(first: BooleanMatch<unknown, unknown, MatchDomain>, ...rest: readonly BooleanMatch<unknown, unknown, MatchDomain>[]): BooleanMatch<unknown, unknown, MatchDomain> {\n const composition = assertComposableMatches(first, rest, \"or\");\n const name = booleanCompositionName(\"or\", composition.matches);\n return createBooleanMatch(composition.domain, name, async (candidate: unknown) => {\n const fields = await evaluateFields(composition.matches.map((match, index) => ({\n label: match.name || `matcher ${index}`,\n evaluate: () => evaluateBooleanMatch(match, candidate),\n })));\n const children = fields.map((field, index) => resultChild(field.result, index, field.label));\n if (fields.some((field) => field.result.state === \"matched\")) {\n return matched(candidate, diagnostic(\"any-of-match\", `${name} matched at least one child`, { children }));\n }\n const missing = fields.find((field) => field.result.state === \"unavailable\");\n if (missing !== undefined) {\n const reason = (missing.result as Extract<BooleanMatchEvaluation<unknown>, {\n readonly state: \"unavailable\";\n }>).reason;\n return unavailable(reason, diagnostic(\"any-of-unavailable\", `${name} had no definite match and incomplete evidence`, {\n expected: \"at least one matcher matched\",\n reason,\n children,\n }));\n }\n return mismatched(diagnostic(\"any-of-mismatch\", `${name} had no matching child`, {\n expected: \"at least one matcher matched\",\n children,\n }));\n });\n}\nexport function not<T, R extends T>(match: BooleanMatch<T, R, \"value\">): BooleanMatch<T, T, \"value\"> {\n assertBooleanMatch(match, \"not() argument\", \"value\");\n return createBooleanMatch(\"value\", `not(${match.name})`, async (candidate) => {\n const result = await evaluateBooleanMatch(match, candidate);\n if (result.state === \"matched\") {\n return mismatched(diagnostic(\"not-mismatch\", `not(${match.name}) failed because its child matched`, {\n expected: `not ${match.name}`,\n children: [resultChild(result, 0, match.name)],\n }));\n }\n if (result.state === \"mismatched\") {\n return matched(candidate, diagnostic(\"not-match\", `not(${match.name}) matched`, {\n children: [resultChild(result, 0, match.name)],\n }));\n }\n return unavailable(result.reason, diagnostic(\"not-unavailable\", `not(${match.name}) could not decide its child`, {\n expected: `not ${match.name}`,\n reason: result.reason,\n children: [resultChild(result, 0, match.name)],\n }));\n });\n}\nexport interface TextMatchOptions {\n readonly stripComments?: boolean;\n}\nfunction normalizeTextOptions(value: unknown, label: string): Readonly<TextMatchOptions> {\n const options = assertPlainOptions(value, label, [\"stripComments\"]);\n if (options.stripComments !== undefined && typeof options.stripComments !== \"boolean\") {\n throw new TypeError(`${label}.stripComments must be a boolean`);\n }\n return Object.freeze(options as TextMatchOptions);\n}\nfunction textCandidate(value: unknown, options: TextMatchOptions): string | undefined {\n if (typeof value !== \"string\")\n return undefined;\n return options.stripComments === true ? stripComments(value) : value;\n}\n// @concord-code\n// @concord-implements docs/feature/assertions/library/value-assertions.md\n// @concord-implements docs/feature/eval/use-case/first-single-turn.md\nexport function includes(text: string, options?: TextMatchOptions): BooleanMatch<string, string> {\n assertNonEmptyString(text, \"includes() text\");\n const normalizedOptions = normalizeTextOptions(options, \"includes() options\");\n const name = `includes(${quoted(text)})`;\n return createBooleanMatch(\"value\", name, (value) => {\n const candidate = textCandidate(value, normalizedOptions);\n if (candidate === undefined) {\n return mismatched(diagnostic(\"text-candidate-type\", `${name} only accepts string candidates`, { expected: \"string\" }));\n }\n if (candidate.includes(text)) {\n return matched(value, diagnostic(\"text-includes-match\", `${name} found the literal text`, { expected: quoted(text) }));\n }\n return mismatched(diagnostic(\"text-includes-mismatch\", `${name} did not find the literal text`, { expected: quoted(text) }));\n });\n}\nexport function excludes(text: string, options?: TextMatchOptions): BooleanMatch<string, string> {\n assertNonEmptyString(text, \"excludes() text\");\n const normalizedOptions = normalizeTextOptions(options, \"excludes() options\");\n const name = `excludes(${quoted(text)})`;\n return createBooleanMatch(\"value\", name, (value) => {\n const candidate = textCandidate(value, normalizedOptions);\n if (candidate === undefined) {\n return mismatched(diagnostic(\"text-candidate-type\", `${name} only accepts string candidates`, { expected: \"string\" }));\n }\n if (!candidate.includes(text)) {\n return matched(value, diagnostic(\"text-excludes-match\", `${name} did not find the literal text`, { expected: quoted(text) }));\n }\n return mismatched(diagnostic(\"text-excludes-mismatch\", `${name} found excluded literal text`, { expected: quoted(text) }));\n });\n}\nexport function pattern(expression: RegExp, options?: TextMatchOptions): BooleanMatch<string, string> {\n if (!(expression instanceof RegExp))\n throw new TypeError(\"pattern() expression must be a RegExp\");\n const normalizedOptions = normalizeTextOptions(options, \"pattern() options\");\n const name = `pattern(${expression.toString()})`;\n return createBooleanMatch(\"value\", name, (value) => {\n const candidate = textCandidate(value, normalizedOptions);\n if (candidate === undefined) {\n return mismatched(diagnostic(\"text-candidate-type\", `${name} only accepts string candidates`, { expected: \"string\" }));\n }\n // 新 clone 的 lastIndex 从零开始,既满足 g/y 每次独立求值,也完全不修改作者实例。\n const isolatedExpression = new RegExp(expression.source, expression.flags);\n isolatedExpression.lastIndex = 0;\n if (isolatedExpression.test(candidate)) {\n return matched(value, diagnostic(\"pattern-match\", `${name} matched`, { expected: expression.toString() }));\n }\n return mismatched(diagnostic(\"pattern-mismatch\", `${name} did not match`, { expected: expression.toString() }));\n });\n}\n/** 归一化 Levenshtein similarity;它是连续分数,不携带默认阈值或 verdict 策略。 */\nexport function similarity(expected: string): ScoreMatch<string> {\n if (typeof expected !== \"string\")\n throw new TypeError(\"similarity() expected must be a string\");\n const name = `similarity(${quoted(expected)})`;\n return createScoreMatch(name, (value) => {\n if (typeof value !== \"string\")\n throw new TypeError(`${name} only accepts string candidates`);\n const maxLength = Math.max(value.length, expected.length);\n if (maxLength === 0)\n return 1;\n return 1 - levenshtein(value, expected) / maxLength;\n });\n}\nfunction levenshtein(a: string, b: string): number {\n if (a.length === 0)\n return b.length;\n if (b.length === 0)\n return a.length;\n let previous = Array.from({ length: b.length + 1 }, (_unused, index) => index);\n let current = new Array<number>(b.length + 1);\n for (let row = 1; row <= a.length; row += 1) {\n current[0] = row;\n for (let column = 1; column <= b.length; column += 1) {\n const substitution = a.charCodeAt(row - 1) === b.charCodeAt(column - 1) ? 0 : 1;\n current[column] = Math.min(previous[column]! + 1, current[column - 1]! + 1, previous[column - 1]! + substitution);\n }\n [previous, current] = [current, previous];\n }\n return previous[b.length]!;\n}\n/** 至少含 min 个去重 http(s) URL 的纯文本 matcher。 */\nexport function includesUrl(min = 1): BooleanMatch<string, string> {\n const name = `includesUrl(min=${min})`;\n return createBooleanMatch(\"value\", name, (value) => {\n if (typeof value !== \"string\") {\n return mismatched(diagnostic(\"text-candidate-type\", `${name} only accepts string candidates`, { expected: \"string\" }));\n }\n const urls = new Set(value.match(/https?:\\/\\/[^\\s<>()\"'\\x60]+/g) ?? []);\n if (urls.size >= min) {\n return matched(value, diagnostic(\"url-count-match\", `${name} found enough distinct URLs`, { expected: `>= ${min}` }));\n }\n return mismatched(diagnostic(\"url-count-mismatch\", `${name} did not find enough distinct URLs`, { expected: `>= ${min}` }));\n });\n}\n/** 至少含 min 个 Markdown heading 的纯文本 matcher。 */\nexport function hasSections(min = 2): BooleanMatch<string, string> {\n const name = `hasSections(min=${min})`;\n return createBooleanMatch(\"value\", name, (value) => {\n if (typeof value !== \"string\") {\n return mismatched(diagnostic(\"text-candidate-type\", `${name} only accepts string candidates`, { expected: \"string\" }));\n }\n const count = (value.match(/^#{1,6}\\s+\\S/gm) ?? []).length;\n if (count >= min) {\n return matched(value, diagnostic(\"heading-count-match\", `${name} found enough headings`, { expected: `>= ${min}` }));\n }\n return mismatched(diagnostic(\"heading-count-mismatch\", `${name} did not find enough headings`, { expected: `>= ${min}` }));\n });\n}\nfunction optionalLabel(label: string | undefined, factory: string): string {\n if (label !== undefined && typeof label !== \"string\")\n throw new TypeError(`${factory}() label must be a string`);\n return label === undefined || label.length === 0 ? `${factory}()` : `${factory}(${label})`;\n}\n/** 非 null / undefined 的 value matcher;泛型调用可保留原 candidate 的非空收窄。 */\nexport function isDefined(label?: string): BooleanMatch<unknown, {}>;\nexport function isDefined<T>(label?: string): BooleanMatch<T, Exclude<T, null | undefined>>;\nexport function isDefined<T = unknown>(label?: string): BooleanMatch<T, Exclude<T, null | undefined>> {\n const name = optionalLabel(label, \"isDefined\");\n return createBooleanMatch(\"value\", name, (value) => {\n if (value !== null && value !== undefined) {\n return matched(value as Exclude<T, null | undefined>, diagnostic(\"defined-match\", `${name} matched`, { expected: \"defined\" }));\n }\n return mismatched(diagnostic(\"defined-mismatch\", `${name} did not match`, { expected: \"defined\" }));\n });\n}\n/** value === true 的 refinement matcher。 */\nexport function isTrue<T = unknown>(label?: string): BooleanMatch<T, T & true> {\n const name = optionalLabel(label, \"isTrue\");\n return createBooleanMatch(\"value\", name, (value) => {\n if (value === true)\n return matched(value as T & true, diagnostic(\"true-match\", `${name} matched`, { expected: \"true\" }));\n return mismatched(diagnostic(\"true-mismatch\", `${name} did not match`, { expected: \"true\" }));\n });\n}\n/** value === false 的 refinement matcher。 */\nexport function isFalse<T = unknown>(label?: string): BooleanMatch<T, T & false> {\n const name = optionalLabel(label, \"isFalse\");\n return createBooleanMatch(\"value\", name, (value) => {\n if (value === false)\n return matched(value as T & false, diagnostic(\"false-match\", `${name} matched`, { expected: \"false\" }));\n return mismatched(diagnostic(\"false-mismatch\", `${name} did not match`, { expected: \"false\" }));\n });\n}\n/** CommandResult-like candidate 的 exitCode === 0 matcher;不读取 stdout / stderr。 */\nexport function commandSucceeded<T = unknown>(): BooleanMatch<T, T & {\n readonly exitCode: 0;\n}> {\n const name = \"commandSucceeded()\";\n return createBooleanMatch(\"value\", name, (value) => {\n if (value !== null && typeof value === \"object\" && (value as {\n readonly exitCode?: unknown;\n }).exitCode === 0) {\n return matched(value as T & {\n readonly exitCode: 0;\n }, diagnostic(\"command-succeeded\", `${name} matched`, { expected: \"exit 0\" }));\n }\n return mismatched(diagnostic(\"command-failed\", `${name} did not match`, { expected: \"exit 0\" }));\n });\n}\n/** 小而稳定的深相等:基本值、NaN、Array、Date 与 enumerable object properties。 */\nexport function deepEqual(a: unknown, b: unknown): boolean {\n return deepEqualInner(a, b, new Map<object, object>());\n}\nfunction deepEqualInner(a: unknown, b: unknown, seen: Map<object, object>): boolean {\n if (a === b)\n return true;\n if (typeof a === \"number\" && typeof b === \"number\" && Number.isNaN(a) && Number.isNaN(b))\n return true;\n if (a === null || b === null || typeof a !== \"object\" || typeof b !== \"object\")\n return false;\n if (a instanceof Date || b instanceof Date)\n return a instanceof Date && b instanceof Date && a.getTime() === b.getTime();\n const seenB = seen.get(a);\n if (seenB !== undefined)\n return seenB === b;\n seen.set(a, b);\n const aIsArray = Array.isArray(a);\n const bIsArray = Array.isArray(b);\n if (aIsArray !== bIsArray)\n return false;\n if (aIsArray && bIsArray) {\n if (a.length !== b.length)\n return false;\n for (let index = 0; index < a.length; index += 1) {\n if (!deepEqualInner(a[index], b[index], seen))\n return false;\n }\n return true;\n }\n const aObject = a as globalThis.Record<string, unknown>;\n const bObject = b as globalThis.Record<string, unknown>;\n const aKeys = Object.keys(aObject);\n const bKeys = Object.keys(bObject);\n if (aKeys.length !== bKeys.length)\n return false;\n for (const key of aKeys) {\n if (!Object.prototype.hasOwnProperty.call(bObject, key) || !deepEqualInner(aObject[key], bObject[key], seen)) {\n return false;\n }\n }\n return true;\n}\nexport function equals<const T>(expected: T): BooleanMatch<unknown, T> {\n const name = \"equals(value)\";\n return createBooleanMatch<unknown, T, \"value\">(\"value\", name, (candidate) => {\n if (deepEqual(candidate, expected))\n return matched(expected, diagnostic(\"equals-match\", `${name} matched`));\n return mismatched(diagnostic(\"equals-mismatch\", `${name} did not match`));\n });\n}\nfunction isStandardSchema(value: unknown): value is StandardSchema {\n if (!isRecord(value))\n return false;\n const standard = value[\"~standard\"];\n return isRecord(standard) && typeof standard.validate === \"function\";\n}\nfunction standardIssuePath(value: unknown, label: string): readonly MatchPathSegment[] {\n if (value === undefined)\n return [];\n if (!Array.isArray(value))\n throw new TypeError(`${label} returned a schema issue with an invalid path`);\n return value.map((segment) => {\n const key = isRecord(segment) && \"key\" in segment ? segment.key : segment;\n if (typeof key === \"string\" || typeof key === \"number\")\n return key;\n if (typeof key === \"symbol\")\n return String(key);\n throw new TypeError(`${label} returned a schema issue with an invalid path segment`);\n });\n}\nexport function matches<S extends StandardSchema>(schema: S): BooleanMatch<unknown, StandardSchema.InferInput<S>, \"value\"> {\n if (!isStandardSchema(schema))\n throw new TypeError(\"matches() schema must implement Standard Schema v1\");\n const name = \"matches(schema)\";\n return createBooleanMatch(\"value\", name, async (candidate) => {\n const result = await schema[\"~standard\"].validate(candidate);\n if (!isRecord(result))\n throw new TypeError(`${name} schema returned an invalid result`);\n if (result.issues === undefined) {\n // Standard Schema output (including transforms) is intentionally ignored: Match refines the original candidate.\n return matched(candidate as StandardSchema.InferInput<S>, diagnostic(\"schema-match\", `${name} validated the original candidate`));\n }\n if (!Array.isArray(result.issues))\n throw new TypeError(`${name} schema returned invalid issues`);\n const children = result.issues.map((issue, index) => {\n if (!isRecord(issue) || typeof issue.message !== \"string\") {\n throw new TypeError(`${name} schema returned an invalid issue`);\n }\n const path = standardIssuePath(issue.path, name);\n return Object.freeze({\n index,\n state: \"mismatched\" as const,\n diagnostic: diagnostic(\"schema-issue\", issue.message, { path }),\n });\n });\n return mismatched(diagnostic(\"schema-mismatch\", `${name} rejected the candidate`, {\n expected: \"Standard Schema validation success\",\n children,\n }));\n });\n}\n/**\n * 旧 context 接线还会调用这一个内部 helper。它不再接受 Zod-style fallback;新的公共 matches()\n * 使用上面的严格 Standard Schema 入口,异常则由 evaluator 作为 defect 处理。\n */\nexport async function validateSchema(value: unknown, schema: unknown): Promise<boolean> {\n if (!isStandardSchema(schema))\n return false;\n try {\n const result = await schema[\"~standard\"].validate(value);\n return isRecord(result) && result.issues === undefined;\n }\n catch {\n return false;\n }\n}\nexport function satisfies<T, R extends T>(label: string, predicate: (value: T) => value is R): BooleanMatch<T, R>;\nexport function satisfies<T>(label: string, predicate: (value: T) => boolean | Promise<boolean>): BooleanMatch<T, T>;\nexport function satisfies<T, R extends T = T>(label: string, predicate: (value: T) => boolean | Promise<boolean>): BooleanMatch<T, R> | BooleanMatch<T, T> {\n assertNonEmptyString(label, \"satisfies() label\");\n if (typeof predicate !== \"function\")\n throw new TypeError(\"satisfies() predicate must be a function\");\n return createBooleanMatch<T, R, \"value\">(\"value\", `satisfies(${label})`, async (candidate) => {\n const value = await predicate(candidate);\n if (typeof value !== \"boolean\")\n throw new TypeError(`matcher satisfies(${label}) returned a non-boolean result`);\n if (value)\n return matched(candidate as R, diagnostic(\"value-match\", `satisfies(${label}) matched`));\n return mismatched(diagnostic(\"value-mismatch\", `satisfies(${label}) did not match`));\n });\n}\nexport function defineValueMatch<T, R extends T>(spec: {\n readonly name: string;\n readonly evaluate: (value: T) => value is R;\n}): BooleanMatch<T, R>;\nexport function defineValueMatch<T>(spec: {\n readonly name: string;\n readonly evaluate: (value: T) => boolean | {\n readonly state: \"unavailable\";\n readonly reason: string;\n } | Promise<boolean | {\n readonly state: \"unavailable\";\n readonly reason: string;\n }>;\n}): BooleanMatch<T, T>;\n// @concord-code\n// @concord-implements docs/feature/assertions/library/value-assertions.md\nexport function defineValueMatch<T, R extends T = T>(spec: {\n readonly name: string;\n readonly evaluate: (value: T) => boolean | {\n readonly state: \"unavailable\";\n readonly reason: string;\n } | Promise<boolean | {\n readonly state: \"unavailable\";\n readonly reason: string;\n }>;\n}): BooleanMatch<T, R> | BooleanMatch<T, T> {\n if (!isRecord(spec))\n throw new TypeError(\"defineValueMatch() spec must be an object\");\n assertNonEmptyString(spec.name, \"defineValueMatch() spec.name\");\n if (typeof spec.evaluate !== \"function\")\n throw new TypeError(\"defineValueMatch() spec.evaluate must be a function\");\n return createBooleanMatch<T, R, \"value\">(\"value\", spec.name, async (candidate) => {\n const value = await spec.evaluate(candidate);\n if (typeof value === \"object\" && value !== null && value.state === \"unavailable\" && typeof value.reason === \"string\" && value.reason.trim() !== \"\")\n return unavailable(value.reason, diagnostic(\"value-unavailable\", value.reason));\n if (typeof value !== \"boolean\")\n throw new TypeError(`matcher ${spec.name} returned a non-boolean result`);\n if (value)\n return matched(candidate as R, diagnostic(\"value-match\", `${spec.name} matched`));\n return mismatched(diagnostic(\"value-mismatch\", `${spec.name} did not match`));\n });\n}\nexport function defineScoreMatch<T, E = ScoreMatchLlmFailure>(spec: ManagedScoreMatchOptions<T, E>): ScoreMatch<T>;\nexport function defineScoreMatch<T>(spec: {\n readonly name: string;\n readonly score: (value: T) => number | Promise<number>;\n}): ScoreMatch<T>;\nexport function defineScoreMatch<T, E = ScoreMatchLlmFailure>(spec: ManagedScoreMatchOptions<T, E> | {\n readonly name: string;\n readonly score: (value: T) => number | Promise<number>;\n}): ScoreMatch<T> {\n const input = exactScoreMatchOptions(spec);\n assertNonEmptyString(input.name, \"defineScoreMatch() spec.name\");\n if (typeof input.score !== \"function\")\n throw new TypeError(\"defineScoreMatch() spec.score must be a function\");\n const managed = Object.hasOwn(input, \"llm\");\n const match = createScoreMatch<T>(input.name, async (candidate) => {\n if (managed)\n throw new TypeError(\"managed ScoreMatch must be evaluated by the Assertion runtime\");\n const score = await (input.score as (value: T) => number | Promise<number>)(candidate);\n if (typeof score !== \"number\" || !Number.isFinite(score) || score < 0 || score > 1) {\n throw new TypeError(`matcher ${input.name} returned a score outside finite [0, 1]`);\n }\n return score;\n });\n if (managed) {\n assertNonEmptyString(input.version, \"defineScoreMatch() spec.version\");\n if (!Object.hasOwn(input, \"config\"))\n throw new TypeError(\"defineScoreMatch() managed spec requires config\");\n const config = snapshotScoreMatchJson(input.config, \"defineScoreMatch() spec.config\");\n const llm = exactLlmOptions(input.llm);\n const definition: ManagedScoreMatchDefinition<unknown, unknown> = Object.freeze({\n name: input.name,\n version: input.version,\n config,\n canonicalConfig: canonicalScoreMatchJson(config),\n llm,\n score: input.score as ManagedScoreMatchDefinition<unknown, unknown>[\"score\"],\n });\n managedScoreMatches.set(match, definition);\n }\n return match;\n}\nfunction exactScoreMatchOptions(value: unknown): Readonly<Record<string, unknown>> {\n if (!isRecord(value) || Array.isArray(value))\n throw new TypeError(\"defineScoreMatch() spec must be an object\");\n const managed = Object.hasOwn(value, \"llm\") || Object.hasOwn(value, \"version\") || Object.hasOwn(value, \"config\");\n const allowed = managed ? [\"name\", \"version\", \"config\", \"llm\", \"score\"] : [\"name\", \"score\"];\n const output: Record<string, unknown> = {};\n for (const key of Reflect.ownKeys(value)) {\n if (typeof key !== \"string\" || !allowed.includes(key)) {\n throw new TypeError(`defineScoreMatch() spec has unknown option ${String(key)}`);\n }\n const descriptor = Reflect.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !descriptor.enumerable || !(\"value\" in descriptor)) {\n throw new TypeError(`defineScoreMatch() spec.${key} must be an enumerable data property`);\n }\n output[key] = descriptor.value;\n }\n if (!Object.hasOwn(output, \"name\") || !Object.hasOwn(output, \"score\")) {\n throw new TypeError(\"defineScoreMatch() spec requires name and score\");\n }\n if (managed && (!Object.hasOwn(output, \"version\") || !Object.hasOwn(output, \"config\") || !Object.hasOwn(output, \"llm\"))) {\n throw new TypeError(\"defineScoreMatch() managed spec requires version, config, and llm\");\n }\n return Object.freeze(output);\n}\nfunction boundedPositiveInteger(value: unknown, fallback: number, maximum: number, label: string): number {\n const resolved = value ?? fallback;\n if (typeof resolved !== \"number\" || !Number.isSafeInteger(resolved) || resolved <= 0 || resolved > maximum) {\n throw new TypeError(`${label} must be a positive integer at most ${maximum}`);\n }\n return resolved;\n}\n/** @internal Shared managed-model budget validation. */\nexport function exactLlmOptions(value: unknown): ManagedScoreMatchDefinition[\"llm\"] {\n if (!isRecord(value) || Array.isArray(value))\n throw new TypeError(\"defineScoreMatch() spec.llm must be an object\");\n const allowed = [\"maxCalls\", \"maxMaterialBytes\", \"maxAuditBytes\"];\n const output: Record<string, unknown> = {};\n for (const key of Reflect.ownKeys(value)) {\n if (typeof key !== \"string\" || !allowed.includes(key))\n throw new TypeError(`defineScoreMatch() spec.llm has unknown option ${String(key)}`);\n const descriptor = Reflect.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !descriptor.enumerable || !(\"value\" in descriptor))\n throw new TypeError(`defineScoreMatch() spec.llm.${key} must be an enumerable data property`);\n output[key] = descriptor.value;\n }\n return Object.freeze({\n maxCalls: boundedPositiveInteger(output.maxCalls, 4, 16, \"defineScoreMatch() spec.llm.maxCalls\"),\n maxMaterialBytes: boundedPositiveInteger(output.maxMaterialBytes, 32 * 1024, 4 * 1024 * 1024, \"defineScoreMatch() spec.llm.maxMaterialBytes\"),\n maxAuditBytes: boundedPositiveInteger(output.maxAuditBytes, 96 * 1024, 8 * 1024 * 1024, \"defineScoreMatch() spec.llm.maxAuditBytes\"),\n });\n}\nfunction snapshotScoreMatchJson(value: unknown, label: string, state: {\n nodes: number;\n} = { nodes: 0 }, ancestors = new WeakSet<object>(), depth = 0): JsonValue {\n state.nodes += 1;\n if (state.nodes > 16384)\n throw new TypeError(`${label} exceeds 16,384 JSON nodes`);\n if (depth > 32)\n throw new TypeError(`${label} exceeds depth 32`);\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\")\n return value;\n if (typeof value === \"number\") {\n if (!Number.isFinite(value))\n throw new TypeError(`${label} numbers must be finite`);\n return Object.is(value, -0) ? 0 : value;\n }\n if (typeof value !== \"object\" || value === null)\n throw new TypeError(`${label} must contain only JSON values`);\n if (ancestors.has(value))\n throw new TypeError(`${label} cannot contain cycles`);\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n const keys = Reflect.ownKeys(value);\n if (keys.some((key) => key !== \"length\" && !(typeof key === \"string\" && /^(?:0|[1-9][0-9]*)$/u.test(key) && Number(key) < value.length))) {\n throw new TypeError(`${label} arrays cannot contain custom properties`);\n }\n const output: JsonValue[] = [];\n for (let index = 0; index < value.length; index += 1) {\n const descriptor = Reflect.getOwnPropertyDescriptor(value, String(index));\n if (descriptor === undefined || !(\"value\" in descriptor) || descriptor.value === undefined)\n throw new TypeError(`${label} arrays cannot contain holes, accessors, or undefined`);\n output.push(snapshotScoreMatchJson(descriptor.value, `${label}[${index}]`, state, ancestors, depth + 1));\n }\n return Object.freeze(output) as unknown as JsonValue;\n }\n const prototype = Reflect.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null)\n throw new TypeError(`${label} objects must be plain objects`);\n const entries: Array<readonly [\n string,\n JsonValue\n ]> = [];\n for (const key of Reflect.ownKeys(value)) {\n if (typeof key !== \"string\")\n throw new TypeError(`${label} cannot contain symbol keys`);\n const descriptor = Reflect.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !descriptor.enumerable)\n continue;\n if (!(\"value\" in descriptor) || descriptor.value === undefined)\n throw new TypeError(`${label}.${key} must be a JSON data property`);\n entries.push([key, snapshotScoreMatchJson(descriptor.value, `${label}.${key}`, state, ancestors, depth + 1)]);\n }\n return Object.freeze(Object.fromEntries(entries.sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0))) as JsonValue;\n }\n finally {\n ancestors.delete(value);\n }\n}\nfunction canonicalScoreMatchJson(value: JsonValue): string {\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\" || typeof value === \"number\")\n return JSON.stringify(value);\n if (Array.isArray(value))\n return `[${value.map(canonicalScoreMatchJson).join(\",\")}]`;\n return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonicalScoreMatchJson(value[key]!)}`).join(\",\")}}`;\n}\ninterface ReferencePathPattern {\n readonly original: string;\n readonly components: readonly string[];\n readonly matcher: RegExp;\n}\nfunction escapeRegExp(value: string): string {\n return value.replace(/[\\\\^$.*+?()[\\]{}|]/g, \"\\\\$&\");\n}\nfunction normalizeReferencePath(value: unknown, label: string): readonly string[] {\n assertNonEmptyString(value, label);\n const components = value.split(/[\\\\/]+/u).filter((component) => component.length > 0 && component !== \".\");\n if (components.length === 0)\n throw new TypeError(`${label} normalizes to an empty path`);\n return Object.freeze(components);\n}\nfunction pathPattern(components: readonly string[]): RegExp {\n // Whitespace / quoting can bound a path embedded in a tool input, while '-' and '.' stay in a component so\n // `agents` cannot match `agents-old` and `.niceeval` cannot match `.niceevaluation`.\n const componentChar = \"\\\\p{L}\\\\p{N}_.-\";\n const betweenComponents = \"[\\\\\\\\/]+(?:\\\\.[\\\\\\\\/]+)*\";\n const source = components.map(escapeRegExp).join(betweenComponents);\n return new RegExp(`(?<![${componentChar}])${source}(?![${componentChar}])`, \"u\");\n}\nfunction normalizeReferencePatterns(paths: readonly [\n string,\n ...string[]\n]): readonly ReferencePathPattern[] {\n if (!Array.isArray(paths) || paths.length === 0)\n throw new TypeError(\"referencesAnyPath() requires at least one path\");\n const seen = new Set<string>();\n const patterns = paths.map((path, index) => {\n const components = normalizeReferencePath(path, `referencesAnyPath() paths[${index}]`);\n const identity = components.join(\"\\u0000\");\n if (seen.has(identity))\n throw new TypeError(`referencesAnyPath() has duplicate normalized path ${quoted(path)}`);\n seen.add(identity);\n return Object.freeze({ original: path, components, matcher: pathPattern(components) });\n });\n return Object.freeze(patterns);\n}\ninterface PathWitness {\n readonly pointer: string;\n readonly pattern: ReferencePathPattern;\n}\nfunction jsonPointerSegment(value: string | number): string {\n return String(value).replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\nfunction isPlainJsonObject(value: object): value is globalThis.Record<string, unknown> {\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\nfunction isArrayIndexKey(key: string, length: number): boolean {\n if (!/^(?:0|[1-9][0-9]*)$/u.test(key))\n return false;\n const index = Number(key);\n return Number.isSafeInteger(index) && index >= 0 && index < length;\n}\nfunction findReferencedPath(value: unknown, patterns: readonly ReferencePathPattern[], pointer = \"\", ancestors = new WeakSet<object>()): PathWitness | undefined {\n if (typeof value === \"string\") {\n const pattern = patterns.find((candidate) => {\n candidate.matcher.lastIndex = 0;\n return candidate.matcher.test(value);\n });\n return pattern === undefined ? undefined : { pointer, pattern };\n }\n if (value === null || typeof value === \"boolean\")\n return undefined;\n if (typeof value === \"number\") {\n if (!Number.isFinite(value))\n throw new TypeError(\"referencesAnyPath() received a non-JSON number\");\n return undefined;\n }\n if (typeof value !== \"object\")\n throw new TypeError(\"referencesAnyPath() received a non-JSON value\");\n if (ancestors.has(value))\n throw new TypeError(\"referencesAnyPath() received a cyclic JSON value\");\n ancestors.add(value);\n try {\n if (Array.isArray(value)) {\n for (const key of Object.keys(value)) {\n if (!isArrayIndexKey(key, value.length)) {\n throw new TypeError(\"referencesAnyPath() received a non-JSON array property\");\n }\n }\n for (let index = 0; index < value.length; index += 1) {\n const descriptor = Object.getOwnPropertyDescriptor(value, String(index));\n if (descriptor === undefined || !(\"value\" in descriptor)) {\n throw new TypeError(\"referencesAnyPath() received a sparse array or accessor\");\n }\n const witness = findReferencedPath(descriptor.value, patterns, `${pointer}/${index}`, ancestors);\n if (witness !== undefined)\n return witness;\n }\n return undefined;\n }\n if (!isPlainJsonObject(value))\n throw new TypeError(\"referencesAnyPath() received a non-plain JSON object\");\n for (const key of Object.keys(value)) {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !(\"value\" in descriptor)) {\n throw new TypeError(\"referencesAnyPath() received an accessor property\");\n }\n const witness = findReferencedPath(descriptor.value, patterns, `${pointer}/${jsonPointerSegment(key)}`, ancestors);\n if (witness !== undefined)\n return witness;\n }\n return undefined;\n }\n finally {\n ancestors.delete(value);\n }\n}\nexport function referencesAnyPath(paths: readonly [\n string,\n ...string[]\n]): BooleanMatch<JsonValue, JsonValue, \"value\"> {\n const patterns = normalizeReferencePatterns(paths);\n const name = `referencesAnyPath(${patterns.length} paths)`;\n return createBooleanMatch(\"value\", name, (candidate) => {\n const witness = findReferencedPath(candidate, patterns);\n if (witness !== undefined) {\n return matched(candidate, diagnostic(\"path-reference-match\", `${name} found a referenced path`, {\n expected: witness.pattern.components.join(\"/\"),\n locator: { kind: \"json-pointer\", pointer: witness.pointer },\n }));\n }\n return mismatched(diagnostic(\"path-reference-mismatch\", `${name} found no referenced path`, {\n expected: patterns.map((pattern) => pattern.components.join(\"/\")).join(\" | \"),\n }));\n }, { positiveWitness: true });\n}\nexport type ToolStatus = Extract<LogicalToolOccurrence[\"lifecycle\"], {\n readonly state: \"available\";\n}>[\"status\"];\nexport interface CommandMatchOptions {\n readonly argsStart?: readonly string[];\n readonly excludes?: readonly string[];\n readonly status?: ToolStatus;\n}\nexport interface ToolMatchOptions {\n readonly input?: BooleanMatch<JsonValue, JsonValue, \"value\">;\n readonly output?: BooleanMatch<JsonValue, JsonValue, \"value\">;\n readonly status?: ToolStatus;\n}\n/**\n * Turns the recursive JsonMatch language into a managed value Match. Raw\n * JsonMatch stays at this explicit bridge; tool assertions consume only the\n * branded Match so every tool field follows the same evaluator path.\n */\nexport function jsonMatch(expected: JsonMatch): BooleanMatch<JsonValue, JsonValue, \"value\"> {\n const normalized = normalizeJsonMatch(expected, \"jsonMatch() expected\");\n const name = \"jsonMatch(...)\";\n return createBooleanMatch(\"value\", name, (candidate) => {\n if (matchesJson(candidate, normalized)) {\n return matched(candidate, diagnostic(\"json-match\", `${name} matched`));\n }\n return mismatched(diagnostic(\"json-mismatch\", `${name} did not match`, {\n expected: \"the supplied JsonMatch pattern\",\n received: \"the candidate JSON value\",\n }));\n });\n}\nfunction normalizeJsonMatch(value: unknown, label: string, active = new WeakSet<object>()): JsonMatch {\n if (value === null || typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n if (typeof value === \"number\" && !Number.isFinite(value)) {\n throw new TypeError(`${label} must not contain a non-finite number`);\n }\n return value;\n }\n if (value instanceof RegExp)\n return new RegExp(value.source, value.flags);\n if (typeof value === \"function\")\n return value as (candidate: unknown) => boolean;\n if (typeof value !== \"object\")\n throw new TypeError(`${label} must be a JsonMatch value`);\n if (active.has(value))\n throw new TypeError(`${label} must not be cyclic`);\n active.add(value);\n try {\n if (Array.isArray(value)) {\n return Object.freeze(value.map((item, index) => normalizeJsonMatch(item, `${label}[${index}]`, active)));\n }\n if (!isPlainJsonObject(value))\n throw new TypeError(`${label} must use a plain object`);\n const entries: [\n string,\n JsonMatch\n ][] = [];\n for (const key of Object.keys(value)) {\n const descriptor = Object.getOwnPropertyDescriptor(value, key);\n if (descriptor === undefined || !(\"value\" in descriptor)) {\n throw new TypeError(`${label}.${key} must not be an accessor`);\n }\n entries.push([key, normalizeJsonMatch(descriptor.value, `${label}.${key}`, active)]);\n }\n return Object.freeze(Object.fromEntries(entries));\n }\n finally {\n active.delete(value);\n }\n}\nfunction normalizeStatus(value: unknown, label: string): ToolStatus | undefined {\n if (value === undefined)\n return undefined;\n if (value === \"pending\" || value === \"completed\" || value === \"failed\" || value === \"rejected\")\n return value;\n throw new TypeError(`${label} must be pending, completed, failed, or rejected`);\n}\nfunction normalizeTokens(value: unknown, label: string, unique: boolean): readonly string[] | undefined {\n if (value === undefined)\n return undefined;\n if (!Array.isArray(value))\n throw new TypeError(`${label} must be an array of command tokens`);\n const tokens = value.map((token, index) => {\n assertNonEmptyString(token, `${label}[${index}]`);\n return token;\n });\n if (unique && new Set(tokens).size !== tokens.length)\n throw new TypeError(`${label} must not contain duplicate tokens`);\n return Object.freeze(tokens);\n}\nfunction lifecycleResult(occurrence: LogicalToolOccurrence, expected: ToolStatus | undefined): BooleanMatchEvaluation<unknown> {\n const lifecycle = occurrence.lifecycle;\n if (!isRecord(lifecycle) || (lifecycle.state !== \"available\" && lifecycle.state !== \"opaque\")) {\n throw new TypeError(\"tool occurrence has an invalid lifecycle envelope\");\n }\n if (lifecycle.state === \"opaque\") {\n if (typeof lifecycle.reason !== \"string\" || lifecycle.reason.length === 0) {\n throw new TypeError(\"tool occurrence has an opaque lifecycle without a reason\");\n }\n return unavailable(lifecycle.reason, diagnostic(\"tool-lifecycle-unavailable\", \"tool lifecycle is not fully observed\", {\n expected,\n reason: lifecycle.reason,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n if (expected === undefined) {\n return matched(occurrence, diagnostic(\"lifecycle-unrestricted\", \"lifecycle is unrestricted\", {\n received: lifecycle.status,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n if (lifecycle.status !== expected) {\n return mismatched(diagnostic(\"tool-status-mismatch\", \"tool lifecycle status did not match\", {\n expected,\n received: typeof lifecycle.status === \"string\" ? lifecycle.status : undefined,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n return matched(occurrence, diagnostic(\"tool-status-match\", \"tool lifecycle status matched\", {\n expected,\n received: lifecycle.status,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n}\nfunction occurrenceNameResult(occurrence: LogicalToolOccurrence, expected: string): BooleanMatchEvaluation<unknown> {\n if (!isRecord(occurrence.name) || typeof occurrence.name.original !== \"string\") {\n throw new TypeError(\"tool occurrence has an invalid name envelope\");\n }\n // `unknown` means the adapter could not map this domain-specific tool onto\n // NiceEval's canonical vocabulary. It must not hide the original name that\n // the author can still check exactly.\n const observed = occurrence.name.canonical === undefined || occurrence.name.canonical === \"unknown\"\n ? occurrence.name.original\n : occurrence.name.canonical;\n if (observed !== expected) {\n return mismatched(diagnostic(\"tool-name-mismatch\", \"tool name did not match\", {\n expected: quoted(expected),\n received: quoted(observed),\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n return matched(occurrence, diagnostic(\"tool-name-match\", \"tool name matched exactly\", {\n expected: quoted(expected),\n received: quoted(observed),\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n}\nasync function toolEvidenceResult(occurrence: LogicalToolOccurrence, field: \"input\" | \"output\", match: BooleanMatch<JsonValue, JsonValue, \"value\">): Promise<BooleanMatchEvaluation<unknown>> {\n const evidence = occurrence[field];\n if (!isRecord(evidence) || (evidence.state !== \"complete\" && evidence.state !== \"partial\" && evidence.state !== \"unavailable\")) {\n throw new TypeError(`tool occurrence has an invalid ${field} envelope`);\n }\n if (evidence.state === \"unavailable\") {\n if (typeof evidence.reason !== \"string\" || evidence.reason.length === 0) {\n throw new TypeError(`tool occurrence has unavailable ${field} without a reason`);\n }\n return unavailable(evidence.reason, diagnostic(`tool-${field}-unavailable`, `tool ${field} is unavailable`, {\n reason: evidence.reason,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n const result = await evaluateBooleanMatch(match, evidence.value);\n const base = result.diagnostic;\n const observedResult = Object.freeze({\n ...result,\n diagnostic: diagnostic(base?.code ?? `tool-${field}-${result.state}`, base?.message ?? `tool ${field} ${result.state}`, {\n path: base?.path,\n expected: base?.expected ?? match.name,\n received: jsonPreview(evidence.value),\n reason: base?.reason,\n locator: base?.locator ?? { kind: \"tool-occurrence\", id: occurrence.id },\n children: base?.children,\n truncation: base?.truncation,\n }),\n }) as BooleanMatchEvaluation<unknown>;\n if (evidence.state === \"complete\")\n return observedResult;\n // partial input can only produce a positive result when the matcher itself carries the narrowed witness\n // capability. A visible reference hit survives hidden leaves; general predicates / schema checks do not.\n if (result.state === \"matched\" && hasPositiveWitnessCapability(match as BooleanMatch<unknown, unknown, \"value\">)) {\n return observedResult;\n }\n return unavailable(`tool-${field}-coverage-partial`, diagnostic(`tool-${field}-coverage-partial`, `tool ${field} is partial without a decisive positive witness`, {\n reason: `tool-${field}-coverage-partial`,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n ...(Array.isArray(evidence.opaquePointers) ? { received: evidence.opaquePointers.join(\",\") } : {}),\n }));\n}\nexport function toolMatch(name: string, options?: ToolMatchOptions): ToolMatch;\nexport function toolMatch(options: ToolMatchOptions | Record<string, never>): ToolMatch;\nexport function toolMatch(nameOrOptions: string | ToolMatchOptions, options?: ToolMatchOptions): ToolMatch {\n let expectedName: string | undefined;\n let input: BooleanMatch<JsonValue, JsonValue, \"value\"> | undefined;\n let output: BooleanMatch<JsonValue, JsonValue, \"value\"> | undefined;\n let status: ToolStatus | undefined;\n if (typeof nameOrOptions === \"string\") {\n assertNonEmptyString(nameOrOptions, \"toolMatch() name\");\n expectedName = nameOrOptions;\n const normalized = assertPlainOptions(options, \"toolMatch() options\", [\"input\", \"output\", \"status\"]);\n if (normalized.input !== undefined) {\n assertBooleanMatch(normalized.input, \"toolMatch() options.input\", \"value\");\n input = normalized.input as BooleanMatch<JsonValue, JsonValue, \"value\">;\n }\n if (normalized.output !== undefined) {\n assertBooleanMatch(normalized.output, \"toolMatch() options.output\", \"value\");\n output = normalized.output as BooleanMatch<JsonValue, JsonValue, \"value\">;\n }\n status = normalizeStatus(normalized.status, \"toolMatch() options.status\");\n }\n else {\n if (options !== undefined)\n throw new TypeError(\"toolMatch(options) does not accept a second argument\");\n const normalized = assertPlainOptions(nameOrOptions, \"toolMatch() options\", [\"input\", \"output\", \"status\"]);\n if (normalized.input !== undefined) {\n assertBooleanMatch(normalized.input, \"toolMatch() options.input\", \"value\");\n input = normalized.input as BooleanMatch<JsonValue, JsonValue, \"value\">;\n }\n if (normalized.output !== undefined) {\n assertBooleanMatch(normalized.output, \"toolMatch() options.output\", \"value\");\n output = normalized.output as BooleanMatch<JsonValue, JsonValue, \"value\">;\n }\n status = normalizeStatus(normalized.status, \"toolMatch() options.status\");\n }\n const unconstrained = expectedName === undefined\n && input === undefined\n && output === undefined\n && status === undefined;\n const name = expectedName === undefined\n ? unconstrained\n ? \"toolMatch({})\"\n : `toolMatch(${[\n input === undefined ? undefined : `input=${input.name}`,\n output === undefined ? undefined : `output=${output.name}`,\n status === undefined ? undefined : `status=${status}`,\n ].filter((part): part is string => part !== undefined).join(\", \")})`\n : `toolMatch(${quoted(expectedName)})`;\n if (unconstrained) {\n return createBooleanMatch(\"tool\", name, (occurrence) => matched(occurrence));\n }\n return createBooleanMatch(\"tool\", name, async (occurrence) => {\n const fields = await evaluateFields([\n ...(expectedName === undefined\n ? []\n : [{ label: \"name\", evaluate: async () => occurrenceNameResult(occurrence, expectedName!) }]),\n ...(input === undefined ? [] : [{ label: \"input\", evaluate: () => toolEvidenceResult(occurrence, \"input\", input!) }]),\n ...(output === undefined ? [] : [{ label: \"output\", evaluate: () => toolEvidenceResult(occurrence, \"output\", output!) }]),\n { label: \"status\", evaluate: async () => lifecycleResult(occurrence, status) },\n ]);\n return combineConjunction(occurrence, name, fields);\n });\n}\n/** @internal Assert-first accepts only branded tool-domain matches. */\nexport function assertManagedToolMatch(value: unknown, label = \"match\"): ToolMatch {\n assertBooleanMatch(value, label, \"tool\");\n return value as ToolMatch;\n}\n/** @internal Nominal guard for a managed tool-domain item predicate. */\nexport function isManagedToolMatch(value: unknown): value is ToolMatch {\n if (!isRecord(value) || !matchBrands.has(value))\n return false;\n return value.domain === \"tool\" && value.kind === \"boolean\";\n}\n/** @internal Assert-first accepts only branded event-domain matches. */\nexport function assertManagedEventMatch(value: unknown, label = \"match\"): EventMatch {\n assertBooleanMatch(value, label, \"event\");\n return value as EventMatch;\n}\n/** @internal Nominal guard for a managed event-domain item predicate. */\nexport function isManagedEventMatch(value: unknown): value is EventMatch {\n if (!isRecord(value) || !matchBrands.has(value))\n return false;\n return value.domain === \"event\" && value.kind === \"boolean\";\n}\nexport type ToolMatchQuantifier = {\n readonly kind: \"at-least\";\n readonly count: number;\n} | {\n readonly kind: \"less-than\";\n readonly count: number;\n} | {\n readonly kind: \"at-most\";\n readonly count: number;\n} | {\n readonly kind: \"greater-than\";\n readonly count: number;\n} | {\n readonly kind: \"exact\";\n readonly count: number;\n} | {\n readonly kind: \"absent\";\n};\nfunction commandResult(occurrence: LogicalToolOccurrence, executable: string, argsStart: readonly string[] | undefined, excludes: readonly string[] | undefined): BooleanMatchEvaluation<unknown> {\n const projection = occurrence.command;\n if (projection === undefined) {\n return unavailable(\"logical-command-unavailable\", diagnostic(\"logical-command-unavailable\", \"tool occurrence has no durable command projection\", {\n reason: \"logical-command-unavailable\",\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n if (!isRecord(projection) || (projection.kind !== \"command\" && projection.kind !== \"not-command\")) {\n throw new TypeError(\"tool occurrence has an invalid command projection\");\n }\n if (projection.kind === \"not-command\") {\n return mismatched(diagnostic(\"not-command\", \"tool occurrence is not a command\", {\n expected: quoted(executable),\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n const logical = projection.logical;\n if (!isRecord(logical) || (logical.state !== \"available\" && logical.state !== \"opaque\")) {\n throw new TypeError(\"command projection has an invalid logical envelope\");\n }\n if (logical.normalizer !== \"logical-command/v1\") {\n throw new TypeError(\"command projection does not use logical-command/v1\");\n }\n if (logical.state === \"opaque\") {\n if (typeof logical.reason !== \"string\" || logical.reason.length === 0) {\n throw new TypeError(\"opaque logical command has no reason\");\n }\n return unavailable(`logical-command-opaque:${logical.reason}`, diagnostic(\"logical-command-opaque\", \"logical command is opaque\", {\n reason: logical.reason,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n if (typeof logical.executable !== \"string\" || !Array.isArray(logical.args) || !logical.args.every((arg) => typeof arg === \"string\")) {\n throw new TypeError(\"available logical command has an invalid argv envelope\");\n }\n if (logical.executable !== executable) {\n return mismatched(diagnostic(\"logical-executable-mismatch\", \"logical executable did not match exactly\", {\n expected: quoted(executable),\n received: quoted(logical.executable),\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n if (argsStart !== undefined && !argsStart.every((token, index) => logical.args[index] === token)) {\n return mismatched(diagnostic(\"logical-args-prefix-mismatch\", \"logical argv did not start with the expected exact tokens\", {\n expected: argsStart.map(quoted).join(\" \"),\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n if (excludes !== undefined && excludes.some((token) => logical.args.includes(token))) {\n return mismatched(diagnostic(\"logical-args-excluded-token\", \"logical argv contained an excluded exact token\", {\n expected: `without ${excludes.map(quoted).join(\", \")}`,\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n }\n return matched(occurrence, diagnostic(\"logical-command-match\", \"logical command matched exact executable and token rules\", {\n expected: quoted(executable),\n locator: { kind: \"tool-occurrence\", id: occurrence.id },\n }));\n}\nexport function commandMatch(executable: string, options?: CommandMatchOptions): ToolMatch<LogicalCommandOccurrence> {\n assertNonEmptyString(executable, \"commandMatch() executable\");\n const normalized = assertPlainOptions(options, \"commandMatch() options\", [\"argsStart\", \"excludes\", \"status\"]);\n const argsStart = normalizeTokens(normalized.argsStart, \"commandMatch() options.argsStart\", false);\n const excludes = normalizeTokens(normalized.excludes, \"commandMatch() options.excludes\", true);\n const status = normalizeStatus(normalized.status, \"commandMatch() options.status\");\n const details = [\n argsStart === undefined ? undefined : `argsStart=[${argsStart.map(quoted).join(\", \")}]`,\n excludes === undefined ? undefined : `excludes=[${excludes.map(quoted).join(\", \")}]`,\n status === undefined ? undefined : `status=${status}`,\n ]\n .filter((detail): detail is string => detail !== undefined)\n .join(\", \");\n const name = `commandMatch(${quoted(executable)}${details.length === 0 ? \"\" : `, ${details}`})`;\n return createBooleanMatch(\"tool\", name, async (occurrence) => {\n const fields = await evaluateFields([\n { label: \"command\", evaluate: async () => commandResult(occurrence, executable, argsStart, excludes) },\n { label: \"status\", evaluate: async () => lifecycleResult(occurrence, status) },\n ]);\n return combineConjunction<LogicalToolOccurrence, LogicalCommandOccurrence>(occurrence, name, fields);\n });\n}\nexport interface EventOptionsByType {\n readonly message: {\n readonly role?: \"assistant\" | \"user\";\n readonly text?: BooleanMatch<string, string, \"value\">;\n };\n readonly \"operation.started\": {\n readonly tool?: ToolMatch;\n };\n readonly \"operation.finished\": {\n readonly tool?: ToolMatch;\n };\n}\ntype MatchableEventType = keyof EventOptionsByType;\nfunction isMatchableEventType(value: unknown): value is MatchableEventType {\n return value === \"message\" || value === \"operation.started\" || value === \"operation.finished\";\n}\nfunction messageEventResult(event: Extract<EventOccurrenceView, {\n readonly type: \"message\";\n}>, role: \"assistant\" | \"user\" | undefined, text: BooleanMatch<string, string, \"value\"> | undefined): Promise<BooleanMatchEvaluation<unknown>> {\n return evaluateFields([\n ...(role === undefined\n ? []\n : [\n {\n label: \"role\",\n evaluate: async () => event.role === role\n ? matched(event, diagnostic(\"message-role-match\", \"message role matched\", { expected: role }))\n : mismatched(diagnostic(\"message-role-mismatch\", \"message role did not match\", {\n expected: role,\n received: event.role,\n })),\n },\n ]),\n ...(text === undefined\n ? []\n : [{ label: \"text\", evaluate: () => evaluateBooleanMatch(text, event.text) }]),\n ]).then((fields) => combineConjunction(event, \"eventMatch(message)\", fields));\n}\nasync function toolEventResult(event: EventOccurrenceView, match: ToolMatch | undefined): Promise<BooleanMatchEvaluation<unknown>> {\n if (match === undefined)\n return matched(event, diagnostic(\"event-type-match\", \"event type matched\"));\n const occurrence = assertionEventOccurrence(event);\n if (occurrence === undefined) {\n return unavailable(\"event-tool-occurrence-unavailable\", diagnostic(\"event-tool-occurrence-unavailable\", \"operation event has no associated logical tool occurrence\", {\n reason: \"event-tool-occurrence-unavailable\",\n }));\n }\n return evaluateBooleanMatch(match, occurrence);\n}\nexport function eventMatch<K extends keyof EventOptionsByType>(type: K, options?: EventOptionsByType[K]): EventMatch<Extract<EventOccurrenceView, {\n readonly type: K;\n}>> {\n if (!isMatchableEventType(type))\n throw new TypeError(\"eventMatch() type is not supported\");\n if (type === \"message\") {\n const normalized = assertPlainOptions(options, \"eventMatch(message) options\", [\"role\", \"text\"]);\n const role = normalized.role;\n if (role !== undefined && role !== \"assistant\" && role !== \"user\") {\n throw new TypeError(\"eventMatch(message) options.role must be assistant or user\");\n }\n const text = normalized.text;\n if (text !== undefined)\n assertBooleanMatch(text, \"eventMatch(message) options.text\", \"value\");\n const name = \"eventMatch(message)\";\n return createBooleanMatch(\"event\", name, async (event) => {\n if (event.type !== \"message\") {\n return mismatched(diagnostic(\"event-type-mismatch\", \"event type did not match\", { expected: \"message\" }));\n }\n return messageEventResult(event, role as \"assistant\" | \"user\" | undefined, text as BooleanMatch<string, string, \"value\"> | undefined) as Promise<BooleanMatchEvaluation<Extract<EventOccurrenceView, {\n readonly type: K;\n }>>>;\n }) as EventMatch<Extract<EventOccurrenceView, {\n readonly type: K;\n }>>;\n }\n const normalized = assertPlainOptions(options, `eventMatch(${type}) options`, [\"tool\"]);\n const tool = normalized.tool;\n if (tool !== undefined)\n assertBooleanMatch(tool, `eventMatch(${type}) options.tool`, \"tool\");\n const name = `eventMatch(${type})`;\n return createBooleanMatch(\"event\", name, async (event) => {\n if (event.type !== type) {\n return mismatched(diagnostic(\"event-type-mismatch\", \"event type did not match\", { expected: type }));\n }\n const fields = await evaluateFields([\n { label: \"tool\", evaluate: () => toolEventResult(event, tool as ToolMatch | undefined) },\n ]);\n return combineConjunction<EventOccurrenceView, Extract<EventOccurrenceView, {\n readonly type: K;\n }>>(event, name, fields);\n }) as EventMatch<Extract<EventOccurrenceView, {\n readonly type: K;\n }>>;\n}\nconst collectionInputBrand: unique symbol = Symbol(\"niceeval.collection-match.input\");\nconst managedToolCallsBrand: unique symbol = Symbol(\"niceeval.managed-tool-calls\");\nconst managedEventOccurrencesBrand: unique symbol = Symbol(\"niceeval.managed-event-occurrences\");\nconst occurrenceMatchBrand: unique symbol = Symbol(\"niceeval.occurrence-match\");\nconst collectionMatches = new WeakMap<object, CollectionMatchSpec>();\nconst MAX_ORDER_STEPS = 64;\nexport interface CollectionMatch<in T> {\n readonly kind: \"collection-match\";\n readonly [collectionInputBrand]: (candidate: T) => void;\n}\nexport interface ToolOccurrenceView {\n readonly name: string;\n readonly input?: unknown;\n readonly output?: unknown;\n readonly status?: \"pending\" | \"completed\" | \"failed\" | \"rejected\";\n}\nexport type ManagedToolCalls<S extends \"turn\" | \"session\" | \"attempt\" = \"turn\" | \"session\" | \"attempt\"> = readonly ToolOccurrenceView[] & {\n readonly [managedToolCallsBrand]: S;\n};\n/** Identity-free event projection with an Attempt-owned matcher sidecar. */\nexport type ManagedEventOccurrences<S extends \"turn\" | \"session\" | \"attempt\" = \"turn\" | \"session\" | \"attempt\"> = readonly EventOccurrenceView[] & {\n readonly [managedEventOccurrencesBrand]: S;\n};\n/** Positive tool-occurrence query produced by atLeast, exactly, or greaterThan. */\nexport interface ToolOccurrenceMatch extends CollectionMatch<ManagedToolCalls> {\n readonly [occurrenceMatchBrand]: \"tool-positive\";\n}\n/** Upper-bound tool-occurrence query produced by atMost or lessThan. */\nexport interface ToolUpperBoundOccurrenceMatch extends CollectionMatch<ManagedToolCalls> {\n readonly [occurrenceMatchBrand]: \"tool-upper-bound\";\n}\n/** Ordered tool sequence accepted only by turn and session subjects. */\nexport interface ToolSequenceMatch extends CollectionMatch<ManagedToolCalls<\"turn\" | \"session\">> {\n readonly [occurrenceMatchBrand]: \"tool-sequence\";\n}\n/** Positive event-occurrence query produced by atLeast, exactly, or greaterThan. */\nexport interface EventOccurrenceMatch extends CollectionMatch<ManagedEventOccurrences> {\n readonly [occurrenceMatchBrand]: \"event-positive\";\n}\n/** Upper-bound event-occurrence query produced by atMost or lessThan. */\nexport interface EventUpperBoundOccurrenceMatch extends CollectionMatch<ManagedEventOccurrences> {\n readonly [occurrenceMatchBrand]: \"event-upper-bound\";\n}\n/** Ordered event sequence accepted only by turn and session subjects. */\nexport interface EventSequenceMatch extends CollectionMatch<ManagedEventOccurrences<\"turn\" | \"session\">> {\n readonly [occurrenceMatchBrand]: \"event-sequence\";\n}\nexport type CollectionMatchSpec = {\n readonly kind: \"occurrence\";\n readonly domain: \"tool\" | \"event\";\n readonly item: ToolMatch | EventMatch;\n readonly quantifier: ToolMatchQuantifier;\n} | {\n readonly kind: \"in-order\";\n readonly domain: \"tool\" | \"event\";\n readonly matches: readonly (ToolMatch | EventMatch)[];\n};\nfunction createCollectionMatch<T>(spec: CollectionMatchSpec, brand: string): CollectionMatch<T> {\n const match = Object.freeze({\n kind: \"collection-match\" as const,\n [collectionInputBrand]: (_candidate: T) => undefined,\n [occurrenceMatchBrand]: brand,\n }) as CollectionMatch<T>;\n collectionMatches.set(match, spec);\n return match;\n}\nfunction assertNonNegativeSafeInteger(value: unknown, label: string): asserts value is number {\n if (typeof value !== \"number\" || !Number.isSafeInteger(value) || value < 0) {\n throw new TypeError(`${label} must be a non-negative safe integer`);\n }\n}\nfunction quantifiedOccurrenceMatch(item: ToolMatch | EventMatch, kind: Exclude<ToolMatchQuantifier[\"kind\"], \"absent\">, count: number): ToolOccurrenceMatch | ToolUpperBoundOccurrenceMatch | EventOccurrenceMatch | EventUpperBoundOccurrenceMatch {\n const method = kind === \"at-least\"\n ? \"atLeast\"\n : kind === \"less-than\"\n ? \"lessThan\"\n : kind === \"at-most\"\n ? \"atMost\"\n : kind === \"greater-than\"\n ? \"greaterThan\"\n : \"exactly\";\n const domain = internalMatchOf(item, `${item.domain === \"event\" ? \"EventMatch\" : \"ToolMatch\"}.${method}() item`).domain;\n if (domain !== \"tool\" && domain !== \"event\")\n throw new TypeError(`${method}() requires a ToolMatch or EventMatch`);\n assertNonNegativeSafeInteger(count, `${domain === \"tool\" ? \"ToolMatch\" : \"EventMatch\"}.${method}() count`);\n const match = domain === \"tool\"\n ? assertManagedToolMatch(item, `ToolMatch.${method}() item`)\n : assertManagedEventMatch(item, `EventMatch.${method}() item`);\n const upperBound = kind === \"less-than\" || kind === \"at-most\";\n return createCollectionMatch({\n kind: \"occurrence\",\n domain,\n item: match,\n quantifier: kind === \"exact\" && count === 0\n ? Object.freeze({ kind: \"absent\" as const })\n : Object.freeze({ kind, count }),\n }, `${domain}-${upperBound ? \"upper-bound\" : \"positive\"}`) as ToolOccurrenceMatch | ToolUpperBoundOccurrenceMatch | EventOccurrenceMatch | EventUpperBoundOccurrenceMatch;\n}\nexport function inOrder(matches: readonly [\n EventMatch,\n EventMatch,\n ...EventMatch[]\n]): EventSequenceMatch;\nexport function inOrder(matches: readonly [\n ToolMatch,\n ToolMatch,\n ...ToolMatch[]\n]): ToolSequenceMatch;\nexport function inOrder<T, Subject extends CollectionValue<T>>(matches: readonly [\n BooleanMatch<T, NoInfer<T>>,\n BooleanMatch<T, NoInfer<T>>,\n ...BooleanMatch<T, NoInfer<T>>[]\n]): SubjectSequenceMatch<Subject>;\nexport function inOrder(matches: readonly unknown[]): ToolSequenceMatch | EventSequenceMatch | BooleanMatch<CollectionValue<unknown>, CollectionValue<unknown>> {\n if (!Array.isArray(matches) || matches.length < 2) {\n throw new TypeError(\"inOrder() requires at least two BooleanMatch values\");\n }\n if (matches.length > MAX_ORDER_STEPS) {\n throw new TypeError(`inOrder() supports at most ${MAX_ORDER_STEPS} steps`);\n }\n const first = internalMatchOf(matches[0], \"inOrder() match 1\");\n if (first.domain === \"value\") {\n const steps = Array.from(matches, (match, index) => {\n assertBooleanMatch(match, `inOrder() match ${index + 1}`, \"value\");\n return match as BooleanMatch<unknown, unknown>;\n });\n return valueSequenceMatch(Object.freeze(steps));\n }\n const domain = first.domain;\n const normalized = matches.map((match, index) => domain === \"tool\"\n ? assertManagedToolMatch(match, `inOrder() match ${index + 1}`)\n : assertManagedEventMatch(match, `inOrder() match ${index + 1}`));\n return createCollectionMatch({\n kind: \"in-order\",\n domain,\n matches: Object.freeze(normalized),\n }, `${domain}-sequence`) as ToolSequenceMatch | EventSequenceMatch;\n}\n// A sequence always refines to its input, including when nested under a NoInfer\n// composition argument. Keep that relationship available for contextual instantiation.\ninterface SubjectSequenceMatch<Subject> extends BooleanMatch<Subject, Subject> {\n readonly [matchRefinementBrand]: <Original extends Subject>() => Original;\n}\nfunction valueSequenceMatch(steps: readonly BooleanMatch<unknown, unknown>[]): BooleanMatch<CollectionValue<unknown>, CollectionValue<unknown>> {\n const name = `inOrder(${steps.map(step => step.name).join(\", \")})`;\n return createBooleanMatch(\"value\", name, async (subject) => {\n const collection = compositionCollection(subject, name);\n if (collection.state === \"unavailable\")\n return collection;\n const certain = new Array<boolean>(steps.length + 1).fill(false);\n const possible = new Array<boolean>(steps.length + 1).fill(false);\n certain[0] = possible[0] = true;\n const children: MatchDiagnosticChild[] = [];\n let unknownReason: string | undefined;\n for (let index = 0; index < collection.values.length; index += 1) {\n const value = collection.values[index];\n // Descending updates only consume prefixes reached by earlier items.\n for (let step = steps.length - 1; step >= 0; step -= 1) {\n if (!possible[step] || certain[step + 1])\n continue;\n const result = !Object.hasOwn(collection.values, index) || compositionUnknown(value)\n ? compositionMissing(name) : await evaluateBooleanMatch(steps[step], value);\n children.push(resultChild({ ...result, diagnostic: diagnostic(\"composition-order-item\", `${name} evaluated original item ${index}, step ${step}`, {\n path: [\"items\", index],\n children: [resultChild(result, step, steps[step].name)],\n }) }, index, collection.items?.[index]?.id));\n if (result.state !== \"mismatched\")\n possible[step + 1] = true;\n if (result.state === \"matched\" && certain[step])\n certain[step + 1] = true;\n if (result.state === \"unavailable\")\n unknownReason ??= result.reason;\n }\n if (certain[steps.length])\n return compositionResult(subject, name, children, matched(subject));\n }\n const result = possible[steps.length]\n ? unavailable(unknownReason ?? \"unknown-composition-value\", diagnostic(\"composition-order-unavailable\", \"Only an unknown sequence can satisfy the order\"))\n : mismatched(diagnostic(\"composition-order-mismatched\", \"No increasing sequence can satisfy the order\"));\n return compositionResult(subject, name, children, result);\n });\n}\nexport function isManagedCollectionMatch(value: unknown): value is CollectionMatch<unknown> {\n return isRecord(value) && collectionMatches.has(value);\n}\nexport function looksLikeCollectionMatch(value: unknown): boolean {\n return isRecord(value) && value.kind === \"collection-match\";\n}\nexport function collectionMatchSpecOf(value: unknown): CollectionMatchSpec {\n const spec = isRecord(value) ? collectionMatches.get(value) : undefined;\n if (spec === undefined) {\n throw new TypeError(\"match must be a collection Match created by niceeval/expect\");\n }\n return spec;\n}\n/** Ordinary arrays are complete; material collections carry explicit source coverage. */\nexport type CollectionValue<T> = readonly T[] | MaterialCollection<T>;\n// Only input variance matters: a child's refinement never replaces the outer subject.\ntype CompositionValueMatch<T> = Match<T, \"value\"> & {\n readonly kind: \"boolean\";\n};\nasync function compositionEvaluate<T>(match: CompositionValueMatch<T>, value: T): Promise<BooleanMatchEvaluation<T>> {\n return evaluateBooleanMatch(match as BooleanMatch<T, T>, value);\n}\nfunction compositionUnknown(value: unknown): boolean {\n return value === undefined || value === null || typeof value === \"number\" && !Number.isFinite(value);\n}\nfunction compositionMissing(name: string, path: readonly MatchPathSegment[] = []): BooleanMatchEvaluation<never> {\n return unavailable(\"unknown-composition-value\", diagnostic(\"composition-value-unavailable\", `${name} requires a known, finite value`, {\n path, reason: \"unknown-composition-value\",\n }));\n}\nfunction compositionProject<T, U>(name: string, project: (value: T) => U, value: T): U {\n const projected = project(value);\n if (projected !== null && (typeof projected === \"object\" || typeof projected === \"function\") &&\n typeof (projected as {\n readonly then?: unknown;\n }).then === \"function\") {\n throw new TypeError(`${name} projection must return a synchronous value`);\n }\n return projected;\n}\nfunction compositionResult<T>(subject: T, name: string, children: readonly MatchDiagnosticChild[], result: BooleanMatchEvaluation<unknown>): BooleanMatchEvaluation<T> {\n const detail = diagnostic(`composition-${result.state}`, `${name} ${result.state}`, {\n children, ...(result.state === \"unavailable\" ? { reason: result.reason } : {}),\n });\n if (result.state === \"unavailable\")\n return unavailable(result.reason, detail);\n if (result.state === \"mismatched\")\n return mismatched(detail);\n return matched(subject, detail);\n}\nfunction compositionCollection<T>(subject: CollectionValue<T>, name: string): {\n readonly state: \"complete\";\n readonly values: readonly T[];\n readonly items?: readonly MaterialItem<T>[];\n} | Extract<BooleanMatchEvaluation<never>, {\n readonly state: \"unavailable\";\n}> {\n if (Array.isArray(subject))\n return { state: \"complete\", values: subject };\n if (!isRecord(subject) || ![\"complete\", \"partial\", \"unavailable\"].includes(String(subject.state))) {\n throw new TypeError(`${name} subject must be an array or MaterialCollection`);\n }\n if (subject.state !== \"complete\") {\n if (typeof subject.reason !== \"string\" || subject.reason.trim() === \"\") {\n throw new TypeError(`${name} incomplete collection requires a reason`);\n }\n return unavailable(subject.reason, diagnostic(\"composition-collection-unavailable\", `${name} requires a complete collection`, {\n reason: subject.reason,\n })) as Extract<BooleanMatchEvaluation<never>, {\n readonly state: \"unavailable\";\n }>;\n }\n if (!Array.isArray(subject.items))\n throw new TypeError(`${name} material items must be an array`);\n const items = subject.items as readonly MaterialItem<T>[];\n const ids = new Set<string>();\n const values: T[] = new Array(items.length);\n for (let index = 0; index < items.length; index += 1) {\n if (!Object.hasOwn(items, index) || compositionUnknown(items[index]))\n continue;\n const item = items[index];\n if (!isRecord(item) || typeof item.id !== \"string\" || item.id.trim() === \"\" || ids.has(item.id)) {\n throw new TypeError(`${name} material items require unique nonempty IDs`);\n }\n ids.add(item.id);\n if (Object.hasOwn(item, \"value\"))\n values[index] = item.value as T;\n }\n return { state: \"complete\", values, items };\n}\nfunction compositionItemChild(result: BooleanMatchEvaluation<unknown>, index: number, id: string | undefined, label: string): MatchDiagnosticChild {\n return resultChild({ ...result, diagnostic: diagnostic(\"composition-item\", `${label} evaluated original item ${index}`, {\n path: [\"items\", index],\n children: [resultChild(result, 0, label)],\n }) }, index, id === undefined ? label : id);\n}\nfunction compositionSubset<T>(values: readonly T[], indices: readonly number[], items?: readonly MaterialItem<unknown>[]): CollectionValue<T> {\n if (items === undefined)\n return Object.freeze([...values]);\n return Object.freeze({ state: \"complete\", items: Object.freeze(values.map((value, index) => Object.freeze({\n id: items[indices[index]].id, value,\n }))) });\n}\n/** Project a single value without replacing the original subject's refinement. */\nexport function mapValue<T, U>(label: string, project: (value: T) => U, match: Match<NoInfer<U>, \"value\"> & {\n readonly kind: \"boolean\";\n}): BooleanMatch<T, T> {\n assertNonEmptyString(label, \"mapValue() label\");\n if (typeof project !== \"function\")\n throw new TypeError(\"mapValue() project must be a function\");\n assertBooleanMatch(match, \"mapValue() match\", \"value\");\n const name = `mapValue(${label}, ${match.name})`;\n return createBooleanMatch(\"value\", name, async (subject: T) => {\n if (compositionUnknown(subject))\n return compositionMissing(name);\n const value = compositionProject(name, project, subject);\n const result = compositionUnknown(value) ? compositionMissing(name) : await compositionEvaluate(match, value);\n return compositionResult(subject, name, [resultChild(result, 0, label)], result);\n });\n}\n/** Project each complete item, retaining its material identity and order. */\nexport function mapEach<T, U, Subject extends CollectionValue<T>>(project: (value: T) => U, aggregate: Match<CollectionValue<NoInfer<U>>, \"value\"> & {\n readonly kind: \"boolean\";\n}): BooleanMatch<Subject & CollectionValue<T>, Subject> {\n if (typeof project !== \"function\")\n throw new TypeError(\"mapEach() project must be a function\");\n assertBooleanMatch(aggregate, \"mapEach() aggregate\", \"value\");\n const name = `mapEach(${aggregate.name})`;\n return createBooleanMatch(\"value\", name, async (subject: Subject) => {\n const collection = compositionCollection(subject, name);\n if (collection.state === \"unavailable\")\n return collection;\n const values: U[] = [];\n const indices: number[] = [];\n const children: MatchDiagnosticChild[] = [];\n let unknown: BooleanMatchEvaluation<unknown> | undefined;\n for (let index = 0; index < collection.values.length; index += 1) {\n const item = collection.values[index];\n const value = !Object.hasOwn(collection.values, index) || compositionUnknown(item)\n ? undefined : compositionProject(name, project, item);\n const result = compositionUnknown(value) ? compositionMissing(name) : matched(value);\n if (result.state === \"unavailable\")\n unknown ??= result;\n values.push(value as U);\n indices.push(index);\n children.push(compositionItemChild(result, index, collection.items?.[index]?.id, \"projection\"));\n }\n if (unknown !== undefined)\n return compositionResult(subject, name, children, unknown);\n const result = await compositionEvaluate(aggregate, compositionSubset(values, indices, collection.items));\n children.push(resultChild(result, collection.values.length, \"aggregate\"));\n return compositionResult(subject, name, children, result);\n });\n}\n/** Select only definite matches; an unknown selector makes the aggregate unavailable. */\nexport function filterWhere<T, R extends T, Subject extends CollectionValue<T>>(selector: BooleanMatch<T, R>, aggregate: BooleanMatch<CollectionValue<R>, CollectionValue<R>>): BooleanMatch<Subject, Subject> {\n assertBooleanMatch(selector, \"filterWhere() selector\", \"value\");\n assertBooleanMatch(aggregate, \"filterWhere() aggregate\", \"value\");\n const name = `filterWhere(${selector.name}, ${aggregate.name})`;\n return createBooleanMatch(\"value\", name, async (subject: Subject) => {\n const collection = compositionCollection(subject, name);\n if (collection.state === \"unavailable\")\n return collection;\n const values: R[] = [];\n const indices: number[] = [];\n const children: MatchDiagnosticChild[] = [];\n let unknown: BooleanMatchEvaluation<unknown> | undefined;\n for (let index = 0; index < collection.values.length; index += 1) {\n const value = collection.values[index];\n const result = !Object.hasOwn(collection.values, index) || compositionUnknown(value)\n ? compositionMissing(name) : await evaluateBooleanMatch(selector, value);\n if (result.state === \"matched\") {\n values.push(value as R);\n indices.push(index);\n }\n if (result.state === \"unavailable\")\n unknown ??= result;\n children.push(compositionItemChild(result, index, collection.items?.[index]?.id, selector.name));\n }\n if (unknown !== undefined)\n return compositionResult(subject, name, children, unknown);\n const result = await compositionEvaluate(aggregate, compositionSubset(values, indices, collection.items));\n children.push(resultChild(result, collection.values.length, \"aggregate\"));\n return compositionResult(subject, name, children, result);\n });\n}\n/** Compare an exact match count only after every item in a complete collection is known. */\nexport function countWhere<T, Subject extends CollectionValue<T>>(item: BooleanMatch<T, NoInfer<T>>, count: Match<number, \"value\"> & {\n readonly kind: \"boolean\";\n}): BooleanMatch<Subject, Subject> {\n assertBooleanMatch(item, \"countWhere() item\", \"value\");\n assertBooleanMatch(count, \"countWhere() count\", \"value\");\n const name = `countWhere(${item.name}, ${count.name})`;\n return createBooleanMatch(\"value\", name, async (subject: Subject) => {\n const collection = compositionCollection(subject, name);\n if (collection.state === \"unavailable\")\n return collection;\n let total = 0;\n const children: MatchDiagnosticChild[] = [];\n let unknown: BooleanMatchEvaluation<unknown> | undefined;\n for (let index = 0; index < collection.values.length; index += 1) {\n const value = collection.values[index];\n const result = !Object.hasOwn(collection.values, index) || compositionUnknown(value)\n ? compositionMissing(name) : await evaluateBooleanMatch(item, value);\n if (result.state === \"matched\")\n total += 1;\n if (result.state === \"unavailable\")\n unknown ??= result;\n children.push(compositionItemChild(result, index, collection.items?.[index]?.id, item.name));\n }\n if (unknown !== undefined)\n return compositionResult(subject, name, children, unknown);\n const result = await compositionEvaluate(count, total);\n children.push(resultChild(result, collection.values.length, \"count\"));\n return compositionResult(subject, name, children, result);\n });\n}\n"]}
|