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":"record.js","sourceRoot":"","sources":["record.ts"],"names":[],"mappings":";;;AAyIA,sEAqDC;AAiCD,kEA8hBC;AA7vBD,qDAAuD;AACvD,6CAAyC;AACzC,qCAAqC;AACrC,mCAAgF;AAChF,8DAAkF;AAGlF,4DAAwE;AACxE,0DAAuD;AACvD,kEAAkI;AAIlI,wDAA8E;AAC9E,qDAAoE;AACpE,4DAAiE;AACjE,wDAA6D;AAI7D,sDAA4M;AAC5M,qDAA4C;AAC5C,mDAA0M;AAC1M,2DAAwN;AACxN,6DAA0I;AAC1I,4DAAgR;AAChR,yDAA2D;AAC3D,qEAAkG;AAClG,6EAAmH;AACnH,mFAAkG;AAClG,sDAA6R;AAG7R,+EAA0E;AAE1E,oDAAoP;AAA3O,uHAAA,wBAAwB,OAAA;AAyBjC,SAAS,2BAA2B,CAAC,MAAkB;IACnD,MAAM,OAAO,GAAG,IAAA,uDAAyB,EAAC,MAAM,CAAC,CAAC;IAClD,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC3C,QAAQ,EAA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} from \"node:crypto\";\nimport { existsSync } from \"node:fs\";\nimport { Cause, Effect, Result, Exit, Option, Semaphore, Stream } from \"effect\";\nimport { encodeAttemptLocator, type AttemptLocator } from \"../attempt-locator.ts\";\nimport type { SealedAttemptAssertions } from \"../assertions/api.ts\";\nimport type { AssertionsProducerError } from \"../assertions/record/producer.ts\";\nimport { NiceEvalRecordAttachments } from \"../record/family/catalog.ts\";\nimport { recordHost } from \"../record/host/runtime.ts\";\nimport { discardAttemptWriteSession, stagePlanningReference, writerGenerationForRunSession } from \"../record/host/sqlite-host.ts\";\nimport type { AttemptWriteSession, RecordSealReceipt, RunWriteSession, } from \"../record/host/types.ts\";\nimport type { RunId, SlotId, } from \"../record/model/identifiers.ts\";\nimport type { AssertionEntryId } from \"../assertions/identity.ts\";\nimport { recordRootPaths, type RecordRoot } from \"../record/platform/root.ts\";\nimport { attemptPublicationClosure } from \"../record/codec/core.ts\";\nimport { RecordRootInvalid } from \"../record/platform/errors.ts\";\nimport { recordSqlitePath } from \"../record/sqlite/index.ts\";\nimport type { ProjectStateDatabase } from \"../record/sqlite/project-state-database.ts\";\nimport type { RecordReaderOpenError, RecordReaderReadError, } from \"../record/reader/errors.ts\";\nimport type { RecordWriteError } from \"../record/writer/types.ts\";\nimport { bindAttemptReference, closeRunResource, currentPublicationCutoff, publishOriginAttempt, createRunWriterGeneration, type PublicationCutoff, type RunAbsenceReason, } from \"../run/storage/index.ts\";\nimport { cacheKey } from \"./fingerprint.ts\";\nimport { planProjectTargetReuse, planProjectTargetReuseWithoutSources, type ExecutionReusePlan, type ExecutionReusePlanSlot, type ProjectTargetReusePlanInvalid, type TargetRun, } from \"./reuse-plan.ts\";\nimport { readCurrentExecutionReusePlanReadbacks, readCurrentExecutionReusePlanResults, type CurrentReusedAttemptReadback, type CurrentReuseReadback, type CurrentReuseReadbackPlanInvalid, } from \"./reuse-readback.ts\";\nimport { createRunnerTurnContextsAttachment, createRunnerSourceWritePlan, type RunnerSourceProducerInvalid, } from \"./source-producer.ts\";\nimport { createAttemptArtifactsAttachment, createAttemptFileChangesAttachment, createAttemptObservabilityAttachments, createRunArtifactsAttachment, createRunnerAssertionsAttachment, createRunObservabilityAttachments, recordAttemptOutcome, } from \"./record/attachments.ts\";\nimport { adapterUsageForResult } from \"./adapter-usage.ts\";\nimport { adapterAttachmentsForResult, releaseAdapterAttachments } from \"./adapter-attachments.ts\";\nimport { adapterExecutionTracesForResult, validateExecutionTracePublication, } from \"./adapter-execution-trace.ts\";\nimport { executionTracesRecordCollection } from \"../record/family/execution-traces/definition.ts\";\nimport { planRunnerRecordRun, previewRunnerRunId, runnerRecordSlotKey, runnerRecordUtcMillis, targetForRunnerRecordRun, type PlannedRunnerRecordRun, type RunnerRecordReuseInput, type RunnerRecordTargetIdentityInvalid, type RunnerRecordTargetInputMissing, } from \"./record/planning.ts\";\nimport type { AgentRun, Attempt, DiscoveredEval, EvalResult, } from \"./types.ts\";\nimport type { AttemptCostAttachment } from \"../record/family/attempt-cost/definition.ts\";\nimport { getPricingEstimateReceipt } from \"./pricing-estimate-receipt.ts\";\nimport type { SessionTracker } from \"./session.ts\";\nexport { prepareRunnerRecordReuse, type RunnerRecordReuseInput, type RunnerRecordReusePreparationInput, type RunnerRecordReuseSlotInput, type RunnerRecordTargetIdentityInvalid, type RunnerRecordTargetInputMissing, } from \"./record/planning.ts\";\ntype GapActionState = \"pending\" | \"reserved\" | \"executed\" | \"not-dispatched\" | \"interrupted\";\ninterface ActiveRunnerRecordAttempt {\n readonly attempt: Attempt;\n readonly session: AttemptWriteSession;\n readonly public: RunnerRecordAttempt;\n sealed?: SealedAttemptAssertions;\n result?: EvalResult;\n assertionEntryIds?: readonly AssertionEntryId[];\n completed: boolean;\n}\ninterface RunnerRecordRun extends PlannedRunnerRecordRun {\n readonly session: RunWriteSession;\n readonly target: TargetRun;\n readonly attempts: Map<SlotId, ActiveRunnerRecordAttempt>;\n readonly planSlots: Map<SlotId, ExecutionReusePlanSlot>;\n readonly gapActions: Map<SlotId, GapActionState>;\n readonly writerGeneration: string;\n}\nexport interface RunnerRecordAttempt {\n readonly slotId: SlotId;\n readonly attemptId: import(\"../record/model/identifiers.ts\").AttemptId;\n readonly locator: AttemptLocator;\n}\nexport type RecordAttemptLocator = AttemptLocator;\nfunction createAttemptCostAttachment(result: EvalResult): AttemptCostAttachment {\n const receipt = getPricingEstimateReceipt(result);\n return Object.freeze({\n ...(result.usage?.costUSD === undefined ? {} : {\n observed: Object.freeze({ kind: \"observed\" as const, amountUSD: result.usage.costUSD }),\n }),\n ...(receipt === undefined ? {} : {\n estimated: Object.freeze({\n kind: \"estimated\" as const,\n amountUSD: receipt.amountUSD,\n model: receipt.model,\n priceSource: receipt.priceSource,\n charges: receipt.charges,\n }),\n }),\n });\n}\nexport interface RunnerRecordAttemptInvalid {\n readonly code: \"runner-record-attempt-invalid\";\n}\nexport interface RunnerRecordUnsealedAttempt {\n readonly code: \"runner-record-attempt-unsealed\";\n readonly slotId: SlotId;\n}\nexport interface RunnerRecordMembershipStateInvalid {\n readonly code: \"runner-record-membership-state-invalid\";\n readonly slotId: SlotId;\n}\nexport interface RunnerRecordAttemptPublicationFailed {\n readonly code: \"runner-record-attempt-publication-failed\";\n readonly locator: AttemptLocator;\n readonly cause: unknown;\n readonly message: string;\n}\n/** A seal return without its durable marker is never a publish receipt. */\nexport interface RunnerRecordPublishStateInvalid {\n readonly code: \"runner-record-publish-state-invalid\";\n readonly runId: RunId;\n}\nexport interface RunnerRecordAssertionsInvalid {\n readonly code: \"runner-record-assertions-invalid\";\n readonly issue: AssertionsProducerError;\n}\nexport interface RunnerRecordObservabilityInvalid {\n readonly code: \"runner-record-observability-invalid\";\n readonly owner: \"attempt\" | \"run\";\n readonly stage: \"capture\" | \"attachment\";\n}\nexport interface RunnerRecordSourcesInvalid {\n readonly code: \"runner-record-sources-invalid\";\n readonly issue: RunnerSourceProducerInvalid;\n}\nexport interface RunnerRecordArtifactsInvalid {\n readonly code: \"runner-record-artifacts-invalid\";\n readonly owner: \"attempt\" | \"run\";\n readonly reason: \"trace-serialization-failed\" | \"attachment-closure-invalid\";\n}\nexport type RunnerRecordWriteError = RecordWriteError | RunnerRecordAttemptInvalid | RunnerRecordUnsealedAttempt | RunnerRecordMembershipStateInvalid | RunnerRecordAttemptPublicationFailed | RunnerRecordPublishStateInvalid | RunnerRecordTargetIdentityInvalid | RunnerRecordAssertionsInvalid | RunnerRecordObservabilityInvalid | RunnerRecordSourcesInvalid | RunnerRecordArtifactsInvalid;\nexport type RunnerRecordOpenError = RecordReaderOpenError | RecordWriteError | RecordReaderReadError | ProjectTargetReusePlanInvalid | RunnerRecordTargetInputMissing | RunnerRecordTargetIdentityInvalid | RunnerRecordMembershipStateInvalid | RunnerSessionOpenFailed;\nexport interface RunnerSessionOpenFailed {\n readonly code: \"runner-session-open-failed\";\n readonly cause: unknown;\n}\nexport interface RunnerRecordCoordinator {\n readonly reusePlan: ExecutionReusePlan;\n readonly readCarriedResults: () => Effect.Effect<readonly CurrentReusedAttemptReadback[], RecordReaderReadError | CurrentReuseReadbackPlanInvalid>;\n readonly runIdsByExperiment: ReadonlyMap<string, string>;\n readonly publicationCutoff: () => Effect.Effect<PublicationCutoff, unknown, ProjectStateDatabase>;\n readonly carriedAttemptsByKey: ReadonlyMap<string, ReadonlySet<number>>;\n readonly adoptLatePublishedAttempt: (attempt: Attempt) => Effect.Effect<boolean, RecordReaderOpenError | RecordReaderReadError | ProjectTargetReusePlanInvalid | RunnerRecordWriteError, import(\"effect\").Scope.Scope | import(\"../coordination/record-leases.ts\").RecordCoordination | ProjectStateDatabase>;\n readonly reserveAttempt: (attempt: Attempt) => Effect.Effect<RunnerRecordAttempt, RunnerRecordWriteError, ProjectStateDatabase>;\n readonly noteSealedOrMarkIncomplete: (attempt: Attempt, sealed: SealedAttemptAssertions) => Effect.Effect<void, never>;\n readonly completeAttemptOrMarkIncomplete: (attempt: Attempt, result: EvalResult) => Effect.Effect<RunnerRecordAttempt | undefined, never, ProjectStateDatabase>;\n readonly markNotDispatched: (attempt: Attempt) => void;\n readonly publish: (completedAt: number, mode: \"normal\" | \"interrupted\") => Effect.Effect<readonly RecordSealReceipt[], RunnerRecordWriteError, ProjectStateDatabase>;\n}\n/** Current preview preserves the read Scope and never creates a Run row. */\nexport function withRunnerCurrentReusePreview<A, E, R>(input: {\n readonly recordRoot: RecordRoot;\n readonly startedAt: number;\n readonly evals: readonly DiscoveredEval[];\n readonly runs: readonly AgentRun[];\n readonly reuse: RunnerRecordReuseInput;\n readonly use: (preview: {\n readonly reusePlan: ExecutionReusePlan;\n readonly readReadbacks: () => Effect.Effect<readonly CurrentReuseReadback[], RecordReaderReadError | CurrentReuseReadbackPlanInvalid>;\n }) => Effect.Effect<A, E, R>;\n}): Effect.Effect<A, E | RunnerRecordOpenError, R | import(\"effect\").Scope.Scope | import(\"../coordination/record-leases.ts\").RecordCoordination | ProjectStateDatabase> {\n return Effect.scoped(Effect.gen(function* () {\n const startedAt = runnerRecordUtcMillis(input.startedAt);\n if (Result.isFailure(startedAt))\n return yield* Effect.fail(startedAt.failure);\n const planned = yield* Effect.forEach(input.runs, (run) => planRunnerRecordRun({\n run,\n evals: input.evals,\n reuse: input.reuse,\n }), { concurrency: 1 });\n const previewRuns: TargetRun[] = [];\n for (const plan of planned) {\n const runId = previewRunnerRunId(plan.run);\n if (Result.isFailure(runId))\n return yield* Effect.fail(runId.failure);\n previewRuns.push(targetForRunnerRecordRun({ planned: plan, runId: runId.success, startedAt: startedAt.success }));\n }\n const target = Object.freeze({\n invocationId: `preview-${createHash(\"sha256\").update(String(input.startedAt), \"utf8\").digest(\"hex\")}`,\n runs: Object.freeze(previewRuns),\n });\n const rootPath = recordRootPaths(input.recordRoot)?.portableRoot;\n if (rootPath === undefined)\n return yield* Effect.fail(new RecordRootInvalid({ code: \"record-root-invalid\" }));\n const recordDatabase = recordSqlitePath(rootPath);\n if (!existsSync(recordDatabase)) {\n const reusePlan = yield* planProjectTargetReuseWithoutSources({ target, policy: input.reuse.policy });\n return yield* input.use({\n reusePlan,\n readReadbacks: () => Effect.succeed(Object.freeze([])),\n });\n }\n const { reusePlan, readbacks } = yield* Effect.scoped(Effect.gen(function* () {\n const reader = yield* recordHost.openRead({ root: input.recordRoot });\n const reusePlan = yield* planProjectTargetReuse({ reader, target, policy: input.reuse.policy });\n const readbacks = yield* readCurrentExecutionReusePlanReadbacks({ reader, plan: reusePlan }).pipe(Effect.mapError((cause): RunnerSessionOpenFailed => ({ code: \"runner-session-open-failed\", cause })));\n return { reusePlan, readbacks };\n }));\n return yield* input.use({\n reusePlan,\n readReadbacks: () => Effect.succeed(readbacks),\n });\n }));\n}\nfunction attemptInvalid(): RunnerRecordAttemptInvalid {\n return Object.freeze({ code: \"runner-record-attempt-invalid\" as const });\n}\nfunction unsealedAttempt(slotId: SlotId): RunnerRecordUnsealedAttempt {\n return Object.freeze({ code: \"runner-record-attempt-unsealed\" as const, slotId });\n}\nfunction membershipStateInvalid(slotId: SlotId): RunnerRecordMembershipStateInvalid {\n return Object.freeze({ code: \"runner-record-membership-state-invalid\" as const, slotId });\n}\nfunction attemptPublicationFailed(locator: AttemptLocator, cause: unknown): RunnerRecordAttemptPublicationFailed {\n const detail = cause instanceof Error\n ? cause.message\n : typeof cause === \"object\" && cause !== null && typeof Reflect.get(cause, \"message\") === \"string\"\n ? String(Reflect.get(cause, \"message\"))\n : typeof cause === \"object\" && cause !== null && typeof Reflect.get(cause, \"code\") === \"string\"\n ? String(Reflect.get(cause, \"code\"))\n : String(cause);\n return Object.freeze({\n code: \"runner-record-attempt-publication-failed\" as const,\n locator,\n cause,\n message: `Attempt publication failed for ${locator}: ${detail}`,\n });\n}\nfunction publishStateInvalid(runId: RunId): RunnerRecordPublishStateInvalid {\n return Object.freeze({ code: \"runner-record-publish-state-invalid\" as const, runId });\n}\n/**\n * Opens one new per-Experiment Run session, selects only sealed historical\n * Runs, and writes carry references before dispatch. No global Record writer\n * lock or superseded draft/attachment contract participates in this boundary.\n */\nexport function openRunnerRecordCoordinator(input: {\n readonly recordRoot: RecordRoot;\n readonly startedAt: number;\n readonly evals: readonly DiscoveredEval[];\n readonly runs: readonly AgentRun[];\n readonly reuse: RunnerRecordReuseInput;\n readonly session?: SessionTracker;\n}): Effect.Effect<RunnerRecordCoordinator, RunnerRecordOpenError, import(\"effect\").Scope.Scope | import(\"../record/platform/services.ts\").RecordEntropy | import(\"../coordination/record-leases.ts\").RecordCoordination | ProjectStateDatabase> {\n return Effect.gen(function* () {\n const rootPath = recordRootPaths(input.recordRoot)?.portableRoot;\n if (rootPath === undefined)\n return yield* Effect.fail(new RecordRootInvalid({ code: \"record-root-invalid\" }));\n const seenExperiments = new Set<string>();\n for (const run of input.runs) {\n if (seenExperiments.has(run.experimentId)) {\n return yield* Effect.fail({\n code: \"runner-record-target-identity-invalid\" as const,\n kind: \"invocation\" as const,\n value: `duplicate experimentId ${JSON.stringify(run.experimentId)}`,\n });\n }\n seenExperiments.add(run.experimentId);\n }\n const startedAt = runnerRecordUtcMillis(input.startedAt);\n if (Result.isFailure(startedAt))\n return yield* Effect.fail(startedAt.failure);\n const planned = yield* Effect.forEach(input.runs, (run) => planRunnerRecordRun({\n run,\n evals: input.evals,\n reuse: input.reuse,\n }), { concurrency: 1 });\n const invocationId = input.session?.sessionId ?? createHash(\"sha256\")\n .update(`${input.startedAt}\\u0000${planned.map((entry) => entry.run.experimentId).join(\"\\u0000\")}`, \"utf8\")\n .digest(\"hex\");\n const openedRuns = yield* Effect.forEach(planned, (plan) => recordHost.createRun({\n root: input.recordRoot,\n experimentId: plan.experimentId,\n context: plan.context,\n startedAt: startedAt.success,\n expectedSlots: plan.expectedSlots,\n writerGeneration: createRunWriterGeneration(`${invocationId}:${plan.experimentId}`),\n }).pipe(Effect.map((session) => {\n const writerGeneration = writerGenerationForRunSession(session);\n if (writerGeneration === undefined)\n throw new Error(\"Run writer generation is unavailable\");\n return Object.freeze({ plan, session, writerGeneration });\n })), { concurrency: 1 });\n if (input.session !== undefined) {\n const startedAtIso = new Date(input.startedAt).toISOString();\n yield* input.session.start({\n runIds: new Map(openedRuns.map(({ plan, session }) => [plan.experimentId, String(session.runId)])),\n agentRuns: input.runs,\n startedAt: startedAtIso,\n invocationRuns: openedRuns.map(({ plan, session, writerGeneration }) => ({\n runId: String(session.runId),\n experimentId: plan.experimentId,\n writerGeneration,\n startedAt: startedAtIso,\n expectedSlots: plan.expectedSlots.map((slot) => ({\n slotId: String(slot.slotId), evalId: String(slot.evalId), attemptOrdinal: slot.attemptOrdinal,\n executionIdentityDigest: String(slot.executionIdentityDigest),\n })),\n })),\n }).pipe(Effect.mapError((cause): RunnerSessionOpenFailed => ({ code: \"runner-session-open-failed\", cause })));\n }\n const byRun = new Map<AgentRun, RunnerRecordRun>();\n const byRecordRunId = new Map<RunId, RunnerRecordRun>();\n const runIdsByExperiment = new Map<string, string>();\n const targetRuns: TargetRun[] = [];\n for (const { plan, session, writerGeneration } of openedRuns) {\n const target = targetForRunnerRecordRun({\n planned: plan,\n runId: session.runId,\n startedAt: startedAt.success,\n });\n const recordRun: RunnerRecordRun = {\n ...plan,\n session,\n target,\n attempts: new Map(),\n planSlots: new Map(),\n gapActions: new Map(),\n writerGeneration,\n };\n byRun.set(plan.run, recordRun);\n byRecordRunId.set(session.runId, recordRun);\n runIdsByExperiment.set(plan.run.experimentId, session.runId);\n targetRuns.push(target);\n }\n const target = Object.freeze({\n invocationId,\n runs: Object.freeze(targetRuns),\n });\n const { reusePlan, carriedResults } = yield* Effect.scoped(Effect.gen(function* () {\n const reader = yield* recordHost.openRead({ root: input.recordRoot });\n const reusePlan = yield* planProjectTargetReuse({ reader, target, policy: input.reuse.policy });\n const carriedResults = yield* readCurrentExecutionReusePlanResults({ reader, plan: reusePlan }).pipe(Effect.mapError((cause): RunnerSessionOpenFailed => ({ code: \"runner-session-open-failed\", cause })));\n return { reusePlan, carriedResults };\n }));\n const carriedAttemptsByKey = new Map<string, Set<number>>();\n for (const slot of reusePlan.slots) {\n const recordRun = byRecordRunId.get(slot.runId);\n if (recordRun === undefined)\n return yield* Effect.fail(membershipStateInvalid(slot.slotId));\n recordRun.planSlots.set(slot.slotId, slot);\n if (slot.state === \"reuse\") {\n yield* stagePlanningReference(recordRun.session, {\n slotId: slot.slotId,\n action: \"carried\",\n reference: slot.source.reference,\n });\n yield* bindAttemptReference(rootPath, {\n runId: String(recordRun.session.runId),\n writerGeneration: recordRun.writerGeneration,\n slotId: String(slot.slotId),\n action: \"carried\",\n publicationIdentity: slot.source.reference.publicationIdentity,\n deadlineEpochMs: Date.now() + 30000,\n }).pipe(Effect.mapError((cause): RunnerSessionOpenFailed => ({ code: \"runner-session-open-failed\", cause })));\n const entry = recordRun.slots.get(runnerRecordSlotKey(slot.evalId, slot.attempt));\n if (entry === undefined)\n return yield* Effect.fail(membershipStateInvalid(slot.slotId));\n const key = cacheKey(recordRun.run, entry.evalDef.id);\n const carried = carriedAttemptsByKey.get(key) ?? new Set<number>();\n carried.add(entry.attempt);\n carriedAttemptsByKey.set(key, carried);\n }\n else {\n recordRun.gapActions.set(slot.slotId, \"pending\");\n }\n }\n if (input.session !== undefined) {\n yield* input.session.applyCarriedAttempts(input.runs, carriedAttemptsByKey).pipe(Effect.mapError((cause): RunnerSessionOpenFailed => ({ code: \"runner-session-open-failed\", cause })));\n }\n let invocationWriteFailure: RunnerRecordWriteError | undefined;\n const writeFailuresByRun = new Map<RunnerRecordRun, RunnerRecordWriteError>();\n const noteFailure = (error: RunnerRecordWriteError, recordRun?: RunnerRecordRun): void => {\n if (recordRun === undefined) {\n if (invocationWriteFailure === undefined)\n invocationWriteFailure = error;\n return;\n }\n if (!writeFailuresByRun.has(recordRun))\n writeFailuresByRun.set(recordRun, error);\n };\n const lock = yield* Semaphore.make(1);\n const runForAttempt = (attempt: Attempt): RunnerRecordRun | undefined => byRun.get(attempt.run);\n const targetForAttempt = (attempt: Attempt): {\n readonly recordRun: RunnerRecordRun;\n readonly slotId: SlotId;\n readonly plan: ExecutionReusePlanSlot;\n } | undefined => {\n const recordRun = runForAttempt(attempt);\n if (recordRun === undefined)\n return undefined;\n const entry = recordRun.slots.get(runnerRecordSlotKey(attempt.evalDef.id, attempt.attempt));\n if (entry === undefined)\n return undefined;\n const plan = recordRun.planSlots.get(entry.slot.slotId);\n return plan === undefined ? undefined : { recordRun, slotId: entry.slot.slotId, plan };\n };\n const adoptLatePublishedAttempt = (attempt: Attempt) => lock.withPermits(1)(Effect.gen(function* () {\n const current = targetForAttempt(attempt);\n if (current === undefined\n || current.plan.state !== \"gap\"\n || current.recordRun.gapActions.get(current.slotId) !== \"pending\")\n return false;\n const refreshed = yield* Effect.scoped(Effect.gen(function* () {\n const freshReader = yield* recordHost.openRead({ root: input.recordRoot });\n return yield* planProjectTargetReuse({ reader: freshReader, target, policy: input.reuse.policy });\n }));\n const replacement = refreshed.slots.find((slot) => slot.runId === current.recordRun.target.runId && slot.slotId === current.slotId);\n if (replacement?.state !== \"reuse\")\n return false;\n yield* stagePlanningReference(current.recordRun.session, {\n slotId: current.slotId,\n action: \"carried\",\n reference: replacement.source.reference,\n });\n yield* bindAttemptReference(rootPath, {\n runId: String(current.recordRun.session.runId),\n writerGeneration: current.recordRun.writerGeneration,\n slotId: String(current.slotId),\n action: \"carried\",\n publicationIdentity: replacement.source.reference.publicationIdentity,\n deadlineEpochMs: Date.now() + 30000,\n }).pipe(Effect.mapError(() => publishStateInvalid(current.recordRun.session.runId)));\n current.recordRun.planSlots.set(current.slotId, replacement);\n current.recordRun.gapActions.delete(current.slotId);\n return true;\n }));\n const reserveAttempt = (attempt: Attempt): Effect.Effect<RunnerRecordAttempt, RunnerRecordWriteError, ProjectStateDatabase> => {\n const targetSlot = targetForAttempt(attempt);\n return lock.withPermits(1)(Effect.gen(function* () {\n if (targetSlot === undefined\n || targetSlot.plan.state !== \"gap\"\n || targetSlot.recordRun.gapActions.get(targetSlot.slotId) !== \"pending\") {\n return yield* Effect.fail(attemptInvalid());\n }\n const session = yield* targetSlot.recordRun.session.createAttempt({ slotId: targetSlot.slotId });\n const publicAttempt = Object.freeze({\n slotId: targetSlot.slotId,\n attemptId: session.attemptId,\n locator: encodeAttemptLocator(session.attemptId),\n });\n targetSlot.recordRun.attempts.set(targetSlot.slotId, {\n attempt,\n session,\n public: publicAttempt,\n completed: false,\n });\n targetSlot.recordRun.gapActions.set(targetSlot.slotId, \"reserved\");\n return publicAttempt;\n })).pipe(Effect.tapError((error) => Effect.sync(() => noteFailure(error, targetSlot?.recordRun ?? runForAttempt(attempt)))));\n };\n const noteSealedOrMarkIncomplete = (attempt: Attempt, sealed: SealedAttemptAssertions): Effect.Effect<void, never> => Effect.sync(() => {\n const targetSlot = targetForAttempt(attempt);\n const active = targetSlot === undefined\n ? undefined\n : targetSlot.recordRun.attempts.get(targetSlot.slotId);\n if (targetSlot === undefined\n || targetSlot.plan.state !== \"gap\"\n || targetSlot.recordRun.gapActions.get(targetSlot.slotId) !== \"reserved\"\n || active === undefined\n || active.attempt !== attempt\n || active.sealed !== undefined) {\n noteFailure(attemptInvalid(), targetSlot?.recordRun ?? runForAttempt(attempt));\n return;\n }\n active.sealed = sealed;\n });\n const completeAttempt = (attempt: Attempt, result: EvalResult): Effect.Effect<RunnerRecordAttempt, RunnerRecordWriteError, ProjectStateDatabase> => Effect.suspend<RunnerRecordAttempt, RunnerRecordWriteError, ProjectStateDatabase>(() => {\n const targetSlot = targetForAttempt(attempt);\n const active = targetSlot === undefined\n ? undefined\n : targetSlot.recordRun.attempts.get(targetSlot.slotId);\n if (targetSlot === undefined\n || targetSlot.plan.state !== \"gap\"\n || targetSlot.recordRun.gapActions.get(targetSlot.slotId) !== \"reserved\"\n || active === undefined\n || active.attempt !== attempt\n || active.completed) {\n return Effect.fail(attemptInvalid());\n }\n const assertions = active.sealed === undefined\n ? undefined\n : createRunnerAssertionsAttachment(active.sealed);\n if (assertions !== undefined && Result.isFailure(assertions))\n return Effect.fail(assertions.failure);\n if (active.sealed === undefined || assertions === undefined || Result.isFailure(assertions)) {\n return Effect.fail(membershipStateInvalid(targetSlot.slotId));\n }\n return Effect.gen(function* () {\n const sourcePlan = createRunnerSourceWritePlan([Object.freeze({\n slotId: targetSlot.slotId,\n result,\n assertionEntryIds: assertions.success.entryIds,\n })]);\n if (Result.isFailure(sourcePlan)) {\n return yield* Effect.fail(Object.freeze({\n code: \"runner-record-sources-invalid\" as const,\n issue: sourcePlan.failure,\n }));\n }\n const closedAssertions = createRunnerAssertionsAttachment(active.sealed!, {\n entryIds: assertions.success.entryIds,\n sourceSites: sourcePlan.success.sourceSitesBySlot.get(targetSlot.slotId),\n });\n if (Result.isFailure(closedAssertions))\n return yield* Effect.fail(closedAssertions.failure);\n yield* active.session.records.write(NiceEvalRecordAttachments.assertions, closedAssertions.success.attachment);\n yield* active.session.records.write(NiceEvalRecordAttachments.attemptCost, createAttemptCostAttachment(result));\n const sourceReceipts = yield* createAttemptObservabilityAttachments({ result, sealed: active.sealed! });\n if (sourceReceipts.agentTurns !== undefined) {\n yield* active.session.records.write(NiceEvalRecordAttachments.agentTurns, sourceReceipts.agentTurns);\n }\n if (sourceReceipts.sandboxCommands !== undefined) {\n yield* active.session.records.write(NiceEvalRecordAttachments.sandboxCommands, sourceReceipts.sandboxCommands);\n }\n yield* active.session.records.write(NiceEvalRecordAttachments.runnerActivities.attempt, sourceReceipts.runnerActivities);\n yield* active.session.records.write(NiceEvalRecordAttachments.runnerDiagnostics.attempt, sourceReceipts.runnerDiagnostics);\n const turnContexts = createRunnerTurnContextsAttachment({ result, sourcePlan: sourcePlan.success });\n if (Result.isFailure(turnContexts)) {\n return yield* Effect.fail(Object.freeze({\n code: \"runner-record-sources-invalid\" as const,\n issue: turnContexts.failure,\n }));\n }\n if (turnContexts.success !== undefined) {\n yield* active.session.records.write(NiceEvalRecordAttachments.turnContexts, turnContexts.success);\n }\n const fileChanges = createAttemptFileChangesAttachment(result);\n if (fileChanges !== undefined) {\n yield* active.session.records.write(NiceEvalRecordAttachments.fileChanges, fileChanges);\n }\n const attachmentSnapshot = adapterAttachmentsForResult(result);\n const artifacts = createAttemptArtifactsAttachment(result, attachmentSnapshot);\n const judgeUsage = judgeUsageForResult(result, closedAssertions.success.entryIds);\n if (judgeUsage !== undefined)\n yield* active.session.records.write(NiceEvalRecordAttachments.judgeUsage, judgeUsage);\n const adapterUsage = adapterUsageForResult(result);\n const executionTraces = adapterExecutionTracesForResult(result);\n if (adapterUsage !== undefined) {\n yield* active.session.records.write(NiceEvalRecordAttachments.adapterUsage, adapterUsage);\n }\n if (artifacts !== undefined) {\n yield* active.session.records.write(NiceEvalRecordAttachments.artifacts.attempt, artifacts);\n }\n if (executionTraces !== undefined && executionTraces.traces.length > 0) {\n validateExecutionTracePublication(executionTraces, attachmentSnapshot?.artifacts ?? []);\n yield* active.session.records.appendAll(executionTracesRecordCollection, Stream.fromIterable(executionTraces.traces.flatMap((trace) => trace.records)));\n yield* active.session.records.close(executionTracesRecordCollection, executionTraces.failure === undefined\n ? { state: \"complete\" }\n : {\n state: \"partial\",\n limitations: [{ code: \"capture-failed\", stage: \"adapter\" }],\n });\n }\n yield* active.session.complete(recordAttemptOutcome(result));\n const closureBytes = new TextEncoder().encode(JSON.stringify(attemptPublicationClosure(Object.freeze({\n runId: String(targetSlot.recordRun.session.runId),\n experimentId: targetSlot.recordRun.experimentId,\n context: targetSlot.recordRun.context,\n startedAt: targetSlot.recordRun.target.startedAt,\n completedAt: Date.now(),\n expectedSlots: targetSlot.recordRun.expectedSlots,\n }))));\n yield* publishOriginAttempt(rootPath, {\n runId: String(targetSlot.recordRun.session.runId),\n writerGeneration: targetSlot.recordRun.writerGeneration,\n slotId: String(targetSlot.slotId),\n attemptId: String(active.public.attemptId),\n attemptLocator: String(active.public.locator),\n closureBytes,\n closureDigest: createHash(\"sha256\").update(closureBytes).digest(\"hex\"),\n deadlineEpochMs: Date.now() + 30000,\n }).pipe(Effect.mapError((cause) => attemptPublicationFailed(active.public.locator, cause)));\n active.result = result;\n active.assertionEntryIds = assertions.success.entryIds;\n active.completed = true;\n targetSlot.recordRun.gapActions.set(targetSlot.slotId, \"executed\");\n return active.public;\n });\n });\n const attachRunFacts = (recordRun: RunnerRecordRun, mode: \"normal\" | \"interrupted\"): Effect.Effect<void, RunnerRecordWriteError> => Effect.gen(function* () {\n const writeRecord = (effect: Effect.Effect<void, RecordWriteError, never>): Effect.Effect<void, RecordWriteError, never> => effect;\n const origins = [] as {\n readonly slotId: SlotId;\n readonly active: ActiveRunnerRecordAttempt;\n readonly result: EvalResult;\n readonly sealed: SealedAttemptAssertions;\n readonly assertionEntryIds: readonly AssertionEntryId[];\n }[];\n for (const [slotId, state] of recordRun.gapActions) {\n if (state !== \"executed\")\n continue;\n const active = recordRun.attempts.get(slotId);\n if (active === undefined)\n return yield* Effect.fail(membershipStateInvalid(slotId));\n const result = active.result;\n const sealed = active?.sealed;\n const assertionEntryIds = active?.assertionEntryIds;\n if (result === undefined || sealed === undefined || assertionEntryIds === undefined)\n continue;\n origins.push(Object.freeze({ slotId, active, result, sealed, assertionEntryIds }));\n }\n const sources = createRunnerSourceWritePlan(origins.map(({ slotId, result, assertionEntryIds }) => Object.freeze({\n slotId,\n result,\n assertionEntryIds,\n })));\n if (Result.isFailure(sources)) {\n return yield* Effect.fail(Object.freeze({\n code: \"runner-record-sources-invalid\" as const,\n issue: sources.failure,\n }));\n }\n yield* writeRecord(recordRun.session.records.write(NiceEvalRecordAttachments.sources, sources.success.sources));\n const sourceReceipts = yield* createRunObservabilityAttachments(recordRun.run);\n if (sourceReceipts.runnerActivities !== undefined) {\n yield* writeRecord(recordRun.session.records.write(NiceEvalRecordAttachments.runnerActivities.run, sourceReceipts.runnerActivities));\n }\n if (sourceReceipts.runnerDiagnostics !== undefined) {\n yield* writeRecord(recordRun.session.records.write(NiceEvalRecordAttachments.runnerDiagnostics.run, sourceReceipts.runnerDiagnostics));\n }\n yield* writeRecord(recordRun.session.records.write(NiceEvalRecordAttachments.artifacts.run, createRunArtifactsAttachment()));\n });\n const pendingGap = (recordRun: RunnerRecordRun): SlotId | undefined => {\n for (const [slotId, state] of recordRun.gapActions) {\n if (state === \"pending\")\n return slotId;\n }\n return undefined;\n };\n return Object.freeze({\n reusePlan,\n readCarriedResults: () => Effect.succeed(carriedResults),\n runIdsByExperiment: new Map(runIdsByExperiment),\n publicationCutoff: () => currentPublicationCutoff(rootPath),\n carriedAttemptsByKey: new Map([...carriedAttemptsByKey].map(([key, attempts]) => [key, new Set(attempts)] as const)),\n adoptLatePublishedAttempt,\n reserveAttempt,\n noteSealedOrMarkIncomplete,\n completeAttemptOrMarkIncomplete: (attempt: Attempt, result: EvalResult) => completeAttempt(attempt, result).pipe(Effect.catch((error) => Effect.sync(() => {\n const target = targetForAttempt(attempt);\n const active = target === undefined ? undefined : target.recordRun.attempts.get(target.slotId);\n noteFailure(error.code === \"runner-record-assertions-invalid\" ||\n error.code === \"runner-record-attempt-publication-failed\" ||\n active === undefined\n ? error\n : attemptPublicationFailed(active.public.locator, error), target?.recordRun ?? runForAttempt(attempt));\n return undefined;\n })), Effect.ensuring(Effect.promise(() => releaseAdapterAttachments(result)))),\n markNotDispatched: (attempt: Attempt) => {\n const targetSlot = targetForAttempt(attempt);\n if (targetSlot !== undefined\n && targetSlot.plan.state === \"gap\"\n && targetSlot.recordRun.gapActions.get(targetSlot.slotId) === \"pending\") {\n targetSlot.recordRun.gapActions.set(targetSlot.slotId, \"not-dispatched\");\n }\n },\n publish: (completedAt: number, mode: \"normal\" | \"interrupted\") => Effect.gen(function* () {\n const recordRuns = [...byRun.values()];\n if (invocationWriteFailure !== undefined)\n return yield* Effect.fail(invocationWriteFailure);\n if (mode === \"normal\") {\n // A normal finish remains invocation-strict: a failure which can be\n // attributed to one Run still fails the call rather than allowing a\n // partial receipt to disguise it as ordinary completion.\n for (const recordRun of recordRuns) {\n const failure = writeFailuresByRun.get(recordRun);\n if (failure !== undefined)\n return yield* Effect.fail(failure);\n }\n }\n const completion = runnerRecordUtcMillis(completedAt);\n if (Result.isFailure(completion))\n return yield* Effect.fail(completion.failure);\n // A controlled interruption closes every reserved Attempt as\n // `interrupted` and every never-started gap as an interrupted terminal\n // Member. Only a Run-local writer failure remains non-publishable.\n // Abrupt process loss still has no opportunity to create `complete`.\n const incompleteRuns = mode === \"interrupted\"\n ? new Set(recordRuns.filter((recordRun) => writeFailuresByRun.has(recordRun)))\n : new Set<RunnerRecordRun>();\n if (mode === \"normal\") {\n // Normal completion is deliberately invocation-strict. A pending\n // gap means the scheduler failed to account for a Slot; a reserved\n // or otherwise unsettled Attempt is likewise not publishable.\n for (const recordRun of recordRuns) {\n const unsettledSlot = [...recordRun.gapActions.keys()].find((slotId) => {\n const active = recordRun.attempts.get(slotId);\n return recordRun.gapActions.get(slotId) === \"reserved\"\n || (active !== undefined && !active.completed);\n });\n if (unsettledSlot !== undefined)\n return yield* Effect.fail(unsealedAttempt(unsettledSlot));\n const unaccountedSlot = pendingGap(recordRun);\n if (unaccountedSlot !== undefined)\n return yield* Effect.fail(unsealedAttempt(unaccountedSlot));\n }\n }\n else {\n for (const recordRun of recordRuns) {\n if (incompleteRuns.has(recordRun))\n continue;\n for (const [slotId, state] of recordRun.gapActions) {\n if (state === \"pending\")\n recordRun.gapActions.set(slotId, \"interrupted\");\n if (state === \"reserved\") {\n const active = recordRun.attempts.get(slotId);\n if (active === undefined)\n return yield* Effect.fail(membershipStateInvalid(slotId));\n yield* discardAttemptWriteSession(active.session);\n recordRun.attempts.delete(slotId);\n recordRun.gapActions.set(slotId, \"interrupted\");\n }\n }\n }\n }\n const publishableRuns = recordRuns.filter((recordRun) => !incompleteRuns.has(recordRun));\n const publishOne = (recordRun: RunnerRecordRun): Effect.Effect<RecordSealReceipt, RunnerRecordWriteError, ProjectStateDatabase> => Effect.gen(function* () {\n yield* attachRunFacts(recordRun, mode);\n for (const [slotId, state] of recordRun.gapActions) {\n if (state === \"not-dispatched\" || state === \"interrupted\") {\n const absenceReason: RunAbsenceReason = mode === \"interrupted\"\n ? \"interrupted-before-publication\"\n : state === \"not-dispatched\"\n ? \"early-exit-satisfied\"\n : \"dispatch-failed\";\n yield* recordRun.session.recordTerminalMember({ slotId, action: state, absenceReason });\n }\n }\n const sealed = yield* recordRun.session.seal({ completedAt: completion.success });\n const absences = [...recordRun.gapActions].flatMap(([slotId, state]) => {\n if (state === \"executed\" && recordRun.attempts.get(slotId)?.completed === true)\n return [];\n const reason: RunAbsenceReason = mode === \"interrupted\"\n ? \"interrupted-before-publication\"\n : state === \"not-dispatched\"\n ? \"early-exit-satisfied\"\n : \"dispatch-failed\";\n return [{ slotId: String(slotId), reason }];\n });\n yield* closeRunResource(rootPath, {\n runId: String(recordRun.session.runId),\n writerGeneration: recordRun.writerGeneration,\n state: mode === \"interrupted\" ? \"interrupted\" : \"completed\",\n completedAt: new Date(completedAt).toISOString(),\n absences,\n deadlineEpochMs: Date.now() + 30000,\n }).pipe(Effect.mapError(() => publishStateInvalid(recordRun.session.runId)));\n return sealed;\n });\n if (mode === \"normal\") {\n // Normal completion remains typed and strict: the first Run failure\n // is an invocation failure, never a partial success receipt.\n return yield* Effect.forEach(publishableRuns, publishOne, { concurrency: 1 });\n }\n // SIGINT is different: each clean sibling receives its own complete\n // attempt. We deliberately observe an Exit per Run so one Attachment\n // or seal error cannot short-circuit subsequent safe siblings.\n const receipts: RecordSealReceipt[] = [];\n for (const recordRun of publishableRuns) {\n const exit = yield* Effect.exit(publishOne(recordRun));\n if (Exit.isSuccess(exit)) {\n receipts.push(exit.value);\n }\n else {\n const failure = Cause.findErrorOption(exit.cause);\n if (Option.isSome(failure)) {\n noteFailure(failure.value, recordRun);\n }\n else {\n noteFailure(publishStateInvalid(recordRun.session.runId), recordRun);\n }\n }\n }\n return Object.freeze(receipts);\n }),\n });\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["record.ts"],"names":[],"mappings":";;;AA0IA,sEAqDC;AAiCD,kEA+hBC;AA/vBD,yDAA2D;AAC3D,qDAAuD;AACvD,6CAAyC;AACzC,qCAAqC;AACrC,mCAAgF;AAChF,8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M,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;oBACvD,IAAI,aAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;wBACvB,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBAC9B,CAAC;yBACI,CAAC;wBACF,MAAM,OAAO,GAAG,cAAK,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;wBAClD,IAAI,eAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;4BACzB,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;wBAC1C,CAAC;6BACI,CAAC;4BACF,WAAW,CAAC,mBAAmB,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;wBACzE,CAAC;oBACL,CAAC;gBACL,CAAC;gBACD,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YACnC,CAAC,CAAC;SACL,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { attemptNotesForResult } from \"./attempt-notes.ts\";\nimport { judgeUsageForResult } from \"./judge-usage.ts\";\nimport { createHash } from \"node:crypto\";\nimport { existsSync } from \"node:fs\";\nimport { Cause, Effect, Result, Exit, Option, Semaphore, Stream } from \"effect\";\nimport { encodeAttemptLocator, type AttemptLocator } from \"../attempt-locator.ts\";\nimport type { SealedAttemptAssertions } from \"../assertions/api.ts\";\nimport type { AssertionsProducerError } from \"../assertions/record/producer.ts\";\nimport { NiceEvalRecordAttachments } from \"../record/family/catalog.ts\";\nimport { recordHost } from \"../record/host/runtime.ts\";\nimport { discardAttemptWriteSession, stagePlanningReference, writerGenerationForRunSession } from \"../record/host/sqlite-host.ts\";\nimport type { AttemptWriteSession, RecordSealReceipt, RunWriteSession, } from \"../record/host/types.ts\";\nimport type { RunId, SlotId, } from \"../record/model/identifiers.ts\";\nimport type { AssertionEntryId } from \"../assertions/identity.ts\";\nimport { recordRootPaths, type RecordRoot } from \"../record/platform/root.ts\";\nimport { attemptPublicationClosure } from \"../record/codec/core.ts\";\nimport { RecordRootInvalid } from \"../record/platform/errors.ts\";\nimport { recordSqlitePath } from \"../record/sqlite/index.ts\";\nimport type { ProjectStateDatabase } from \"../record/sqlite/project-state-database.ts\";\nimport type { RecordReaderOpenError, RecordReaderReadError, } from \"../record/reader/errors.ts\";\nimport type { RecordWriteError } from \"../record/writer/types.ts\";\nimport { bindAttemptReference, closeRunResource, currentPublicationCutoff, publishOriginAttempt, createRunWriterGeneration, type PublicationCutoff, type RunAbsenceReason, } from \"../run/storage/index.ts\";\nimport { cacheKey } from \"./fingerprint.ts\";\nimport { planProjectTargetReuse, planProjectTargetReuseWithoutSources, type ExecutionReusePlan, type ExecutionReusePlanSlot, type ProjectTargetReusePlanInvalid, type TargetRun, } from \"./reuse-plan.ts\";\nimport { readCurrentExecutionReusePlanReadbacks, readCurrentExecutionReusePlanResults, type CurrentReusedAttemptReadback, type CurrentReuseReadback, type CurrentReuseReadbackPlanInvalid, } from \"./reuse-readback.ts\";\nimport { createRunnerTurnContextsAttachment, createRunnerSourceWritePlan, type RunnerSourceProducerInvalid, } from \"./source-producer.ts\";\nimport { createAttemptArtifactsAttachment, createAttemptFileChangesAttachment, createAttemptObservabilityAttachments, createRunArtifactsAttachment, createRunnerAssertionsAttachment, createRunObservabilityAttachments, recordAttemptOutcome, } from \"./record/attachments.ts\";\nimport { adapterUsageForResult } from \"./adapter-usage.ts\";\nimport { adapterAttachmentsForResult, releaseAdapterAttachments } from \"./adapter-attachments.ts\";\nimport { adapterExecutionTracesForResult, validateExecutionTracePublication, } from \"./adapter-execution-trace.ts\";\nimport { executionTracesRecordCollection } from \"../record/family/execution-traces/definition.ts\";\nimport { planRunnerRecordRun, previewRunnerRunId, runnerRecordSlotKey, runnerRecordUtcMillis, targetForRunnerRecordRun, type PlannedRunnerRecordRun, type RunnerRecordReuseInput, type RunnerRecordTargetIdentityInvalid, type RunnerRecordTargetInputMissing, } from \"./record/planning.ts\";\nimport type { AgentRun, Attempt, DiscoveredEval, EvalResult, } from \"./types.ts\";\nimport type { AttemptCostAttachment } from \"../record/family/attempt-cost/definition.ts\";\nimport { getPricingEstimateReceipt } from \"./pricing-estimate-receipt.ts\";\nimport type { SessionTracker } from \"./session.ts\";\nexport { prepareRunnerRecordReuse, type RunnerRecordReuseInput, type RunnerRecordReusePreparationInput, type RunnerRecordReuseSlotInput, type RunnerRecordTargetIdentityInvalid, type RunnerRecordTargetInputMissing, } from \"./record/planning.ts\";\ntype GapActionState = \"pending\" | \"reserved\" | \"executed\" | \"not-dispatched\" | \"interrupted\";\ninterface ActiveRunnerRecordAttempt {\n readonly attempt: Attempt;\n readonly session: AttemptWriteSession;\n readonly public: RunnerRecordAttempt;\n sealed?: SealedAttemptAssertions;\n result?: EvalResult;\n assertionEntryIds?: readonly AssertionEntryId[];\n completed: boolean;\n}\ninterface RunnerRecordRun extends PlannedRunnerRecordRun {\n readonly session: RunWriteSession;\n readonly target: TargetRun;\n readonly attempts: Map<SlotId, ActiveRunnerRecordAttempt>;\n readonly planSlots: Map<SlotId, ExecutionReusePlanSlot>;\n readonly gapActions: Map<SlotId, GapActionState>;\n readonly writerGeneration: string;\n}\nexport interface RunnerRecordAttempt {\n readonly slotId: SlotId;\n readonly attemptId: import(\"../record/model/identifiers.ts\").AttemptId;\n readonly locator: AttemptLocator;\n}\nexport type RecordAttemptLocator = AttemptLocator;\nfunction createAttemptCostAttachment(result: EvalResult): AttemptCostAttachment {\n const receipt = getPricingEstimateReceipt(result);\n return Object.freeze({\n ...(result.usage?.costUSD === undefined ? {} : {\n observed: Object.freeze({ kind: \"observed\" as const, amountUSD: result.usage.costUSD }),\n }),\n ...(receipt === undefined ? {} : {\n estimated: Object.freeze({\n kind: \"estimated\" as const,\n amountUSD: receipt.amountUSD,\n model: receipt.model,\n priceSource: receipt.priceSource,\n charges: receipt.charges,\n }),\n }),\n });\n}\nexport interface RunnerRecordAttemptInvalid {\n readonly code: \"runner-record-attempt-invalid\";\n}\nexport interface RunnerRecordUnsealedAttempt {\n readonly code: \"runner-record-attempt-unsealed\";\n readonly slotId: SlotId;\n}\nexport interface RunnerRecordMembershipStateInvalid {\n readonly code: \"runner-record-membership-state-invalid\";\n readonly slotId: SlotId;\n}\nexport interface RunnerRecordAttemptPublicationFailed {\n readonly code: \"runner-record-attempt-publication-failed\";\n readonly locator: AttemptLocator;\n readonly cause: unknown;\n readonly message: string;\n}\n/** A seal return without its durable marker is never a publish receipt. */\nexport interface RunnerRecordPublishStateInvalid {\n readonly code: \"runner-record-publish-state-invalid\";\n readonly runId: RunId;\n}\nexport interface RunnerRecordAssertionsInvalid {\n readonly code: \"runner-record-assertions-invalid\";\n readonly issue: AssertionsProducerError;\n}\nexport interface RunnerRecordObservabilityInvalid {\n readonly code: \"runner-record-observability-invalid\";\n readonly owner: \"attempt\" | \"run\";\n readonly stage: \"capture\" | \"attachment\";\n}\nexport interface RunnerRecordSourcesInvalid {\n readonly code: \"runner-record-sources-invalid\";\n readonly issue: RunnerSourceProducerInvalid;\n}\nexport interface RunnerRecordArtifactsInvalid {\n readonly code: \"runner-record-artifacts-invalid\";\n readonly owner: \"attempt\" | \"run\";\n readonly reason: \"trace-serialization-failed\" | \"attachment-closure-invalid\";\n}\nexport type RunnerRecordWriteError = RecordWriteError | RunnerRecordAttemptInvalid | RunnerRecordUnsealedAttempt | RunnerRecordMembershipStateInvalid | RunnerRecordAttemptPublicationFailed | RunnerRecordPublishStateInvalid | RunnerRecordTargetIdentityInvalid | RunnerRecordAssertionsInvalid | RunnerRecordObservabilityInvalid | RunnerRecordSourcesInvalid | RunnerRecordArtifactsInvalid;\nexport type RunnerRecordOpenError = RecordReaderOpenError | RecordWriteError | RecordReaderReadError | ProjectTargetReusePlanInvalid | RunnerRecordTargetInputMissing | RunnerRecordTargetIdentityInvalid | RunnerRecordMembershipStateInvalid | RunnerSessionOpenFailed;\nexport interface RunnerSessionOpenFailed {\n readonly code: \"runner-session-open-failed\";\n readonly cause: unknown;\n}\nexport interface RunnerRecordCoordinator {\n readonly reusePlan: ExecutionReusePlan;\n readonly readCarriedResults: () => Effect.Effect<readonly CurrentReusedAttemptReadback[], RecordReaderReadError | CurrentReuseReadbackPlanInvalid>;\n readonly runIdsByExperiment: ReadonlyMap<string, string>;\n readonly publicationCutoff: () => Effect.Effect<PublicationCutoff, unknown, ProjectStateDatabase>;\n readonly carriedAttemptsByKey: ReadonlyMap<string, ReadonlySet<number>>;\n readonly adoptLatePublishedAttempt: (attempt: Attempt) => Effect.Effect<boolean, RecordReaderOpenError | RecordReaderReadError | ProjectTargetReusePlanInvalid | RunnerRecordWriteError, import(\"effect\").Scope.Scope | import(\"../coordination/record-leases.ts\").RecordCoordination | ProjectStateDatabase>;\n readonly reserveAttempt: (attempt: Attempt) => Effect.Effect<RunnerRecordAttempt, RunnerRecordWriteError, ProjectStateDatabase>;\n readonly noteSealedOrMarkIncomplete: (attempt: Attempt, sealed: SealedAttemptAssertions) => Effect.Effect<void, never>;\n readonly completeAttemptOrMarkIncomplete: (attempt: Attempt, result: EvalResult) => Effect.Effect<RunnerRecordAttempt | undefined, never, ProjectStateDatabase>;\n readonly markNotDispatched: (attempt: Attempt) => void;\n readonly publish: (completedAt: number, mode: \"normal\" | \"interrupted\") => Effect.Effect<readonly RecordSealReceipt[], RunnerRecordWriteError, ProjectStateDatabase>;\n}\n/** Current preview preserves the read Scope and never creates a Run row. */\nexport function withRunnerCurrentReusePreview<A, E, R>(input: {\n readonly recordRoot: RecordRoot;\n readonly startedAt: number;\n readonly evals: readonly DiscoveredEval[];\n readonly runs: readonly AgentRun[];\n readonly reuse: RunnerRecordReuseInput;\n readonly use: (preview: {\n readonly reusePlan: ExecutionReusePlan;\n readonly readReadbacks: () => Effect.Effect<readonly CurrentReuseReadback[], RecordReaderReadError | CurrentReuseReadbackPlanInvalid>;\n }) => Effect.Effect<A, E, R>;\n}): Effect.Effect<A, E | RunnerRecordOpenError, R | import(\"effect\").Scope.Scope | import(\"../coordination/record-leases.ts\").RecordCoordination | ProjectStateDatabase> {\n return Effect.scoped(Effect.gen(function* () {\n const startedAt = runnerRecordUtcMillis(input.startedAt);\n if (Result.isFailure(startedAt))\n return yield* Effect.fail(startedAt.failure);\n const planned = yield* Effect.forEach(input.runs, (run) => planRunnerRecordRun({\n run,\n evals: input.evals,\n reuse: input.reuse,\n }), { concurrency: 1 });\n const previewRuns: TargetRun[] = [];\n for (const plan of planned) {\n const runId = previewRunnerRunId(plan.run);\n if (Result.isFailure(runId))\n return yield* Effect.fail(runId.failure);\n previewRuns.push(targetForRunnerRecordRun({ planned: plan, runId: runId.success, startedAt: startedAt.success }));\n }\n const target = Object.freeze({\n invocationId: `preview-${createHash(\"sha256\").update(String(input.startedAt), \"utf8\").digest(\"hex\")}`,\n runs: Object.freeze(previewRuns),\n });\n const rootPath = recordRootPaths(input.recordRoot)?.portableRoot;\n if (rootPath === undefined)\n return yield* Effect.fail(new RecordRootInvalid({ code: \"record-root-invalid\" }));\n const recordDatabase = recordSqlitePath(rootPath);\n if (!existsSync(recordDatabase)) {\n const reusePlan = yield* planProjectTargetReuseWithoutSources({ target, policy: input.reuse.policy });\n return yield* input.use({\n reusePlan,\n readReadbacks: () => Effect.succeed(Object.freeze([])),\n });\n }\n const { reusePlan, readbacks } = yield* Effect.scoped(Effect.gen(function* () {\n const reader = yield* recordHost.openRead({ root: input.recordRoot });\n const reusePlan = yield* planProjectTargetReuse({ reader, target, policy: input.reuse.policy });\n const readbacks = yield* readCurrentExecutionReusePlanReadbacks({ reader, plan: reusePlan }).pipe(Effect.mapError((cause): RunnerSessionOpenFailed => ({ code: \"runner-session-open-failed\", cause })));\n return { reusePlan, readbacks };\n }));\n return yield* input.use({\n reusePlan,\n readReadbacks: () => Effect.succeed(readbacks),\n });\n }));\n}\nfunction attemptInvalid(): RunnerRecordAttemptInvalid {\n return Object.freeze({ code: \"runner-record-attempt-invalid\" as const });\n}\nfunction unsealedAttempt(slotId: SlotId): RunnerRecordUnsealedAttempt {\n return Object.freeze({ code: \"runner-record-attempt-unsealed\" as const, slotId });\n}\nfunction membershipStateInvalid(slotId: SlotId): RunnerRecordMembershipStateInvalid {\n return Object.freeze({ code: \"runner-record-membership-state-invalid\" as const, slotId });\n}\nfunction attemptPublicationFailed(locator: AttemptLocator, cause: unknown): RunnerRecordAttemptPublicationFailed {\n const detail = cause instanceof Error\n ? cause.message\n : typeof cause === \"object\" && cause !== null && typeof Reflect.get(cause, \"message\") === \"string\"\n ? String(Reflect.get(cause, \"message\"))\n : typeof cause === \"object\" && cause !== null && typeof Reflect.get(cause, \"code\") === \"string\"\n ? String(Reflect.get(cause, \"code\"))\n : String(cause);\n return Object.freeze({\n code: \"runner-record-attempt-publication-failed\" as const,\n locator,\n cause,\n message: `Attempt publication failed for ${locator}: ${detail}`,\n });\n}\nfunction publishStateInvalid(runId: RunId): RunnerRecordPublishStateInvalid {\n return Object.freeze({ code: \"runner-record-publish-state-invalid\" as const, runId });\n}\n/**\n * Opens one new per-Experiment Run session, selects only sealed historical\n * Runs, and writes carry references before dispatch. No global Record writer\n * lock or superseded draft/attachment contract participates in this boundary.\n */\nexport function openRunnerRecordCoordinator(input: {\n readonly recordRoot: RecordRoot;\n readonly startedAt: number;\n readonly evals: readonly DiscoveredEval[];\n readonly runs: readonly AgentRun[];\n readonly reuse: RunnerRecordReuseInput;\n readonly session?: SessionTracker;\n}): Effect.Effect<RunnerRecordCoordinator, RunnerRecordOpenError, import(\"effect\").Scope.Scope | import(\"../record/platform/services.ts\").RecordEntropy | import(\"../coordination/record-leases.ts\").RecordCoordination | ProjectStateDatabase> {\n return Effect.gen(function* () {\n const rootPath = recordRootPaths(input.recordRoot)?.portableRoot;\n if (rootPath === undefined)\n return yield* Effect.fail(new RecordRootInvalid({ code: \"record-root-invalid\" }));\n const seenExperiments = new Set<string>();\n for (const run of input.runs) {\n if (seenExperiments.has(run.experimentId)) {\n return yield* Effect.fail({\n code: \"runner-record-target-identity-invalid\" as const,\n kind: \"invocation\" as const,\n value: `duplicate experimentId ${JSON.stringify(run.experimentId)}`,\n });\n }\n seenExperiments.add(run.experimentId);\n }\n const startedAt = runnerRecordUtcMillis(input.startedAt);\n if (Result.isFailure(startedAt))\n return yield* Effect.fail(startedAt.failure);\n const planned = yield* Effect.forEach(input.runs, (run) => planRunnerRecordRun({\n run,\n evals: input.evals,\n reuse: input.reuse,\n }), { concurrency: 1 });\n const invocationId = input.session?.sessionId ?? createHash(\"sha256\")\n .update(`${input.startedAt}\\u0000${planned.map((entry) => entry.run.experimentId).join(\"\\u0000\")}`, \"utf8\")\n .digest(\"hex\");\n const openedRuns = yield* Effect.forEach(planned, (plan) => recordHost.createRun({\n root: input.recordRoot,\n experimentId: plan.experimentId,\n context: plan.context,\n startedAt: startedAt.success,\n expectedSlots: plan.expectedSlots,\n writerGeneration: createRunWriterGeneration(`${invocationId}:${plan.experimentId}`),\n }).pipe(Effect.map((session) => {\n const writerGeneration = writerGenerationForRunSession(session);\n if (writerGeneration === undefined)\n throw new Error(\"Run writer generation is unavailable\");\n return Object.freeze({ plan, session, writerGeneration });\n })), { concurrency: 1 });\n if (input.session !== undefined) {\n const startedAtIso = new Date(input.startedAt).toISOString();\n yield* input.session.start({\n runIds: new Map(openedRuns.map(({ plan, session }) => [plan.experimentId, String(session.runId)])),\n agentRuns: input.runs,\n startedAt: startedAtIso,\n invocationRuns: openedRuns.map(({ plan, session, writerGeneration }) => ({\n runId: String(session.runId),\n experimentId: plan.experimentId,\n writerGeneration,\n startedAt: startedAtIso,\n expectedSlots: plan.expectedSlots.map((slot) => ({\n slotId: String(slot.slotId), evalId: String(slot.evalId), attemptOrdinal: slot.attemptOrdinal,\n executionIdentityDigest: String(slot.executionIdentityDigest),\n })),\n })),\n }).pipe(Effect.mapError((cause): RunnerSessionOpenFailed => ({ code: \"runner-session-open-failed\", cause })));\n }\n const byRun = new Map<AgentRun, RunnerRecordRun>();\n const byRecordRunId = new Map<RunId, RunnerRecordRun>();\n const runIdsByExperiment = new Map<string, string>();\n const targetRuns: TargetRun[] = [];\n for (const { plan, session, writerGeneration } of openedRuns) {\n const target = targetForRunnerRecordRun({\n planned: plan,\n runId: session.runId,\n startedAt: startedAt.success,\n });\n const recordRun: RunnerRecordRun = {\n ...plan,\n session,\n target,\n attempts: new Map(),\n planSlots: new Map(),\n gapActions: new Map(),\n writerGeneration,\n };\n byRun.set(plan.run, recordRun);\n byRecordRunId.set(session.runId, recordRun);\n runIdsByExperiment.set(plan.run.experimentId, session.runId);\n targetRuns.push(target);\n }\n const target = Object.freeze({\n invocationId,\n runs: Object.freeze(targetRuns),\n });\n const { reusePlan, carriedResults } = yield* Effect.scoped(Effect.gen(function* () {\n const reader = yield* recordHost.openRead({ root: input.recordRoot });\n const reusePlan = yield* planProjectTargetReuse({ reader, target, policy: input.reuse.policy });\n const carriedResults = yield* readCurrentExecutionReusePlanResults({ reader, plan: reusePlan }).pipe(Effect.mapError((cause): RunnerSessionOpenFailed => ({ code: \"runner-session-open-failed\", cause })));\n return { reusePlan, carriedResults };\n }));\n const carriedAttemptsByKey = new Map<string, Set<number>>();\n for (const slot of reusePlan.slots) {\n const recordRun = byRecordRunId.get(slot.runId);\n if (recordRun === undefined)\n return yield* Effect.fail(membershipStateInvalid(slot.slotId));\n recordRun.planSlots.set(slot.slotId, slot);\n if (slot.state === \"reuse\") {\n yield* stagePlanningReference(recordRun.session, {\n slotId: slot.slotId,\n action: \"carried\",\n reference: slot.source.reference,\n });\n yield* bindAttemptReference(rootPath, {\n runId: String(recordRun.session.runId),\n writerGeneration: recordRun.writerGeneration,\n slotId: String(slot.slotId),\n action: \"carried\",\n publicationIdentity: slot.source.reference.publicationIdentity,\n deadlineEpochMs: Date.now() + 30000,\n }).pipe(Effect.mapError((cause): RunnerSessionOpenFailed => ({ code: \"runner-session-open-failed\", cause })));\n const entry = recordRun.slots.get(runnerRecordSlotKey(slot.evalId, slot.attempt));\n if (entry === undefined)\n return yield* Effect.fail(membershipStateInvalid(slot.slotId));\n const key = cacheKey(recordRun.run, entry.evalDef.id);\n const carried = carriedAttemptsByKey.get(key) ?? new Set<number>();\n carried.add(entry.attempt);\n carriedAttemptsByKey.set(key, carried);\n }\n else {\n recordRun.gapActions.set(slot.slotId, \"pending\");\n }\n }\n if (input.session !== undefined) {\n yield* input.session.applyCarriedAttempts(input.runs, carriedAttemptsByKey).pipe(Effect.mapError((cause): RunnerSessionOpenFailed => ({ code: \"runner-session-open-failed\", cause })));\n }\n let invocationWriteFailure: RunnerRecordWriteError | undefined;\n const writeFailuresByRun = new Map<RunnerRecordRun, RunnerRecordWriteError>();\n const noteFailure = (error: RunnerRecordWriteError, recordRun?: RunnerRecordRun): void => {\n if (recordRun === undefined) {\n if (invocationWriteFailure === undefined)\n invocationWriteFailure = error;\n return;\n }\n if (!writeFailuresByRun.has(recordRun))\n writeFailuresByRun.set(recordRun, error);\n };\n const lock = yield* Semaphore.make(1);\n const runForAttempt = (attempt: Attempt): RunnerRecordRun | undefined => byRun.get(attempt.run);\n const targetForAttempt = (attempt: Attempt): {\n readonly recordRun: RunnerRecordRun;\n readonly slotId: SlotId;\n readonly plan: ExecutionReusePlanSlot;\n } | undefined => {\n const recordRun = runForAttempt(attempt);\n if (recordRun === undefined)\n return undefined;\n const entry = recordRun.slots.get(runnerRecordSlotKey(attempt.evalDef.id, attempt.attempt));\n if (entry === undefined)\n return undefined;\n const plan = recordRun.planSlots.get(entry.slot.slotId);\n return plan === undefined ? undefined : { recordRun, slotId: entry.slot.slotId, plan };\n };\n const adoptLatePublishedAttempt = (attempt: Attempt) => lock.withPermits(1)(Effect.gen(function* () {\n const current = targetForAttempt(attempt);\n if (current === undefined\n || current.plan.state !== \"gap\"\n || current.recordRun.gapActions.get(current.slotId) !== \"pending\")\n return false;\n const refreshed = yield* Effect.scoped(Effect.gen(function* () {\n const freshReader = yield* recordHost.openRead({ root: input.recordRoot });\n return yield* planProjectTargetReuse({ reader: freshReader, target, policy: input.reuse.policy });\n }));\n const replacement = refreshed.slots.find((slot) => slot.runId === current.recordRun.target.runId && slot.slotId === current.slotId);\n if (replacement?.state !== \"reuse\")\n return false;\n yield* stagePlanningReference(current.recordRun.session, {\n slotId: current.slotId,\n action: \"carried\",\n reference: replacement.source.reference,\n });\n yield* bindAttemptReference(rootPath, {\n runId: String(current.recordRun.session.runId),\n writerGeneration: current.recordRun.writerGeneration,\n slotId: String(current.slotId),\n action: \"carried\",\n publicationIdentity: replacement.source.reference.publicationIdentity,\n deadlineEpochMs: Date.now() + 30000,\n }).pipe(Effect.mapError(() => publishStateInvalid(current.recordRun.session.runId)));\n current.recordRun.planSlots.set(current.slotId, replacement);\n current.recordRun.gapActions.delete(current.slotId);\n return true;\n }));\n const reserveAttempt = (attempt: Attempt): Effect.Effect<RunnerRecordAttempt, RunnerRecordWriteError, ProjectStateDatabase> => {\n const targetSlot = targetForAttempt(attempt);\n return lock.withPermits(1)(Effect.gen(function* () {\n if (targetSlot === undefined\n || targetSlot.plan.state !== \"gap\"\n || targetSlot.recordRun.gapActions.get(targetSlot.slotId) !== \"pending\") {\n return yield* Effect.fail(attemptInvalid());\n }\n const session = yield* targetSlot.recordRun.session.createAttempt({ slotId: targetSlot.slotId });\n const publicAttempt = Object.freeze({\n slotId: targetSlot.slotId,\n attemptId: session.attemptId,\n locator: encodeAttemptLocator(session.attemptId),\n });\n targetSlot.recordRun.attempts.set(targetSlot.slotId, {\n attempt,\n session,\n public: publicAttempt,\n completed: false,\n });\n targetSlot.recordRun.gapActions.set(targetSlot.slotId, \"reserved\");\n return publicAttempt;\n })).pipe(Effect.tapError((error) => Effect.sync(() => noteFailure(error, targetSlot?.recordRun ?? runForAttempt(attempt)))));\n };\n const noteSealedOrMarkIncomplete = (attempt: Attempt, sealed: SealedAttemptAssertions): Effect.Effect<void, never> => Effect.sync(() => {\n const targetSlot = targetForAttempt(attempt);\n const active = targetSlot === undefined\n ? undefined\n : targetSlot.recordRun.attempts.get(targetSlot.slotId);\n if (targetSlot === undefined\n || targetSlot.plan.state !== \"gap\"\n || targetSlot.recordRun.gapActions.get(targetSlot.slotId) !== \"reserved\"\n || active === undefined\n || active.attempt !== attempt\n || active.sealed !== undefined) {\n noteFailure(attemptInvalid(), targetSlot?.recordRun ?? runForAttempt(attempt));\n return;\n }\n active.sealed = sealed;\n });\n const completeAttempt = (attempt: Attempt, result: EvalResult): Effect.Effect<RunnerRecordAttempt, RunnerRecordWriteError, ProjectStateDatabase> => Effect.suspend<RunnerRecordAttempt, RunnerRecordWriteError, ProjectStateDatabase>(() => {\n const targetSlot = targetForAttempt(attempt);\n const active = targetSlot === undefined\n ? undefined\n : targetSlot.recordRun.attempts.get(targetSlot.slotId);\n if (targetSlot === undefined\n || targetSlot.plan.state !== \"gap\"\n || targetSlot.recordRun.gapActions.get(targetSlot.slotId) !== \"reserved\"\n || active === undefined\n || active.attempt !== attempt\n || active.completed) {\n return Effect.fail(attemptInvalid());\n }\n const assertions = active.sealed === undefined\n ? undefined\n : createRunnerAssertionsAttachment(active.sealed);\n if (assertions !== undefined && Result.isFailure(assertions))\n return Effect.fail(assertions.failure);\n if (active.sealed === undefined || assertions === undefined || Result.isFailure(assertions)) {\n return Effect.fail(membershipStateInvalid(targetSlot.slotId));\n }\n return Effect.gen(function* () {\n const sourcePlan = createRunnerSourceWritePlan([Object.freeze({\n slotId: targetSlot.slotId,\n result,\n assertionEntryIds: assertions.success.entryIds,\n })]);\n if (Result.isFailure(sourcePlan)) {\n return yield* Effect.fail(Object.freeze({\n code: \"runner-record-sources-invalid\" as const,\n issue: sourcePlan.failure,\n }));\n }\n const closedAssertions = createRunnerAssertionsAttachment(active.sealed!, {\n entryIds: assertions.success.entryIds,\n sourceSites: sourcePlan.success.sourceSitesBySlot.get(targetSlot.slotId),\n });\n if (Result.isFailure(closedAssertions))\n return yield* Effect.fail(closedAssertions.failure);\n yield* active.session.records.write(NiceEvalRecordAttachments.assertions, closedAssertions.success.attachment);\n yield* active.session.records.write(NiceEvalRecordAttachments.attemptCost, createAttemptCostAttachment(result));\n const sourceReceipts = yield* createAttemptObservabilityAttachments({ result, sealed: active.sealed! });\n if (sourceReceipts.agentTurns !== undefined) {\n yield* active.session.records.write(NiceEvalRecordAttachments.agentTurns, sourceReceipts.agentTurns);\n }\n if (sourceReceipts.sandboxCommands !== undefined) {\n yield* active.session.records.write(NiceEvalRecordAttachments.sandboxCommands, sourceReceipts.sandboxCommands);\n }\n yield* active.session.records.write(NiceEvalRecordAttachments.runnerActivities.attempt, sourceReceipts.runnerActivities);\n yield* active.session.records.write(NiceEvalRecordAttachments.runnerDiagnostics.attempt, sourceReceipts.runnerDiagnostics);\n const turnContexts = createRunnerTurnContextsAttachment({ result, sourcePlan: sourcePlan.success });\n if (Result.isFailure(turnContexts)) {\n return yield* Effect.fail(Object.freeze({\n code: \"runner-record-sources-invalid\" as const,\n issue: turnContexts.failure,\n }));\n }\n if (turnContexts.success !== undefined) {\n yield* active.session.records.write(NiceEvalRecordAttachments.turnContexts, turnContexts.success);\n }\n const fileChanges = createAttemptFileChangesAttachment(result);\n if (fileChanges !== undefined) {\n yield* active.session.records.write(NiceEvalRecordAttachments.fileChanges, fileChanges);\n }\n const attachmentSnapshot = adapterAttachmentsForResult(result);\n const artifacts = createAttemptArtifactsAttachment(result, attachmentSnapshot);\n const judgeUsage = judgeUsageForResult(result, closedAssertions.success.entryIds);\n if (judgeUsage !== undefined)\n yield* active.session.records.write(NiceEvalRecordAttachments.judgeUsage, judgeUsage);\n yield* active.session.records.write(NiceEvalRecordAttachments.attemptNotes, attemptNotesForResult(result));\n const adapterUsage = adapterUsageForResult(result);\n const executionTraces = adapterExecutionTracesForResult(result);\n if (adapterUsage !== undefined) {\n yield* active.session.records.write(NiceEvalRecordAttachments.adapterUsage, adapterUsage);\n }\n if (artifacts !== undefined) {\n yield* active.session.records.write(NiceEvalRecordAttachments.artifacts.attempt, artifacts);\n }\n if (executionTraces !== undefined && executionTraces.traces.length > 0) {\n validateExecutionTracePublication(executionTraces, attachmentSnapshot?.artifacts ?? []);\n yield* active.session.records.appendAll(executionTracesRecordCollection, Stream.fromIterable(executionTraces.traces.flatMap((trace) => trace.records)));\n yield* active.session.records.close(executionTracesRecordCollection, executionTraces.failure === undefined\n ? { state: \"complete\" }\n : {\n state: \"partial\",\n limitations: [{ code: \"capture-failed\", stage: \"adapter\" }],\n });\n }\n yield* active.session.complete(recordAttemptOutcome(result));\n const closureBytes = new TextEncoder().encode(JSON.stringify(attemptPublicationClosure(Object.freeze({\n runId: String(targetSlot.recordRun.session.runId),\n experimentId: targetSlot.recordRun.experimentId,\n context: targetSlot.recordRun.context,\n startedAt: targetSlot.recordRun.target.startedAt,\n completedAt: Date.now(),\n expectedSlots: targetSlot.recordRun.expectedSlots,\n }))));\n yield* publishOriginAttempt(rootPath, {\n runId: String(targetSlot.recordRun.session.runId),\n writerGeneration: targetSlot.recordRun.writerGeneration,\n slotId: String(targetSlot.slotId),\n attemptId: String(active.public.attemptId),\n attemptLocator: String(active.public.locator),\n closureBytes,\n closureDigest: createHash(\"sha256\").update(closureBytes).digest(\"hex\"),\n deadlineEpochMs: Date.now() + 30000,\n }).pipe(Effect.mapError((cause) => attemptPublicationFailed(active.public.locator, cause)));\n active.result = result;\n active.assertionEntryIds = assertions.success.entryIds;\n active.completed = true;\n targetSlot.recordRun.gapActions.set(targetSlot.slotId, \"executed\");\n return active.public;\n });\n });\n const attachRunFacts = (recordRun: RunnerRecordRun, mode: \"normal\" | \"interrupted\"): Effect.Effect<void, RunnerRecordWriteError> => Effect.gen(function* () {\n const writeRecord = (effect: Effect.Effect<void, RecordWriteError, never>): Effect.Effect<void, RecordWriteError, never> => effect;\n const origins = [] as {\n readonly slotId: SlotId;\n readonly active: ActiveRunnerRecordAttempt;\n readonly result: EvalResult;\n readonly sealed: SealedAttemptAssertions;\n readonly assertionEntryIds: readonly AssertionEntryId[];\n }[];\n for (const [slotId, state] of recordRun.gapActions) {\n if (state !== \"executed\")\n continue;\n const active = recordRun.attempts.get(slotId);\n if (active === undefined)\n return yield* Effect.fail(membershipStateInvalid(slotId));\n const result = active.result;\n const sealed = active?.sealed;\n const assertionEntryIds = active?.assertionEntryIds;\n if (result === undefined || sealed === undefined || assertionEntryIds === undefined)\n continue;\n origins.push(Object.freeze({ slotId, active, result, sealed, assertionEntryIds }));\n }\n const sources = createRunnerSourceWritePlan(origins.map(({ slotId, result, assertionEntryIds }) => Object.freeze({\n slotId,\n result,\n assertionEntryIds,\n })));\n if (Result.isFailure(sources)) {\n return yield* Effect.fail(Object.freeze({\n code: \"runner-record-sources-invalid\" as const,\n issue: sources.failure,\n }));\n }\n yield* writeRecord(recordRun.session.records.write(NiceEvalRecordAttachments.sources, sources.success.sources));\n const sourceReceipts = yield* createRunObservabilityAttachments(recordRun.run);\n if (sourceReceipts.runnerActivities !== undefined) {\n yield* writeRecord(recordRun.session.records.write(NiceEvalRecordAttachments.runnerActivities.run, sourceReceipts.runnerActivities));\n }\n if (sourceReceipts.runnerDiagnostics !== undefined) {\n yield* writeRecord(recordRun.session.records.write(NiceEvalRecordAttachments.runnerDiagnostics.run, sourceReceipts.runnerDiagnostics));\n }\n yield* writeRecord(recordRun.session.records.write(NiceEvalRecordAttachments.artifacts.run, createRunArtifactsAttachment()));\n });\n const pendingGap = (recordRun: RunnerRecordRun): SlotId | undefined => {\n for (const [slotId, state] of recordRun.gapActions) {\n if (state === \"pending\")\n return slotId;\n }\n return undefined;\n };\n return Object.freeze({\n reusePlan,\n readCarriedResults: () => Effect.succeed(carriedResults),\n runIdsByExperiment: new Map(runIdsByExperiment),\n publicationCutoff: () => currentPublicationCutoff(rootPath),\n carriedAttemptsByKey: new Map([...carriedAttemptsByKey].map(([key, attempts]) => [key, new Set(attempts)] as const)),\n adoptLatePublishedAttempt,\n reserveAttempt,\n noteSealedOrMarkIncomplete,\n completeAttemptOrMarkIncomplete: (attempt: Attempt, result: EvalResult) => completeAttempt(attempt, result).pipe(Effect.catch((error) => Effect.sync(() => {\n const target = targetForAttempt(attempt);\n const active = target === undefined ? undefined : target.recordRun.attempts.get(target.slotId);\n noteFailure(error.code === \"runner-record-assertions-invalid\" ||\n error.code === \"runner-record-attempt-publication-failed\" ||\n active === undefined\n ? error\n : attemptPublicationFailed(active.public.locator, error), target?.recordRun ?? runForAttempt(attempt));\n return undefined;\n })), Effect.ensuring(Effect.promise(() => releaseAdapterAttachments(result)))),\n markNotDispatched: (attempt: Attempt) => {\n const targetSlot = targetForAttempt(attempt);\n if (targetSlot !== undefined\n && targetSlot.plan.state === \"gap\"\n && targetSlot.recordRun.gapActions.get(targetSlot.slotId) === \"pending\") {\n targetSlot.recordRun.gapActions.set(targetSlot.slotId, \"not-dispatched\");\n }\n },\n publish: (completedAt: number, mode: \"normal\" | \"interrupted\") => Effect.gen(function* () {\n const recordRuns = [...byRun.values()];\n if (invocationWriteFailure !== undefined)\n return yield* Effect.fail(invocationWriteFailure);\n if (mode === \"normal\") {\n // A normal finish remains invocation-strict: a failure which can be\n // attributed to one Run still fails the call rather than allowing a\n // partial receipt to disguise it as ordinary completion.\n for (const recordRun of recordRuns) {\n const failure = writeFailuresByRun.get(recordRun);\n if (failure !== undefined)\n return yield* Effect.fail(failure);\n }\n }\n const completion = runnerRecordUtcMillis(completedAt);\n if (Result.isFailure(completion))\n return yield* Effect.fail(completion.failure);\n // A controlled interruption closes every reserved Attempt as\n // `interrupted` and every never-started gap as an interrupted terminal\n // Member. Only a Run-local writer failure remains non-publishable.\n // Abrupt process loss still has no opportunity to create `complete`.\n const incompleteRuns = mode === \"interrupted\"\n ? new Set(recordRuns.filter((recordRun) => writeFailuresByRun.has(recordRun)))\n : new Set<RunnerRecordRun>();\n if (mode === \"normal\") {\n // Normal completion is deliberately invocation-strict. A pending\n // gap means the scheduler failed to account for a Slot; a reserved\n // or otherwise unsettled Attempt is likewise not publishable.\n for (const recordRun of recordRuns) {\n const unsettledSlot = [...recordRun.gapActions.keys()].find((slotId) => {\n const active = recordRun.attempts.get(slotId);\n return recordRun.gapActions.get(slotId) === \"reserved\"\n || (active !== undefined && !active.completed);\n });\n if (unsettledSlot !== undefined)\n return yield* Effect.fail(unsealedAttempt(unsettledSlot));\n const unaccountedSlot = pendingGap(recordRun);\n if (unaccountedSlot !== undefined)\n return yield* Effect.fail(unsealedAttempt(unaccountedSlot));\n }\n }\n else {\n for (const recordRun of recordRuns) {\n if (incompleteRuns.has(recordRun))\n continue;\n for (const [slotId, state] of recordRun.gapActions) {\n if (state === \"pending\")\n recordRun.gapActions.set(slotId, \"interrupted\");\n if (state === \"reserved\") {\n const active = recordRun.attempts.get(slotId);\n if (active === undefined)\n return yield* Effect.fail(membershipStateInvalid(slotId));\n yield* discardAttemptWriteSession(active.session);\n recordRun.attempts.delete(slotId);\n recordRun.gapActions.set(slotId, \"interrupted\");\n }\n }\n }\n }\n const publishableRuns = recordRuns.filter((recordRun) => !incompleteRuns.has(recordRun));\n const publishOne = (recordRun: RunnerRecordRun): Effect.Effect<RecordSealReceipt, RunnerRecordWriteError, ProjectStateDatabase> => Effect.gen(function* () {\n yield* attachRunFacts(recordRun, mode);\n for (const [slotId, state] of recordRun.gapActions) {\n if (state === \"not-dispatched\" || state === \"interrupted\") {\n const absenceReason: RunAbsenceReason = mode === \"interrupted\"\n ? \"interrupted-before-publication\"\n : state === \"not-dispatched\"\n ? \"early-exit-satisfied\"\n : \"dispatch-failed\";\n yield* recordRun.session.recordTerminalMember({ slotId, action: state, absenceReason });\n }\n }\n const sealed = yield* recordRun.session.seal({ completedAt: completion.success });\n const absences = [...recordRun.gapActions].flatMap(([slotId, state]) => {\n if (state === \"executed\" && recordRun.attempts.get(slotId)?.completed === true)\n return [];\n const reason: RunAbsenceReason = mode === \"interrupted\"\n ? \"interrupted-before-publication\"\n : state === \"not-dispatched\"\n ? \"early-exit-satisfied\"\n : \"dispatch-failed\";\n return [{ slotId: String(slotId), reason }];\n });\n yield* closeRunResource(rootPath, {\n runId: String(recordRun.session.runId),\n writerGeneration: recordRun.writerGeneration,\n state: mode === \"interrupted\" ? \"interrupted\" : \"completed\",\n completedAt: new Date(completedAt).toISOString(),\n absences,\n deadlineEpochMs: Date.now() + 30000,\n }).pipe(Effect.mapError(() => publishStateInvalid(recordRun.session.runId)));\n return sealed;\n });\n if (mode === \"normal\") {\n // Normal completion remains typed and strict: the first Run failure\n // is an invocation failure, never a partial success receipt.\n return yield* Effect.forEach(publishableRuns, publishOne, { concurrency: 1 });\n }\n // SIGINT is different: each clean sibling receives its own complete\n // attempt. We deliberately observe an Exit per Run so one Attachment\n // or seal error cannot short-circuit subsequent safe siblings.\n const receipts: RecordSealReceipt[] = [];\n for (const recordRun of publishableRuns) {\n const exit = yield* Effect.exit(publishOne(recordRun));\n if (Exit.isSuccess(exit)) {\n receipts.push(exit.value);\n }\n else {\n const failure = Cause.findErrorOption(exit.cause);\n if (Option.isSome(failure)) {\n noteFailure(failure.value, recordRun);\n }\n else {\n noteFailure(publishStateInvalid(recordRun.session.runId), recordRun);\n }\n }\n }\n return Object.freeze(receipts);\n }),\n });\n });\n}\n"]}
|
package/dist/runner/report.cjs
CHANGED
|
@@ -45,7 +45,7 @@ function emitReporterEvent(registrations, event) {
|
|
|
45
45
|
function filterSummary(summary, ids) {
|
|
46
46
|
const results = summary.results.filter((r) => ids.has(r.id));
|
|
47
47
|
const reusedAttempts = summary.reusedAttempts.filter((attempt) => ids.has(attempt.target.evalId));
|
|
48
|
-
const sub = summarize(results, reusedAttempts, summary.startedAt, summary.durationMs, summary.name, summary.
|
|
48
|
+
const sub = summarize(results, reusedAttempts, summary.startedAt, summary.durationMs, summary.name, summary.beforeCaches);
|
|
49
49
|
// completedAt 用原值(summarize 会重新取 now);name 等其余字段原样保留。
|
|
50
50
|
return { ...summary, ...sub, completedAt: summary.completedAt };
|
|
51
51
|
}
|
|
@@ -91,7 +91,7 @@ function scopeReporter(r, ids, shape) {
|
|
|
91
91
|
return scoped;
|
|
92
92
|
}
|
|
93
93
|
/** 全局汇总:verdict 计数 + token / cost 折叠。按 attempt 计(eval 级折叠见 shared/verdict.ts)。不接收 agent/model —— 一次 Invocation 可能横跨多个配置,身份从逐条 `EvalResult` 读取。 */
|
|
94
|
-
function summarize(results, reusedAttempts, startedAt, durationMs, name,
|
|
94
|
+
function summarize(results, reusedAttempts, startedAt, durationMs, name, beforeCaches = Object.freeze({ total: 0, hit: 0, prepared: 0, failed: 0 })) {
|
|
95
95
|
const counts = { passed: 0, failed: 0, skipped: 0, errored: 0 };
|
|
96
96
|
let inTok = 0;
|
|
97
97
|
let outTok = 0;
|
|
@@ -123,7 +123,7 @@ function summarize(results, reusedAttempts, startedAt, durationMs, name, setupPr
|
|
|
123
123
|
estimatedCostUSD: hasEstimatedCost ? cost : undefined,
|
|
124
124
|
reusedAttempts: Object.freeze([...reusedAttempts]),
|
|
125
125
|
results,
|
|
126
|
-
|
|
126
|
+
beforeCaches,
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
//# sourceMappingURL=report.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["report.ts"],"names":[],"mappings":";;AAmBA,kCAYC;AACD,8CAIC;AAED,sCAMC;AAMD,sCAmCC;AAED,8BAkCC;AAzHD,uDAAuD;AACvD,uBAAuB;AACvB,mCAAgC;AAEhC,wCAAqD;AACrD,gDAAyD;AACzD;;;;;;;;;;;;GAYG;AACH,SAAgB,WAAW,CAAC,GAAyB,EAAE,KAAa,EAAE,EAAiB;IACnF,OAAO,eAAM,CAAC,UAAU,CAAC;QACrB,0EAA0E;QAC1E,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK;KAC1B,CAAC,CAAC,IAAI,CAAC,eAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,eAAM,CAAC,IAAI,CAAC,GAAG,EAAE;QAC7C,I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AAC,GAAG,cAAc,CAAC,CAAC;QAClD,OAAO;QACP,aAAa;KAChB,CAAC;AACN,CAAC","sourcesContent":["// reporter 编排与运行级汇总。reporter 是「结果消费方」:单个 reporter 抛错只记\n// diagnostic,不能让整次调度崩。\nimport { Effect } from \"effect\";\nimport type { EvalResult, InvocationShape, InvocationSummary, LocalizedText, Reporter, ReporterEvent, ReporterRegistration, } from \"../types.ts\";\nimport { firstLine, formatThrown } from \"../util.ts\";\nimport { reportReporterError } from \"./feedback/sink.ts\";\n/**\n * reporter 调用的统一兜错。返回 void,永不 reject(供 Promise.all 安全聚合,单个 reporter\n * 抛错不终止其它 reporter 的收尾,也不中断在飞的 attempt)。`reg.name`/`reg.required` 决定\n * `reportReporterError()` 收到的诊断身份与判定权重(见 `ReporterRegistration` 的字段注释:\n * 同一个 reporter 反复失败按 `name` 去重折叠,`required` 决定它是否让 completion/CI 退出码\n * 判红)。`stage` 只是这次失败发生在哪个回调阶段的次要上下文,拼进 message,不参与去重身份——\n * 同一 reporter 在 onEvalComplete 与 onInvocationComplete 两个阶段各失败一次,仍然折成同一条诊断、\n * count 累加到 2,而不是拆成两条互不相关的诊断。message 只取 `formatThrown()` 的第一行(与\n * run.ts 的 `describeFailureReason` 同一原则)——reporter 抛出的 Error 完整 `.stack` 含本地\n * 绝对文件路径和调用帧,不适合塞进 agent/ci 那种单行、稳定、机器消费的 envelope;这里没有\n * `EvalResult.error` 那样的落盘字段能保留完整栈,所以「一层可行动摘要」就是这条诊断的全部内容,\n * 不是从更详细的记录里摘出来的简化版——排查真正需要栈时,重跑该 reporter 单独复现更可靠。\n */\nexport function runReporter(reg: ReporterRegistration, stage: string, fn: () => unknown): Effect.Effect<void> {\n return Effect.tryPromise({\n // Public Reporter callbacks are the one Promise boundary for this module.\n try: () => Promise.resolve().then(fn),\n catch: (cause) => cause,\n }).pipe(Effect.catch((cause) => Effect.sync(() => {\n reportReporterError({\n reporter: reg.name,\n required: reg.required,\n message: `${stage}: ${firstLine(formatThrown(cause))}`,\n });\n })));\n}\nexport function emitReporterEvent(registrations: readonly ReporterRegistration[], event: ReporterEvent): Effect.Effect<void> {\n // Existing Promise.all starts every reporter immediately and waits for each one;\n // retain that concurrent, best-effort observable behavior under Effect.\n return Effect.forEach(registrations, (reg) => runReporter(reg, `event:${event.type}`, () => reg.reporter.onEvent?.(event)), { concurrency: \"unbounded\", discard: true });\n}\n/** 按 eval id 过滤 InvocationSummary 并重新计数 —— eval 级 reporter 只看它观测的那部分。 */\nexport function filterSummary(summary: InvocationSummary, ids: ReadonlySet<string>): InvocationSummary {\n const results = summary.results.filter((r) => ids.has(r.id));\n const reusedAttempts = summary.reusedAttempts.filter((attempt) => ids.has(attempt.target.evalId));\n const sub = summarize(results, reusedAttempts, summary.startedAt, summary.durationMs, summary.name, summary.setupPrefixes);\n // completedAt 用原值(summarize 会重新取 now);name 等其余字段原样保留。\n return { ...summary, ...sub, completedAt: summary.completedAt };\n}\n/**\n * eval 级 reporter 的作用域包装:实例只观测「引用它的那些 eval」。\n * 结果类回调按 eval id 过滤,汇总类回调收到重新计数的子集汇总;\n * shape 由调用方按作用域预先算好(包装器自己看不到 attempts)。\n */\nexport function scopeReporter(r: Reporter, ids: ReadonlySet<string>, shape?: InvocationShape): Reporter {\n const scoped: Reporter = {};\n if (r.onInvocationStart) {\n scoped.onInvocationStart = (evals, fullShape) => r.onInvocationStart!(evals.filter((e) => ids.has(e.id)), shape ?? fullShape);\n }\n if (r.onEvalComplete) {\n scoped.onEvalComplete = (result) => (ids.has(result.id) ? r.onEvalComplete!(result) : undefined);\n }\n if (r.onInvocationComplete) {\n scoped.onInvocationComplete = (summary) => r.onInvocationComplete!(filterSummary(summary, ids));\n }\n if (r.onEvent) {\n scoped.onEvent = (event) => {\n switch (event.type) {\n case \"invocation:start\":\n return r.onEvent!({\n ...event,\n evals: event.evals.filter((e) => ids.has(e.id)),\n shape: shape ?? event.shape,\n });\n case \"eval:start\":\n return ids.has(event.eval.id) ? r.onEvent!(event) : undefined;\n case \"eval:complete\":\n return ids.has(event.result.id) ? r.onEvent!(event) : undefined;\n case \"invocation:earlyExit\":\n return ids.has(event.evalId) ? r.onEvent!(event) : undefined;\n case \"invocation:summary\":\n case \"invocation:saved\":\n return r.onEvent!({ ...event, summary: filterSummary(event.summary, ids) });\n default:\n return r.onEvent!(event);\n }\n };\n }\n return scoped;\n}\n/** 全局汇总:verdict 计数 + token / cost 折叠。按 attempt 计(eval 级折叠见 shared/verdict.ts)。不接收 agent/model —— 一次 Invocation 可能横跨多个配置,身份从逐条 `EvalResult` 读取。 */\nexport function summarize(results: EvalResult[], reusedAttempts: readonly import(\"./reuse-readback.ts\").CurrentReusedAttemptReadback[], startedAt: string, durationMs: number, name?: LocalizedText, setupPrefixes: InvocationSummary[\"setupPrefixes\"] = Object.freeze({ total: 0, hit: 0, prepared: 0, failed: 0 })): InvocationSummary {\n const counts = { passed: 0, failed: 0, skipped: 0, errored: 0 };\n let inTok = 0;\n let outTok = 0;\n let cost = 0;\n let hasEstimatedCost = false;\n for (const r of results) {\n counts[r.verdict] += 1;\n inTok += r.usage?.inputTokens ?? 0;\n outTok += r.usage?.outputTokens ?? 0;\n if (r.estimatedCostUSD !== undefined) {\n cost += r.estimatedCostUSD;\n hasEstimatedCost = true;\n }\n }\n for (const attempt of reusedAttempts) {\n counts[attempt.verdict] += 1;\n }\n return {\n name,\n startedAt,\n completedAt: new Date().toISOString(),\n passed: counts.passed,\n failed: counts.failed,\n skipped: counts.skipped,\n errored: counts.errored,\n durationMs,\n usage: { inputTokens: inTok, outputTokens: outTok },\n // 0 是合法估算值:至少一条 fresh 结果带 estimatedCostUSD 就输出累计值(可为 0),全缺才省略。\n estimatedCostUSD: hasEstimatedCost ? cost : undefined,\n reusedAttempts: Object.freeze([...reusedAttempts]),\n results,\n setupPrefixes,\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["report.ts"],"names":[],"mappings":";;AAmBA,kCAYC;AACD,8CAIC;AAED,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,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IACD,OAAO;QACH,IAAI;QACJ,SAAS;QACT,WAAW,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACrC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,UAAU;QACV,KAAK,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE;QACnD,+DAA+D;QAC/D,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS;QACrD,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC;QAClD,OAAO;QACP,YAAY;KACf,CAAC;AACN,CAAC","sourcesContent":["// reporter 编排与运行级汇总。reporter 是「结果消费方」:单个 reporter 抛错只记\n// diagnostic,不能让整次调度崩。\nimport { Effect } from \"effect\";\nimport type { EvalResult, InvocationShape, InvocationSummary, LocalizedText, Reporter, ReporterEvent, ReporterRegistration, } from \"../types.ts\";\nimport { firstLine, formatThrown } from \"../util.ts\";\nimport { reportReporterError } from \"./feedback/sink.ts\";\n/**\n * reporter 调用的统一兜错。返回 void,永不 reject(供 Promise.all 安全聚合,单个 reporter\n * 抛错不终止其它 reporter 的收尾,也不中断在飞的 attempt)。`reg.name`/`reg.required` 决定\n * `reportReporterError()` 收到的诊断身份与判定权重(见 `ReporterRegistration` 的字段注释:\n * 同一个 reporter 反复失败按 `name` 去重折叠,`required` 决定它是否让 completion/CI 退出码\n * 判红)。`stage` 只是这次失败发生在哪个回调阶段的次要上下文,拼进 message,不参与去重身份——\n * 同一 reporter 在 onEvalComplete 与 onInvocationComplete 两个阶段各失败一次,仍然折成同一条诊断、\n * count 累加到 2,而不是拆成两条互不相关的诊断。message 只取 `formatThrown()` 的第一行(与\n * run.ts 的 `describeFailureReason` 同一原则)——reporter 抛出的 Error 完整 `.stack` 含本地\n * 绝对文件路径和调用帧,不适合塞进 agent/ci 那种单行、稳定、机器消费的 envelope;这里没有\n * `EvalResult.error` 那样的落盘字段能保留完整栈,所以「一层可行动摘要」就是这条诊断的全部内容,\n * 不是从更详细的记录里摘出来的简化版——排查真正需要栈时,重跑该 reporter 单独复现更可靠。\n */\nexport function runReporter(reg: ReporterRegistration, stage: string, fn: () => unknown): Effect.Effect<void> {\n return Effect.tryPromise({\n // Public Reporter callbacks are the one Promise boundary for this module.\n try: () => Promise.resolve().then(fn),\n catch: (cause) => cause,\n }).pipe(Effect.catch((cause) => Effect.sync(() => {\n reportReporterError({\n reporter: reg.name,\n required: reg.required,\n message: `${stage}: ${firstLine(formatThrown(cause))}`,\n });\n })));\n}\nexport function emitReporterEvent(registrations: readonly ReporterRegistration[], event: ReporterEvent): Effect.Effect<void> {\n // Existing Promise.all starts every reporter immediately and waits for each one;\n // retain that concurrent, best-effort observable behavior under Effect.\n return Effect.forEach(registrations, (reg) => runReporter(reg, `event:${event.type}`, () => reg.reporter.onEvent?.(event)), { concurrency: \"unbounded\", discard: true });\n}\n/** 按 eval id 过滤 InvocationSummary 并重新计数 —— eval 级 reporter 只看它观测的那部分。 */\nexport function filterSummary(summary: InvocationSummary, ids: ReadonlySet<string>): InvocationSummary {\n const results = summary.results.filter((r) => ids.has(r.id));\n const reusedAttempts = summary.reusedAttempts.filter((attempt) => ids.has(attempt.target.evalId));\n const sub = summarize(results, reusedAttempts, summary.startedAt, summary.durationMs, summary.name, summary.beforeCaches);\n // completedAt 用原值(summarize 会重新取 now);name 等其余字段原样保留。\n return { ...summary, ...sub, completedAt: summary.completedAt };\n}\n/**\n * eval 级 reporter 的作用域包装:实例只观测「引用它的那些 eval」。\n * 结果类回调按 eval id 过滤,汇总类回调收到重新计数的子集汇总;\n * shape 由调用方按作用域预先算好(包装器自己看不到 attempts)。\n */\nexport function scopeReporter(r: Reporter, ids: ReadonlySet<string>, shape?: InvocationShape): Reporter {\n const scoped: Reporter = {};\n if (r.onInvocationStart) {\n scoped.onInvocationStart = (evals, fullShape) => r.onInvocationStart!(evals.filter((e) => ids.has(e.id)), shape ?? fullShape);\n }\n if (r.onEvalComplete) {\n scoped.onEvalComplete = (result) => (ids.has(result.id) ? r.onEvalComplete!(result) : undefined);\n }\n if (r.onInvocationComplete) {\n scoped.onInvocationComplete = (summary) => r.onInvocationComplete!(filterSummary(summary, ids));\n }\n if (r.onEvent) {\n scoped.onEvent = (event) => {\n switch (event.type) {\n case \"invocation:start\":\n return r.onEvent!({\n ...event,\n evals: event.evals.filter((e) => ids.has(e.id)),\n shape: shape ?? event.shape,\n });\n case \"eval:start\":\n return ids.has(event.eval.id) ? r.onEvent!(event) : undefined;\n case \"eval:complete\":\n return ids.has(event.result.id) ? r.onEvent!(event) : undefined;\n case \"invocation:earlyExit\":\n return ids.has(event.evalId) ? r.onEvent!(event) : undefined;\n case \"invocation:summary\":\n case \"invocation:saved\":\n return r.onEvent!({ ...event, summary: filterSummary(event.summary, ids) });\n default:\n return r.onEvent!(event);\n }\n };\n }\n return scoped;\n}\n/** 全局汇总:verdict 计数 + token / cost 折叠。按 attempt 计(eval 级折叠见 shared/verdict.ts)。不接收 agent/model —— 一次 Invocation 可能横跨多个配置,身份从逐条 `EvalResult` 读取。 */\nexport function summarize(results: EvalResult[], reusedAttempts: readonly import(\"./reuse-readback.ts\").CurrentReusedAttemptReadback[], startedAt: string, durationMs: number, name?: LocalizedText, beforeCaches: InvocationSummary[\"beforeCaches\"] = Object.freeze({ total: 0, hit: 0, prepared: 0, failed: 0 })): InvocationSummary {\n const counts = { passed: 0, failed: 0, skipped: 0, errored: 0 };\n let inTok = 0;\n let outTok = 0;\n let cost = 0;\n let hasEstimatedCost = false;\n for (const r of results) {\n counts[r.verdict] += 1;\n inTok += r.usage?.inputTokens ?? 0;\n outTok += r.usage?.outputTokens ?? 0;\n if (r.estimatedCostUSD !== undefined) {\n cost += r.estimatedCostUSD;\n hasEstimatedCost = true;\n }\n }\n for (const attempt of reusedAttempts) {\n counts[attempt.verdict] += 1;\n }\n return {\n name,\n startedAt,\n completedAt: new Date().toISOString(),\n passed: counts.passed,\n failed: counts.failed,\n skipped: counts.skipped,\n errored: counts.errored,\n durationMs,\n usage: { inputTokens: inTok, outputTokens: outTok },\n // 0 是合法估算值:至少一条 fresh 结果带 estimatedCostUSD 就输出累计值(可为 0),全缺才省略。\n estimatedCostUSD: hasEstimatedCost ? cost : undefined,\n reusedAttempts: Object.freeze([...reusedAttempts]),\n results,\n beforeCaches,\n };\n}\n"]}
|
package/dist/runner/report.d.cts
CHANGED
|
@@ -24,4 +24,4 @@ export declare function filterSummary(summary: InvocationSummary, ids: ReadonlyS
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function scopeReporter(r: Reporter, ids: ReadonlySet<string>, shape?: InvocationShape): Reporter;
|
|
26
26
|
/** 全局汇总:verdict 计数 + token / cost 折叠。按 attempt 计(eval 级折叠见 shared/verdict.ts)。不接收 agent/model —— 一次 Invocation 可能横跨多个配置,身份从逐条 `EvalResult` 读取。 */
|
|
27
|
-
export declare function summarize(results: EvalResult[], reusedAttempts: readonly import("./reuse-readback.cjs").CurrentReusedAttemptReadback[], startedAt: string, durationMs: number, name?: LocalizedText,
|
|
27
|
+
export declare function summarize(results: EvalResult[], reusedAttempts: readonly import("./reuse-readback.cjs").CurrentReusedAttemptReadback[], startedAt: string, durationMs: number, name?: LocalizedText, beforeCaches?: InvocationSummary["beforeCaches"]): InvocationSummary;
|
package/dist/runner/report.d.mts
CHANGED
|
@@ -24,4 +24,4 @@ export declare function filterSummary(summary: InvocationSummary, ids: ReadonlyS
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function scopeReporter(r: Reporter, ids: ReadonlySet<string>, shape?: InvocationShape): Reporter;
|
|
26
26
|
/** 全局汇总:verdict 计数 + token / cost 折叠。按 attempt 计(eval 级折叠见 shared/verdict.ts)。不接收 agent/model —— 一次 Invocation 可能横跨多个配置,身份从逐条 `EvalResult` 读取。 */
|
|
27
|
-
export declare function summarize(results: EvalResult[], reusedAttempts: readonly import("./reuse-readback.mjs").CurrentReusedAttemptReadback[], startedAt: string, durationMs: number, name?: LocalizedText,
|
|
27
|
+
export declare function summarize(results: EvalResult[], reusedAttempts: readonly import("./reuse-readback.mjs").CurrentReusedAttemptReadback[], startedAt: string, durationMs: number, name?: LocalizedText, beforeCaches?: InvocationSummary["beforeCaches"]): InvocationSummary;
|
package/dist/runner/report.d.ts
CHANGED
|
@@ -24,4 +24,4 @@ export declare function filterSummary(summary: InvocationSummary, ids: ReadonlyS
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function scopeReporter(r: Reporter, ids: ReadonlySet<string>, shape?: InvocationShape): Reporter;
|
|
26
26
|
/** 全局汇总:verdict 计数 + token / cost 折叠。按 attempt 计(eval 级折叠见 shared/verdict.ts)。不接收 agent/model —— 一次 Invocation 可能横跨多个配置,身份从逐条 `EvalResult` 读取。 */
|
|
27
|
-
export declare function summarize(results: EvalResult[], reusedAttempts: readonly import("./reuse-readback.js").CurrentReusedAttemptReadback[], startedAt: string, durationMs: number, name?: LocalizedText,
|
|
27
|
+
export declare function summarize(results: EvalResult[], reusedAttempts: readonly import("./reuse-readback.js").CurrentReusedAttemptReadback[], startedAt: string, durationMs: number, name?: LocalizedText, beforeCaches?: InvocationSummary["beforeCaches"]): InvocationSummary;
|
|
@@ -7,7 +7,7 @@ exports.validateProjectTargetReusePlanInput = validateProjectTargetReusePlanInpu
|
|
|
7
7
|
exports.planProjectTargetReuse = planProjectTargetReuse;
|
|
8
8
|
exports.planProjectTargetReuseWithoutSources = planProjectTargetReuseWithoutSources;
|
|
9
9
|
exports.assessCurrentTargetSlot = assessCurrentTargetSlot;
|
|
10
|
-
// @concord-file
|
|
10
|
+
// @concord-file
|
|
11
11
|
// @concord-implements docs/feature/experiments/cache.md
|
|
12
12
|
// @concord-implements docs/feature/experiments/use-case/cache-explicit-rerun.md
|
|
13
13
|
// @concord-implements docs/feature/experiments/use-case/rerun-all.md
|
|
@@ -135,7 +135,7 @@ function validateProjectTargetReusePlanInput(input) {
|
|
|
135
135
|
* Plans only from Record Host selection references. It neither reconstructs
|
|
136
136
|
* attempt handles from strings nor reads private Record paths.
|
|
137
137
|
*/
|
|
138
|
-
// @concord-code
|
|
138
|
+
// @concord-code
|
|
139
139
|
// @concord-implements docs/feature/experiments/cache.md
|
|
140
140
|
function planProjectTargetReuse(input) {
|
|
141
141
|
return effect_1.Effect.suspend(() => {
|