niceeval 0.15.1-canary.76 → 0.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INDEX.md +45 -40
- package/dist/adapter-execution-trace.cjs.map +1 -1
- package/dist/adapter-execution-trace.d.cts +26 -0
- package/dist/adapter-execution-trace.d.mts +26 -0
- package/dist/adapter-execution-trace.d.ts +26 -0
- package/dist/adapter-usage.cjs.map +1 -1
- package/dist/adapter-usage.d.cts +9 -0
- package/dist/adapter-usage.d.mts +9 -0
- package/dist/adapter-usage.d.ts +9 -0
- package/dist/adapter.cjs +19 -4
- package/dist/adapter.cjs.map +1 -1
- package/dist/adapter.d.cts +37 -12
- package/dist/adapter.d.mts +37 -12
- package/dist/adapter.d.ts +37 -12
- package/dist/agents/ai-sdk.cjs +3 -0
- package/dist/agents/ai-sdk.cjs.map +1 -1
- package/dist/agents/bub.cjs +3 -0
- package/dist/agents/bub.cjs.map +1 -1
- package/dist/agents/claude-code-native.cjs +28 -2
- package/dist/agents/claude-code-native.cjs.map +1 -1
- package/dist/agents/claude-code.cjs +3 -0
- package/dist/agents/claude-code.cjs.map +1 -1
- package/dist/agents/codex.cjs +3 -0
- package/dist/agents/codex.cjs.map +1 -1
- package/dist/agents/coding-cli-versions.cjs +9 -10
- package/dist/agents/coding-cli-versions.cjs.map +1 -1
- package/dist/agents/coding-cli-versions.d.cts +1 -1
- package/dist/agents/coding-cli-versions.d.mts +1 -1
- package/dist/agents/coding-cli-versions.d.ts +1 -1
- package/dist/agents/deepseek-harness.cjs +3 -0
- package/dist/agents/deepseek-harness.cjs.map +1 -1
- package/dist/agents/hermes.cjs +3 -0
- package/dist/agents/hermes.cjs.map +1 -1
- package/dist/agents/index.cjs.map +1 -1
- package/dist/agents/index.d.cts +3 -2
- package/dist/agents/index.d.mts +3 -2
- package/dist/agents/index.d.ts +3 -2
- package/dist/agents/omp.cjs +3 -0
- package/dist/agents/omp.cjs.map +1 -1
- package/dist/agents/openai-compat.cjs +6 -0
- package/dist/agents/openai-compat.cjs.map +1 -1
- package/dist/agents/openclaw.cjs +3 -0
- package/dist/agents/openclaw.cjs.map +1 -1
- package/dist/agents/opencode.cjs +3 -0
- package/dist/agents/opencode.cjs.map +1 -1
- package/dist/agents/sdk-streams.cjs +9 -0
- package/dist/agents/sdk-streams.cjs.map +1 -1
- package/dist/agents/ui-message-stream.cjs +3 -0
- package/dist/agents/ui-message-stream.cjs.map +1 -1
- package/dist/assertions/api.cjs.map +1 -1
- package/dist/assertions/api.d.cts +27 -5
- package/dist/assertions/api.d.mts +27 -5
- package/dist/assertions/api.d.ts +27 -5
- package/dist/assertions/collection.cjs +6 -0
- package/dist/assertions/collection.cjs.map +1 -1
- package/dist/assertions/collection.d.cts +4 -2
- package/dist/assertions/collection.d.mts +4 -2
- package/dist/assertions/collection.d.ts +4 -2
- package/dist/assertions/collection.js +12 -8
- package/dist/assertions/context-match.cjs +70 -0
- package/dist/assertions/context-match.cjs.map +1 -0
- package/dist/assertions/context-match.d.cts +107 -0
- package/dist/assertions/context-match.d.mts +107 -0
- package/dist/assertions/context-match.d.ts +107 -0
- package/dist/assertions/context-match.js +12 -0
- package/dist/assertions/context-match.js.map +1 -0
- package/dist/assertions/full-content.cjs +109 -0
- package/dist/assertions/full-content.cjs.map +1 -0
- package/dist/assertions/full-content.d.cts +6 -0
- package/dist/assertions/full-content.d.mts +6 -0
- package/dist/assertions/full-content.d.ts +6 -0
- package/dist/assertions/full-content.js +12 -0
- package/dist/assertions/full-content.js.map +1 -0
- package/dist/assertions/judge-presets.cjs +2 -34
- package/dist/assertions/judge-presets.cjs.map +1 -1
- package/dist/assertions/judge-presets.d.cts +6 -9
- package/dist/assertions/judge-presets.d.mts +6 -9
- package/dist/assertions/judge-presets.d.ts +6 -9
- package/dist/assertions/judge-presets.js +8 -8
- package/dist/assertions/judge.cjs +107 -29
- package/dist/assertions/judge.cjs.map +1 -1
- package/dist/assertions/judge.d.cts +2 -0
- package/dist/assertions/judge.d.mts +2 -0
- package/dist/assertions/judge.d.ts +2 -0
- package/dist/assertions/match.cjs +244 -5
- package/dist/assertions/match.cjs.map +1 -1
- package/dist/assertions/match.d.cts +43 -3
- package/dist/assertions/match.d.mts +43 -3
- package/dist/assertions/match.d.ts +43 -3
- package/dist/assertions/match.js +88 -78
- package/dist/assertions/material.cjs +520 -0
- package/dist/assertions/material.cjs.map +1 -0
- package/dist/assertions/material.d.cts +56 -0
- package/dist/assertions/material.d.mts +56 -0
- package/dist/assertions/material.d.ts +56 -0
- package/dist/assertions/material.js +20 -0
- package/dist/assertions/material.js.map +1 -0
- package/dist/assertions/record/attachment.cjs +5 -2
- package/dist/assertions/record/attachment.cjs.map +1 -1
- package/dist/assertions/record/codec.cjs +2 -1
- package/dist/assertions/record/codec.cjs.map +1 -1
- package/dist/assertions/record/model.cjs.map +1 -1
- package/dist/assertions/record/model.d.cts +6 -1
- package/dist/assertions/record/model.d.mts +6 -1
- package/dist/assertions/record/model.d.ts +6 -1
- package/dist/assertions/runtime.cjs +207 -14
- package/dist/assertions/runtime.cjs.map +1 -1
- package/dist/assertions/runtime.d.cts +9 -0
- package/dist/assertions/runtime.d.mts +9 -0
- package/dist/assertions/runtime.d.ts +9 -0
- package/dist/assertions/runtime.js +14 -8
- package/dist/assertions/score-match-audit.cjs +18 -8
- package/dist/assertions/score-match-audit.cjs.map +1 -1
- package/dist/assertions/score-match-gateway.cjs +83 -25
- package/dist/assertions/score-match-gateway.cjs.map +1 -1
- package/dist/assertions/score-match-gateway.d.cts +2 -0
- package/dist/assertions/score-match-gateway.d.mts +2 -0
- package/dist/assertions/score-match-gateway.d.ts +2 -0
- package/dist/assertions/value-composition.test-d.cjs +77 -0
- package/dist/assertions/value-composition.test-d.cjs.map +1 -0
- package/dist/assertions/value-composition.test-d.d.cts +1 -0
- package/dist/assertions/value-composition.test-d.d.mts +1 -0
- package/dist/assertions/value-composition.test-d.d.ts +1 -0
- package/dist/assertions/value-composition.test-d.js +4 -0
- package/dist/assertions/value-composition.test-d.js.map +1 -0
- package/dist/context/assert-first.cjs +207 -213
- package/dist/context/assert-first.cjs.map +1 -1
- package/dist/context/assert-first.d.cts +49 -23
- package/dist/context/assert-first.d.mts +49 -23
- package/dist/context/assert-first.d.ts +49 -23
- package/dist/context/session.cjs +111 -9
- package/dist/context/session.cjs.map +1 -1
- package/dist/context/session.d.cts +18 -0
- package/dist/context/session.d.mts +18 -0
- package/dist/context/session.d.ts +18 -0
- package/dist/define.cjs +17 -1
- package/dist/define.cjs.map +1 -1
- package/dist/eval/cli/contribution.cjs +2 -0
- package/dist/eval/cli/contribution.cjs.map +1 -1
- package/dist/eval/host/index.cjs +2 -0
- package/dist/eval/host/index.cjs.map +1 -1
- package/dist/eval/record/evaluation.cjs +3 -0
- package/dist/eval/record/evaluation.cjs.map +1 -1
- package/dist/eval/record/membership-provenance.d.cts +15 -15
- package/dist/eval/record/membership-provenance.d.mts +15 -15
- package/dist/eval/record/membership-provenance.d.ts +15 -15
- package/dist/eval/record/score.cjs +7 -0
- package/dist/eval/record/score.cjs.map +1 -1
- package/dist/eval/record/sealed-assertion.cjs +3 -0
- package/dist/eval/record/sealed-assertion.cjs.map +1 -1
- package/dist/eval/record/verdict.cjs +7 -0
- package/dist/eval/record/verdict.cjs.map +1 -1
- package/dist/expect/index.cjs +8 -2
- package/dist/expect/index.cjs.map +1 -1
- package/dist/expect/index.d.cts +9 -4
- package/dist/expect/index.d.mts +9 -4
- package/dist/expect/index.d.ts +9 -4
- package/dist/expect/index.js +72 -62
- package/dist/expect/index.mjs +72 -62
- package/dist/experiment/host/cli/contribution.cjs +37 -23
- package/dist/experiment/host/cli/contribution.cjs.map +1 -1
- package/dist/experiment/host/cli/contribution.d.cts +9 -1
- package/dist/experiment/host/cli/contribution.d.mts +9 -1
- package/dist/experiment/host/cli/contribution.d.ts +9 -1
- package/dist/experiment/host/current.cjs +74 -0
- package/dist/experiment/host/current.cjs.map +1 -0
- package/dist/experiment/host/current.d.cts +33 -0
- package/dist/experiment/host/current.d.mts +33 -0
- package/dist/experiment/host/current.d.ts +33 -0
- package/dist/experiment/host/current.js +10 -0
- package/dist/experiment/host/current.js.map +1 -0
- package/dist/experiment/host/index.cjs +17 -174
- package/dist/experiment/host/index.cjs.map +1 -1
- package/dist/experiment/host/index.d.cts +8 -54
- package/dist/experiment/host/index.d.mts +8 -54
- package/dist/experiment/host/index.d.ts +8 -54
- package/dist/experiment/host/operations.cjs +33 -10
- package/dist/experiment/host/operations.cjs.map +1 -1
- package/dist/experiment/host/operations.d.cts +29 -1
- package/dist/experiment/host/operations.d.mts +29 -1
- package/dist/experiment/host/operations.d.ts +29 -1
- package/dist/experiment/host/operations.js +6 -4
- package/dist/experiment/host/requirements.cjs +3 -0
- package/dist/experiment/host/requirements.cjs.map +1 -0
- package/dist/experiment/host/requirements.d.cts +3 -0
- package/dist/experiment/host/requirements.d.mts +3 -0
- package/dist/experiment/host/requirements.d.ts +3 -0
- package/dist/experiment/host/requirements.js +4 -0
- package/dist/experiment/host/requirements.js.map +1 -0
- package/dist/experiment/host/runtime.cjs +179 -0
- package/dist/experiment/host/runtime.cjs.map +1 -0
- package/dist/experiment/host/runtime.d.cts +79 -0
- package/dist/experiment/host/runtime.d.mts +79 -0
- package/dist/experiment/host/runtime.d.ts +79 -0
- package/dist/experiment/host/runtime.js +6 -0
- package/dist/experiment/host/runtime.js.map +1 -0
- package/dist/experiment/host/types.cjs.map +1 -1
- package/dist/experiment/host/types.d.cts +17 -16
- package/dist/experiment/host/types.d.mts +17 -16
- package/dist/experiment/host/types.d.ts +17 -16
- package/dist/fresh-import.cjs +2 -1
- package/dist/fresh-import.cjs.map +1 -1
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -6
- package/dist/index.d.mts +12 -6
- package/dist/index.d.ts +12 -6
- package/dist/index.js +32 -30
- package/dist/index.mjs +32 -30
- package/dist/inspection/artifacts.cjs +83 -54
- package/dist/inspection/artifacts.cjs.map +1 -1
- package/dist/inspection/artifacts.d.cts +8 -0
- package/dist/inspection/artifacts.d.mts +8 -0
- package/dist/inspection/artifacts.d.ts +8 -0
- package/dist/inspection/artifacts.js +2 -0
- package/dist/inspection/assertions.cjs +4 -1
- package/dist/inspection/assertions.cjs.map +1 -1
- package/dist/inspection/cli/contribution.cjs +27 -4
- package/dist/inspection/cli/contribution.cjs.map +1 -1
- package/dist/inspection/cli/contribution.d.cts +2 -1
- package/dist/inspection/cli/contribution.d.mts +2 -1
- package/dist/inspection/cli/contribution.d.ts +2 -1
- package/dist/inspection/execution-traces.cjs +114 -8
- package/dist/inspection/execution-traces.cjs.map +1 -1
- package/dist/inspection/execution-traces.d.cts +38 -0
- package/dist/inspection/execution-traces.d.mts +38 -0
- package/dist/inspection/execution-traces.d.ts +38 -0
- package/dist/inspection/facts.cjs +12 -0
- package/dist/inspection/facts.cjs.map +1 -1
- package/dist/inspection/limits.cjs +5 -1
- package/dist/inspection/limits.cjs.map +1 -1
- package/dist/inspection/limits.d.cts +4 -0
- package/dist/inspection/limits.d.mts +4 -0
- package/dist/inspection/limits.d.ts +4 -0
- package/dist/inspection/limits.js +6 -2
- package/dist/inspection/overview.cjs +74 -33
- package/dist/inspection/overview.cjs.map +1 -1
- package/dist/inspection/overview.d.cts +19 -1
- package/dist/inspection/overview.d.mts +19 -1
- package/dist/inspection/overview.d.ts +19 -1
- package/dist/inspection/overview.js +4 -2
- package/dist/inspection/project-input.cjs +9 -0
- package/dist/inspection/project-input.cjs.map +1 -0
- package/dist/inspection/project-input.d.cts +20 -0
- package/dist/inspection/project-input.d.mts +20 -0
- package/dist/inspection/project-input.d.ts +20 -0
- package/dist/inspection/project-input.js +8 -0
- package/dist/inspection/project-input.js.map +1 -0
- package/dist/inspection/project-result.cjs +60 -0
- package/dist/inspection/project-result.cjs.map +1 -0
- package/dist/inspection/project-result.d.cts +1264 -0
- package/dist/inspection/project-result.d.mts +1264 -0
- package/dist/inspection/project-result.d.ts +1264 -0
- package/dist/inspection/project-result.js +10 -0
- package/dist/inspection/project-result.js.map +1 -0
- package/dist/inspection/project-source.cjs +109 -0
- package/dist/inspection/project-source.cjs.map +1 -0
- package/dist/inspection/project-source.d.cts +10 -0
- package/dist/inspection/project-source.d.mts +10 -0
- package/dist/inspection/project-source.d.ts +10 -0
- package/dist/inspection/project-source.js +6 -0
- package/dist/inspection/project-source.js.map +1 -0
- package/dist/inspection/project.cjs +100 -0
- package/dist/inspection/project.cjs.map +1 -0
- package/dist/inspection/project.d.cts +3 -0
- package/dist/inspection/project.d.mts +3 -0
- package/dist/inspection/project.d.ts +3 -0
- package/dist/inspection/project.js +6 -0
- package/dist/inspection/project.js.map +1 -0
- package/dist/inspection/protocol.cjs +19 -9
- package/dist/inspection/protocol.cjs.map +1 -1
- package/dist/inspection/protocol.d.cts +5506 -38189
- package/dist/inspection/protocol.d.mts +5506 -38189
- package/dist/inspection/protocol.d.ts +5506 -38189
- package/dist/inspection/public.mjs +896 -84
- package/dist/inspection/query.cjs +2 -0
- package/dist/inspection/query.cjs.map +1 -1
- package/dist/inspection/results.cjs +234 -29
- package/dist/inspection/results.cjs.map +1 -1
- package/dist/inspection/results.d.cts +870 -13
- package/dist/inspection/results.d.mts +870 -13
- package/dist/inspection/results.d.ts +870 -13
- package/dist/inspection/results.js +36 -34
- package/dist/inspection/select.cjs +126 -14
- package/dist/inspection/select.cjs.map +1 -1
- package/dist/inspection/select.d.cts +1 -1
- package/dist/inspection/select.d.mts +1 -1
- package/dist/inspection/select.d.ts +1 -1
- package/dist/inspection/source.cjs +4 -0
- package/dist/inspection/source.cjs.map +1 -1
- package/dist/inspection/sources.cjs +5 -0
- package/dist/inspection/sources.cjs.map +1 -1
- package/dist/inspection/trace.cjs +82 -84
- package/dist/inspection/trace.cjs.map +1 -1
- package/dist/inspection/trace.d.cts +7 -2
- package/dist/inspection/trace.d.mts +7 -2
- package/dist/inspection/trace.d.ts +7 -2
- package/dist/model-slots.cjs +35 -0
- package/dist/model-slots.cjs.map +1 -0
- package/dist/model-slots.d.cts +19 -0
- package/dist/model-slots.d.mts +19 -0
- package/dist/model-slots.d.ts +19 -0
- package/dist/model-slots.js +8 -0
- package/dist/model-slots.js.map +1 -0
- package/dist/o11y/adapter-call-price.cjs +4 -0
- package/dist/o11y/adapter-call-price.cjs.map +1 -1
- package/dist/o11y/adapter-call-price.d.cts +24 -0
- package/dist/o11y/adapter-call-price.d.mts +24 -0
- package/dist/o11y/adapter-call-price.d.ts +24 -0
- package/dist/o11y/adapter-call-price.js +6 -2
- package/dist/o11y/adapter-usage-projection.cjs +158 -0
- package/dist/o11y/adapter-usage-projection.cjs.map +1 -0
- package/dist/o11y/adapter-usage-projection.d.cts +141 -0
- package/dist/o11y/adapter-usage-projection.d.mts +141 -0
- package/dist/o11y/adapter-usage-projection.d.ts +141 -0
- package/dist/o11y/adapter-usage-projection.js +20 -0
- package/dist/o11y/adapter-usage-projection.js.map +1 -0
- package/dist/o11y/eval-usage.cjs +149 -0
- package/dist/o11y/eval-usage.cjs.map +1 -0
- package/dist/o11y/eval-usage.d.cts +46 -0
- package/dist/o11y/eval-usage.d.mts +46 -0
- package/dist/o11y/eval-usage.d.ts +46 -0
- package/dist/o11y/eval-usage.js +8 -0
- package/dist/o11y/eval-usage.js.map +1 -0
- package/dist/o11y/judge-call-price.cjs +62 -0
- package/dist/o11y/judge-call-price.cjs.map +1 -0
- package/dist/o11y/judge-call-price.d.cts +3 -0
- package/dist/o11y/judge-call-price.d.mts +3 -0
- package/dist/o11y/judge-call-price.d.ts +3 -0
- package/dist/o11y/judge-call-price.js +6 -0
- package/dist/o11y/judge-call-price.js.map +1 -0
- package/dist/o11y/judge-usage-projection.cjs +134 -0
- package/dist/o11y/judge-usage-projection.cjs.map +1 -0
- package/dist/o11y/judge-usage-projection.d.cts +18 -0
- package/dist/o11y/judge-usage-projection.d.mts +18 -0
- package/dist/o11y/judge-usage-projection.d.ts +18 -0
- package/dist/o11y/judge-usage-projection.js +20 -0
- package/dist/o11y/judge-usage-projection.js.map +1 -0
- package/dist/o11y/judge-usage-receipt.cjs +135 -0
- package/dist/o11y/judge-usage-receipt.cjs.map +1 -0
- package/dist/o11y/judge-usage-receipt.d.cts +5 -0
- package/dist/o11y/judge-usage-receipt.d.mts +5 -0
- package/dist/o11y/judge-usage-receipt.d.ts +5 -0
- package/dist/o11y/judge-usage-receipt.js +6 -0
- package/dist/o11y/judge-usage-receipt.js.map +1 -0
- package/dist/o11y/judge-usage.cjs +171 -0
- package/dist/o11y/judge-usage.cjs.map +1 -0
- package/dist/o11y/judge-usage.d.cts +35 -0
- package/dist/o11y/judge-usage.d.mts +35 -0
- package/dist/o11y/judge-usage.d.ts +35 -0
- package/dist/o11y/judge-usage.js +6 -0
- package/dist/o11y/judge-usage.js.map +1 -0
- package/dist/plugin/contracts.cjs +2 -0
- package/dist/plugin/contracts.cjs.map +1 -1
- package/dist/plugin/link.cjs +7 -0
- package/dist/plugin/link.cjs.map +1 -1
- package/dist/record/attachment/protocol.cjs +8 -6
- package/dist/record/attachment/protocol.cjs.map +1 -1
- package/dist/record/attachment/protocol.d.cts +10 -0
- package/dist/record/attachment/protocol.d.mts +10 -0
- package/dist/record/attachment/protocol.d.ts +10 -0
- package/dist/record/attachment/protocol.js +38 -36
- package/dist/record/codec/seal-manifest.d.cts +3 -3
- package/dist/record/codec/seal-manifest.d.mts +3 -3
- package/dist/record/codec/seal-manifest.d.ts +3 -3
- package/dist/record/family/adapter-usage/definition.d.cts +1 -0
- package/dist/record/family/adapter-usage/definition.d.mts +1 -0
- package/dist/record/family/adapter-usage/definition.d.ts +1 -0
- package/dist/record/family/adapter-usage/persistence.cjs +1 -1
- package/dist/record/family/adapter-usage/persistence.cjs.map +1 -1
- package/dist/record/family/adapter-usage/persistence.d.cts +2 -1
- package/dist/record/family/adapter-usage/persistence.d.mts +2 -1
- package/dist/record/family/adapter-usage/persistence.d.ts +2 -1
- package/dist/record/family/adapter-usage/schema.cjs +21 -2
- package/dist/record/family/adapter-usage/schema.cjs.map +1 -1
- package/dist/record/family/adapter-usage/schema.d.cts +85 -0
- package/dist/record/family/adapter-usage/schema.d.mts +85 -0
- package/dist/record/family/adapter-usage/schema.d.ts +85 -0
- package/dist/record/family/adapter-usage/schema.js +18 -12
- package/dist/record/family/catalog.cjs +31 -27
- package/dist/record/family/catalog.cjs.map +1 -1
- package/dist/record/family/catalog.d.cts +94 -3
- package/dist/record/family/catalog.d.mts +94 -3
- package/dist/record/family/catalog.d.ts +94 -3
- package/dist/record/family/current.cjs +45 -42
- package/dist/record/family/current.cjs.map +1 -1
- package/dist/record/family/current.d.cts +240 -1
- package/dist/record/family/current.d.mts +240 -1
- package/dist/record/family/current.d.ts +240 -1
- package/dist/record/family/execution-traces/definition.d.cts +26 -0
- package/dist/record/family/execution-traces/definition.d.mts +26 -0
- package/dist/record/family/execution-traces/definition.d.ts +26 -0
- package/dist/record/family/execution-traces/definition.js +20 -14
- package/dist/record/family/execution-traces/schema.cjs +57 -1
- package/dist/record/family/execution-traces/schema.cjs.map +1 -1
- package/dist/record/family/execution-traces/schema.d.cts +114 -0
- package/dist/record/family/execution-traces/schema.d.mts +114 -0
- package/dist/record/family/execution-traces/schema.d.ts +114 -0
- package/dist/record/family/execution-traces/schema.js +18 -12
- package/dist/record/family/judge-usage/definition.cjs +12 -0
- package/dist/record/family/judge-usage/definition.cjs.map +1 -0
- package/dist/record/family/judge-usage/definition.d.cts +91 -0
- package/dist/record/family/judge-usage/definition.d.mts +91 -0
- package/dist/record/family/judge-usage/definition.d.ts +91 -0
- package/dist/record/family/judge-usage/definition.js +6 -0
- package/dist/record/family/judge-usage/definition.js.map +1 -0
- package/dist/record/family/judge-usage/persistence.cjs +10 -0
- package/dist/record/family/judge-usage/persistence.cjs.map +1 -0
- package/dist/record/family/judge-usage/persistence.d.cts +91 -0
- package/dist/record/family/judge-usage/persistence.d.mts +91 -0
- package/dist/record/family/judge-usage/persistence.d.ts +91 -0
- package/dist/record/family/judge-usage/persistence.js +6 -0
- package/dist/record/family/judge-usage/persistence.js.map +1 -0
- package/dist/record/family/judge-usage/schema.cjs +307 -0
- package/dist/record/family/judge-usage/schema.cjs.map +1 -0
- package/dist/record/family/judge-usage/schema.d.cts +351 -0
- package/dist/record/family/judge-usage/schema.d.mts +351 -0
- package/dist/record/family/judge-usage/schema.d.ts +351 -0
- package/dist/record/family/judge-usage/schema.js +18 -0
- package/dist/record/family/judge-usage/schema.js.map +1 -0
- package/dist/record/host/sqlite-host.cjs +55 -9
- package/dist/record/host/sqlite-host.cjs.map +1 -1
- package/dist/record/host/types.cjs.map +1 -1
- package/dist/record/host/types.d.cts +7 -0
- package/dist/record/host/types.d.mts +7 -0
- package/dist/record/host/types.d.ts +7 -0
- package/dist/record/model/run-context.cjs +7 -1
- package/dist/record/model/run-context.cjs.map +1 -1
- package/dist/record/model/run-context.d.cts +4 -0
- package/dist/record/model/run-context.d.mts +4 -0
- package/dist/record/model/run-context.d.ts +4 -0
- package/dist/record/model/seal-manifest.d.cts +1 -1
- package/dist/record/model/seal-manifest.d.mts +1 -1
- package/dist/record/model/seal-manifest.d.ts +1 -1
- package/dist/record/sqlite/client.cjs +18 -5
- package/dist/record/sqlite/client.cjs.map +1 -1
- package/dist/record/sqlite/client.d.cts +1 -1
- package/dist/record/sqlite/client.d.mts +1 -1
- package/dist/record/sqlite/client.d.ts +1 -1
- package/dist/record/sqlite/project-state-database.cjs +29 -8
- package/dist/record/sqlite/project-state-database.cjs.map +1 -1
- package/dist/run/host/runtime.cjs +4 -0
- package/dist/run/host/runtime.cjs.map +1 -1
- package/dist/run/storage/sqlite.cjs +20 -0
- package/dist/run/storage/sqlite.cjs.map +1 -1
- package/dist/runner/adapter-execution-trace.cjs +125 -2
- package/dist/runner/adapter-execution-trace.cjs.map +1 -1
- package/dist/runner/adapter-execution-trace.d.cts +1 -1
- package/dist/runner/adapter-execution-trace.d.mts +1 -1
- package/dist/runner/adapter-execution-trace.d.ts +1 -1
- package/dist/runner/adapter-usage.cjs +55 -7
- package/dist/runner/adapter-usage.cjs.map +1 -1
- package/dist/runner/adapter-usage.d.cts +9 -2
- package/dist/runner/adapter-usage.d.mts +9 -2
- package/dist/runner/adapter-usage.d.ts +9 -2
- package/dist/runner/adoption.cjs +9 -0
- package/dist/runner/adoption.cjs.map +1 -1
- package/dist/runner/attempt-cancellation.cjs +12 -0
- package/dist/runner/attempt-cancellation.cjs.map +1 -0
- package/dist/runner/attempt-cancellation.d.cts +6 -0
- package/dist/runner/attempt-cancellation.d.mts +6 -0
- package/dist/runner/attempt-cancellation.d.ts +6 -0
- package/dist/runner/attempt-cancellation.js +6 -0
- package/dist/runner/attempt-cancellation.js.map +1 -0
- package/dist/runner/attempt-resources.cjs +10 -4
- package/dist/runner/attempt-resources.cjs.map +1 -1
- package/dist/runner/attempt-resources.d.cts +2 -1
- package/dist/runner/attempt-resources.d.mts +2 -1
- package/dist/runner/attempt-resources.d.ts +2 -1
- package/dist/runner/attempt.cjs +1177 -1139
- package/dist/runner/attempt.cjs.map +1 -1
- package/dist/runner/config-identity.cjs +20 -1
- package/dist/runner/config-identity.cjs.map +1 -1
- package/dist/runner/config-identity.d.cts +5 -0
- package/dist/runner/config-identity.d.mts +5 -0
- package/dist/runner/config-identity.d.ts +5 -0
- package/dist/runner/discover.cjs +14 -0
- package/dist/runner/discover.cjs.map +1 -1
- package/dist/runner/discover.d.cts +3 -0
- package/dist/runner/discover.d.mts +3 -0
- package/dist/runner/discover.d.ts +3 -0
- package/dist/runner/feedback/human.cjs +9 -4
- package/dist/runner/feedback/human.cjs.map +1 -1
- package/dist/runner/fingerprint.cjs +1 -0
- package/dist/runner/fingerprint.cjs.map +1 -1
- package/dist/runner/judge-usage.cjs +18 -0
- package/dist/runner/judge-usage.cjs.map +1 -0
- package/dist/runner/judge-usage.d.cts +5 -0
- package/dist/runner/judge-usage.d.mts +5 -0
- package/dist/runner/judge-usage.d.ts +5 -0
- package/dist/runner/judge-usage.js +8 -0
- package/dist/runner/judge-usage.js.map +1 -0
- package/dist/runner/project-target.cjs.map +1 -1
- package/dist/runner/project-target.d.cts +2 -0
- package/dist/runner/project-target.d.mts +2 -0
- package/dist/runner/project-target.d.ts +2 -0
- package/dist/runner/record/planning.cjs +1 -0
- package/dist/runner/record/planning.cjs.map +1 -1
- package/dist/runner/record.cjs +4 -0
- package/dist/runner/record.cjs.map +1 -1
- package/dist/runner/reporters/braintrust.cjs +2 -0
- package/dist/runner/reporters/braintrust.cjs.map +1 -1
- package/dist/runner/reuse-diagnostics.cjs +9 -10
- package/dist/runner/reuse-diagnostics.cjs.map +1 -1
- package/dist/runner/reuse-diagnostics.d.cts +5 -6
- package/dist/runner/reuse-diagnostics.d.mts +5 -6
- package/dist/runner/reuse-diagnostics.d.ts +5 -6
- package/dist/runner/reuse-diagnostics.js +4 -4
- package/dist/runner/reuse-plan.cjs +100 -48
- package/dist/runner/reuse-plan.cjs.map +1 -1
- package/dist/runner/reuse-plan.d.cts +60 -3
- package/dist/runner/reuse-plan.d.mts +60 -3
- package/dist/runner/reuse-plan.d.ts +60 -3
- package/dist/runner/reuse-plan.js +14 -10
- package/dist/runner/run.cjs +8 -6
- package/dist/runner/run.cjs.map +1 -1
- package/dist/runner/session.cjs +1 -1
- package/dist/runner/session.cjs.map +1 -1
- package/dist/runner/session.d.cts +1 -1
- package/dist/runner/session.d.mts +1 -1
- package/dist/runner/session.d.ts +1 -1
- package/dist/runner/source-producer.cjs +3 -1
- package/dist/runner/source-producer.cjs.map +1 -1
- package/dist/runner/types.cjs.map +1 -1
- package/dist/runner/types.d.cts +26 -5
- package/dist/runner/types.d.mts +26 -5
- package/dist/runner/types.d.ts +26 -5
- package/dist/sandbox/action.cjs +3 -0
- package/dist/sandbox/action.cjs.map +1 -1
- package/dist/sandbox/commands.cjs +3 -0
- package/dist/sandbox/commands.cjs.map +1 -1
- package/dist/sandbox/compose.cjs +6 -0
- package/dist/sandbox/compose.cjs.map +1 -1
- package/dist/sandbox/docker-profile/registry.cjs +7 -0
- package/dist/sandbox/docker-profile/registry.cjs.map +1 -1
- package/dist/sandbox/docker-profile/runtime.cjs +3 -0
- package/dist/sandbox/docker-profile/runtime.cjs.map +1 -1
- package/dist/sandbox/docker-profile/schema.cjs +7 -0
- package/dist/sandbox/docker-profile/schema.cjs.map +1 -1
- package/dist/sandbox/incus.cjs +7 -0
- package/dist/sandbox/incus.cjs.map +1 -1
- package/dist/sandbox/layer.cjs +12 -0
- package/dist/sandbox/layer.cjs.map +1 -1
- package/dist/shared/adapter-cleanup.cjs +18 -0
- package/dist/shared/adapter-cleanup.cjs.map +1 -0
- package/dist/shared/adapter-cleanup.d.cts +4 -0
- package/dist/shared/adapter-cleanup.d.mts +4 -0
- package/dist/shared/adapter-cleanup.d.ts +4 -0
- package/dist/shared/adapter-cleanup.js +10 -0
- package/dist/shared/adapter-cleanup.js.map +1 -0
- package/dist/shared/attempt-lifecycle.cjs +3 -0
- package/dist/shared/attempt-lifecycle.cjs.map +1 -0
- package/dist/shared/attempt-lifecycle.d.cts +13 -0
- package/dist/shared/attempt-lifecycle.d.mts +13 -0
- package/dist/shared/attempt-lifecycle.d.ts +13 -0
- package/dist/shared/attempt-lifecycle.js +4 -0
- package/dist/shared/attempt-lifecycle.js.map +1 -0
- package/dist/show/contribution.cjs +52 -14
- package/dist/show/contribution.cjs.map +1 -1
- package/dist/show/contribution.d.cts +23 -1
- package/dist/show/contribution.d.mts +23 -1
- package/dist/show/contribution.d.ts +23 -1
- package/dist/show/model.cjs +8 -1
- package/dist/show/model.cjs.map +1 -1
- package/dist/show/model.d.cts +10 -1
- package/dist/show/model.d.mts +10 -1
- package/dist/show/model.d.ts +10 -1
- package/dist/show/render.cjs +287 -49
- package/dist/show/render.cjs.map +1 -1
- package/dist/show/render.d.cts +3 -0
- package/dist/show/render.d.mts +3 -0
- package/dist/show/render.d.ts +3 -0
- package/dist/sources/projector.cjs +3 -0
- package/dist/sources/projector.cjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/view/app-dist/.vite/manifest.json +2 -2
- package/dist/view/app-dist/assets/index-CmVoXbwG.js +63 -0
- package/dist/view/app-dist/assets/{quality-cost-scatter-CFB3wnkN.js → quality-cost-scatter-BuLISaH4.js} +1 -1
- package/dist/view/app-dist/index.html +1 -1
- package/dist/view/cli/contribution.cjs +54 -21
- package/dist/view/cli/contribution.cjs.map +1 -1
- package/dist/view/cli/contribution.d.cts +2 -1
- package/dist/view/cli/contribution.d.mts +2 -1
- package/dist/view/cli/contribution.d.ts +2 -1
- package/dist/view/function-runtime.mjs +13231 -11647
- package/dist/view/http-protocol.cjs +3 -0
- package/dist/view/http-protocol.cjs.map +1 -1
- package/dist/view/http-protocol.d.cts +8 -0
- package/dist/view/http-protocol.d.mts +8 -0
- package/dist/view/http-protocol.d.ts +8 -0
- package/dist/view/inspection-host.cjs +17 -1
- package/dist/view/inspection-host.cjs.map +1 -1
- package/dist/view/render.cjs +1 -0
- package/dist/view/render.cjs.map +1 -1
- package/dist/view/render.d.cts +2 -1
- package/dist/view/render.d.mts +2 -1
- package/dist/view/render.d.ts +2 -1
- package/dist/view/revision.cjs.map +1 -1
- package/dist/view/revision.d.cts +12 -0
- package/dist/view/revision.d.mts +12 -0
- package/dist/view/revision.d.ts +12 -0
- package/dist/view/server.cjs +10 -9
- package/dist/view/server.cjs.map +1 -1
- package/docs-site/zh/examples/ai-agent-application.mdx +1 -1
- package/docs-site/zh/explanation/adapter.mdx +2 -2
- package/docs-site/zh/explanation/assert.mdx +60 -24
- package/docs-site/zh/explanation/drive.mdx +1 -1
- package/docs-site/zh/explanation/evals.mdx +31 -29
- package/docs-site/zh/explanation/experiment.mdx +15 -15
- package/docs-site/zh/explanation/judge.mdx +23 -15
- package/docs-site/zh/explanation/overview.mdx +44 -21
- package/docs-site/zh/explanation/record.mdx +28 -13
- package/docs-site/zh/explanation/results-flow.mdx +37 -0
- package/docs-site/zh/explanation/runner.mdx +27 -6
- package/docs-site/zh/index.mdx +22 -115
- package/docs-site/zh/introduction.mdx +89 -61
- package/docs-site/zh/reference/cli.mdx +50 -26
- package/docs-site/zh/reference/define-agent.mdx +37 -5
- package/docs-site/zh/reference/define-eval.mdx +130 -29
- package/docs-site/zh/reference/define-experiment.mdx +251 -0
- package/docs-site/zh/reference/events.mdx +34 -30
- package/docs-site/zh/reference/expect.mdx +77 -2
- package/docs-site/zh/reference/official-adapters.mdx +2 -2
- package/docs-site/zh/troubleshooting/debug-sandbox.mdx +43 -24
- package/docs-site/zh/troubleshooting/debugging.mdx +65 -42
- package/docs-site/zh/troubleshooting/recover-after-kill.mdx +35 -28
- package/docs-site/zh/tutorials/accept-results.mdx +34 -24
- package/docs-site/zh/tutorials/agent-feedback-loop.mdx +74 -43
- package/docs-site/zh/tutorials/agent-onboarding.mdx +27 -20
- package/docs-site/zh/tutorials/authoring.mdx +138 -121
- package/docs-site/zh/tutorials/ci-integration.mdx +46 -22
- package/docs-site/zh/tutorials/compare-runs.mdx +40 -13
- package/docs-site/zh/tutorials/concurrency.mdx +66 -62
- package/docs-site/zh/tutorials/configuration.mdx +17 -17
- package/docs-site/zh/tutorials/connect-otel.mdx +48 -37
- package/docs-site/zh/tutorials/connect-your-agent.mdx +80 -173
- package/docs-site/zh/tutorials/control-run-cost.mdx +63 -12
- package/docs-site/zh/tutorials/criteria-files.mdx +28 -21
- package/docs-site/zh/tutorials/custom-application.mdx +75 -55
- package/docs-site/zh/tutorials/dataset-fanout.mdx +32 -22
- package/docs-site/zh/tutorials/debug-lifecycle-plan.mdx +38 -31
- package/docs-site/zh/tutorials/docker-in-docker.mdx +83 -89
- package/docs-site/zh/tutorials/eval-groups.mdx +70 -89
- package/docs-site/zh/tutorials/evaluation-kinds.mdx +12 -5
- package/docs-site/zh/tutorials/experiment-services.mdx +243 -0
- package/docs-site/zh/tutorials/fixtures.mdx +42 -26
- package/docs-site/zh/tutorials/handle-execution-failures.mdx +41 -19
- package/docs-site/zh/tutorials/install-custom-sandbox-agent.mdx +21 -16
- package/docs-site/zh/tutorials/niceeval-taste-application.mdx +394 -0
- package/docs-site/zh/tutorials/niceeval-taste.mdx +190 -0
- package/docs-site/zh/tutorials/nixos-managed-dind.mdx +51 -39
- package/docs-site/zh/tutorials/plugins.mdx +55 -31
- package/docs-site/zh/tutorials/prebuilt-sandbox.mdx +204 -0
- package/docs-site/zh/tutorials/quickstart.mdx +91 -47
- package/docs-site/zh/tutorials/reporters.mdx +45 -30
- package/docs-site/zh/tutorials/rerun-and-cache.mdx +39 -40
- package/docs-site/zh/tutorials/sandbox-agent.mdx +65 -40
- package/docs-site/zh/tutorials/sandbox-providers.mdx +104 -282
- package/docs-site/zh/tutorials/sandbox-reuse.mdx +65 -97
- package/docs-site/zh/tutorials/select-and-preview.mdx +25 -20
- package/docs-site/zh/tutorials/verify-judge.mdx +49 -26
- package/docs-site/zh/tutorials/viewing-results.mdx +130 -80
- package/docs-site/zh/tutorials/write-experiment.mdx +116 -298
- package/docs-site/zh/tutorials/write-send.mdx +53 -52
- package/node_modules/undici/docs/docs/api/Agent.md +8 -8
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +9 -6
- package/node_modules/undici/docs/docs/api/Errors.md +25 -0
- package/node_modules/undici/docs/docs/api/Interceptors.md +4 -3
- package/node_modules/undici/docs/docs/api/Pool.md +5 -6
- package/node_modules/undici/lib/api/readable.js +1 -2
- package/node_modules/undici/lib/core/request.js +23 -2
- package/node_modules/undici/lib/core/util.js +0 -39
- package/node_modules/undici/lib/dispatcher/client-h1.js +11 -4
- package/node_modules/undici/lib/dispatcher/client-h2.js +52 -8
- package/node_modules/undici/lib/dispatcher/client.js +1 -1
- package/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +3 -2
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +21 -6
- package/node_modules/undici/lib/dispatcher/pool-base.js +63 -2
- package/node_modules/undici/lib/dispatcher/pool.js +90 -7
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +16 -3
- package/node_modules/undici/lib/handler/deduplication-handler.js +24 -11
- package/node_modules/undici/lib/handler/redirect-handler.js +5 -0
- package/node_modules/undici/lib/handler/retry-handler.js +72 -13
- package/node_modules/undici/lib/interceptor/cache.js +4 -1
- package/node_modules/undici/lib/interceptor/decompress.js +236 -69
- package/node_modules/undici/lib/web/cache/cache.js +17 -8
- package/node_modules/undici/lib/web/cache/cachestorage.js +11 -5
- package/node_modules/undici/lib/web/cookies/index.js +19 -7
- package/node_modules/undici/lib/web/cookies/util.js +3 -1
- package/node_modules/undici/lib/web/eventsource/eventsource.js +25 -1
- package/node_modules/undici/lib/web/fetch/body.js +22 -15
- package/node_modules/undici/lib/web/fetch/data-url.js +6 -6
- package/node_modules/undici/lib/web/fetch/formdata.js +30 -36
- package/node_modules/undici/lib/web/fetch/headers.js +34 -31
- package/node_modules/undici/lib/web/fetch/index.js +38 -14
- package/node_modules/undici/lib/web/fetch/request.js +74 -79
- package/node_modules/undici/lib/web/fetch/response.js +43 -44
- package/node_modules/undici/lib/web/fetch/util.js +7 -7
- package/node_modules/undici/lib/web/infra/index.js +16 -1
- package/node_modules/undici/lib/web/webidl/index.js +2 -14
- package/node_modules/undici/lib/web/websocket/events.js +43 -26
- package/node_modules/undici/lib/web/websocket/receiver.js +5 -0
- package/node_modules/undici/lib/web/websocket/stream/websocketerror.js +13 -10
- package/node_modules/undici/lib/web/websocket/websocket.js +44 -41
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/diagnostics-channel.d.ts +2 -1
- package/node_modules/undici/types/interceptors.d.ts +1 -1
- package/node_modules/undici/types/webidl.d.ts +13 -7
- package/package.json +4 -4
- package/dist/view/app-dist/assets/index-DFzw1L97.js +0 -63
- package/docs-site/zh/tutorials/experiments.mdx +0 -101
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reuse-plan.js","sourceRoot":"","sources":["reuse-plan.ts"],"names":[],"mappings":";;;AAoKA,wDAKC;AAED,kFA2EC;AAKD,wD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AK,QAAQ;WACnC,uBAAuB,CAAC,QAAQ,CAAC,MAAM,CAAC;WACxC,OAAO,QAAQ,CAAC,YAAY,KAAK,QAAQ;WACzC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC;WACtC,QAAQ,CAAC,YAAY,IAAI,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { Effect, Result } from \"effect\";\nimport { foldRecordedAttemptScore } from \"../eval/record/score.ts\";\nimport { executionDigestForExperiment, hasProvenNoExperimentHooks } from \"./rename-identity.ts\";\nimport type { RecordIssue } from \"../record/errors/record-errors.ts\";\nimport type { AssertionsAttachment, } from \"../record/family/assertions/definition.ts\";\nimport { NiceEvalRecordAttachments } from \"../record/family/catalog.ts\";\nimport { readAttemptExecutionDuration, type DurationLimit, } from \"../eval/record/eligibility.ts\";\nimport { COMPARISON_SOURCE_STATES, type ComparisonAttachment, type ComparisonResult, type RecordedAttemptClaim, } from \"../eval/record/membership-provenance.ts\";\nimport { foldRecordedAttemptVerdict, type VerdictState, } from \"../eval/record/verdict.ts\";\nimport type { RecordReadSession, ReadableAttempt, ReadableRun, SelectedAttemptRef, SelectedRunRef, } from \"../record/host/types.ts\";\nimport type { RecordCoreRead } from \"../record/model/read-state.ts\";\nimport { compareCanonicalIdentity, isPortableSegment, isSha256Digest, isUtcMillis, type ExecutionIdentityDigest, type RunId, type SlotId, type UtcMillis, } from \"../record/model/identifiers.ts\";\nimport type { AttemptOutcome, RecordSlotIdentity } from \"../record/model/core.ts\";\nimport type { RecordReaderReadError } from \"../record/reader/errors.ts\";\nimport type { EvaluationKind } from \"./types.ts\";\nexport const PROJECT_TARGET_POLICY_NAME = \"project-target\" as const;\nexport const PROJECT_TARGET_POLICY_VERSION = 1 as const;\nexport const PROJECT_TARGET_INVOCATION_ID_MAXIMUM_LENGTH = 255 as const;\nexport const PROJECT_TARGET_RECORD_IDENTITY_MAXIMUM_LENGTH = 4096 as const;\nexport interface ExecutionPolicyIdentity {\n readonly name: typeof PROJECT_TARGET_POLICY_NAME;\n readonly version: typeof PROJECT_TARGET_POLICY_VERSION;\n}\nexport const projectTargetPolicyIdentity: ExecutionPolicyIdentity = Object.freeze({\n name: PROJECT_TARGET_POLICY_NAME,\n version: PROJECT_TARGET_POLICY_VERSION,\n});\n/** Current planner input, kept in memory rather than persisted as an Attachment. */\nexport interface ExecutionIdentity {\n readonly domain: string;\n readonly value: string;\n}\nexport interface ExecutionDurationLimit {\n readonly domain: string;\n readonly milliseconds: number;\n}\n/**\n * Reuse compares current execution identity with the immutable Core Slot,\n * folds Core outcome with Assertions, and reads duration from Runner Activity\n * receipts. None of these facts is a separate eligibility/verdict family.\n */\nexport const EXECUTION_COMPARISON_PROJECTION_STATE = Object.freeze({\n migrationRequired: \"migration-required\" as const,\n});\nexport const EXECUTION_COMPARISON_SOURCE_STATES = [\n ...COMPARISON_SOURCE_STATES,\n EXECUTION_COMPARISON_PROJECTION_STATE.migrationRequired,\n] as const;\nexport type ExecutionComparisonAttachment = ComparisonAttachment;\nexport type ExecutionComparisonSourceState = (typeof EXECUTION_COMPARISON_SOURCE_STATES)[number];\nexport type ExecutionComparisonResult = ComparisonResult;\nexport type ExecutionRecordedClaim = RecordedAttemptClaim;\nexport interface ExecutionComparison {\n readonly attachment: ExecutionComparisonAttachment;\n readonly recordedClaim: ExecutionRecordedClaim;\n readonly sourceState: ExecutionComparisonSourceState;\n readonly result: ExecutionComparisonResult;\n readonly reason: string;\n}\nexport type ExecutionGapReason = \"no-source-run\" | \"source-slot-missing\" | \"source-member-missing\" | \"source-core-invalid\" | \"source-publication-unavailable\" | \"source-attachment-unavailable\" | \"source-attachment-migration-required\" | \"source-attachment-unsupported\" | \"source-attachment-invalid\" | \"reuse-contract-domain-mismatch\" | \"reuse-contract-mismatch\" | \"identity-mismatch\" | \"identity-domain-mismatch\" | \"duration-domain-mismatch\" | \"timeout-exceeded\" | \"attempt-outcome-ineligible\" | \"adoption-unproven\" | \"verdict-ineligible\" | \"adapter-behavior-revision-required\" | \"rerun-requested\" | \"sandbox-retention-requested\";\nexport type ExecutionGapScope = \"slot\" | \"experiment\" | \"target\";\n/** Origin identity is read from the immutable Attempt, never reconstructed. */\nexport interface ExecutionSourceOrigin {\n readonly runId: RunId;\n readonly slotId: SlotId;\n}\n/** The selected Run boundary may itself be a reference Run. */\nexport interface ExecutionSourceBarrier {\n readonly runId: RunId;\n readonly startedAt: UtcMillis;\n}\nexport interface ExecutionReuseEffectiveOptions {\n readonly rerun: \"none\" | \"failed\" | \"all\";\n readonly keepSandbox: boolean;\n readonly reuseContract: ExecutionIdentity;\n}\nexport interface ExecutionTarget {\n readonly invocationId: string;\n readonly runs: readonly TargetRun[];\n}\nexport interface TargetRun {\n readonly runId: RunId;\n readonly experimentId: string;\n readonly startedAt: UtcMillis;\n readonly slots: readonly TargetSlot[];\n}\n/**\n * `slotId` and `executionIdentityDigest` are deterministic current planning\n * facts. A carried Member can therefore point at the exact immutable origin\n * Attempt without an out-of-band provenance Attachment.\n */\nexport interface TargetSlot {\n readonly renameFingerprint?: (experimentId: string) => string | undefined;\n readonly runId: RunId;\n readonly slotId: SlotId;\n readonly experimentId: string;\n readonly evalId: string;\n readonly attempt: number;\n readonly evaluationKind: EvaluationKind;\n readonly executionIdentityDigest: ExecutionIdentityDigest;\n readonly inputIdentity: ExecutionIdentity;\n readonly configIdentity: ExecutionIdentity;\n readonly timeout?: ExecutionDurationLimit;\n /** Current-only eligibility fact; omitted means behavior identity is reusable. */\n readonly reuseEligibility?: \"adapter-behavior-revision-required\";\n}\nexport type AssertionsVerdict = VerdictState;\n/** The exact selection-issued references remain live only while its reader Scope is live. */\nexport interface ExecutionReusePlanSource {\n readonly attemptId: SelectedAttemptRef[\"attemptId\"];\n readonly attempt: SelectedAttemptRef & {\n readonly publicationIdentity: NonNullable<SelectedAttemptRef[\"publicationIdentity\"]>;\n };\n readonly origin: ExecutionSourceOrigin;\n readonly originRun: SelectedRunRef;\n readonly sourceBarrier: ExecutionSourceBarrier;\n readonly evaluationKind: EvaluationKind;\n}\nexport interface ProjectTargetPolicy {\n readonly identity: ExecutionPolicyIdentity;\n readonly reuseContract: ExecutionIdentity;\n readonly rerun: \"none\" | \"failed\" | \"all\";\n readonly keepSandbox: boolean;\n}\nexport interface ExecutionReusePlanSlotBase extends TargetSlot {\n readonly comparisons: readonly ExecutionComparison[];\n}\nexport interface ReusePlanSlot extends ExecutionReusePlanSlotBase {\n readonly state: \"reuse\";\n readonly adoption: \"carried\";\n readonly source: ExecutionReusePlanSource;\n}\nexport interface ExecutionGapSlot extends ExecutionReusePlanSlotBase {\n readonly state: \"gap\";\n readonly reason: ExecutionGapReason;\n readonly scope: ExecutionGapScope;\n readonly issues: readonly RecordIssue[];\n readonly sourceBarrier?: ExecutionSourceBarrier;\n readonly candidate?: ExecutionReusePlanSource;\n}\nexport type ExecutionReusePlanSlot = ReusePlanSlot | ExecutionGapSlot;\nexport interface ExecutionReusePlan {\n readonly target: ExecutionTarget;\n readonly policy: ExecutionPolicyIdentity;\n readonly effectiveOptions: ExecutionReuseEffectiveOptions;\n readonly slots: readonly ExecutionReusePlanSlot[];\n readonly reuse: readonly ReusePlanSlot[];\n readonly gaps: readonly ExecutionGapSlot[];\n}\nexport interface ProjectTargetReusePlanInput {\n readonly reader: RecordReadSession;\n readonly target: ExecutionTarget;\n readonly policy: ProjectTargetPolicy;\n}\nexport type ProjectTargetReusePlanInvalidReason = \"invocation-id-invalid\" | \"target-run-invalid\" | \"target-run-duplicate\" | \"target-slot-invalid\" | \"target-slot-duplicate\" | \"target-slot-run-mismatch\" | \"target-slot-experiment-mismatch\" | \"target-slot-ordinal-duplicate\" | \"policy-unsupported\" | \"policy-input-invalid\";\nexport interface ProjectTargetReusePlanInvalid {\n readonly code: \"project-target-reuse-plan-invalid\";\n readonly reason: ProjectTargetReusePlanInvalidReason;\n}\n/**\n * Fold the terminal Verdict from the source Attempt's immutable Core outcome\n * and its fixed Assertions facts. This is a projection, not a second durable\n * Verdict family.\n */\nexport function recordedAttemptVerdict(input: {\n readonly outcome: AttemptOutcome;\n readonly assertions: AssertionsAttachment;\n}): AssertionsVerdict {\n return foldRecordedAttemptVerdict(input);\n}\n/** Input validation is pure; it never invents a target Slot or repairs an identity. */\nexport function validateProjectTargetReusePlanInput(input: {\n readonly target: ExecutionTarget;\n readonly policy: ProjectTargetPolicy;\n}): ProjectTargetReusePlanInvalid | undefined {\n const unknownInput: unknown = input;\n if (typeof unknownInput !== \"object\" || unknownInput === null) {\n return invalidPlan(\"target-run-invalid\");\n }\n const envelope = unknownInput as {\n readonly target?: unknown;\n readonly policy?: unknown;\n };\n if (typeof envelope.target !== \"object\" || envelope.target === null) {\n return invalidPlan(\"target-run-invalid\");\n }\n const target = envelope.target as {\n readonly invocationId?: unknown;\n readonly runs?: unknown;\n };\n if (typeof target.invocationId !== \"string\"\n || !isBoundedNonEmptyText(target.invocationId, PROJECT_TARGET_INVOCATION_ID_MAXIMUM_LENGTH)\n || !Array.isArray(target.runs)) {\n return invalidPlan(\"invocation-id-invalid\");\n }\n if (typeof envelope.policy !== \"object\" || envelope.policy === null) {\n return invalidPlan(\"policy-input-invalid\");\n }\n const policy = envelope.policy as {\n readonly identity?: unknown;\n readonly reuseContract?: unknown;\n readonly rerun?: unknown;\n readonly keepSandbox?: unknown;\n };\n if (typeof policy.identity !== \"object\"\n || policy.identity === null\n || (policy.identity as {\n readonly name?: unknown;\n }).name !== PROJECT_TARGET_POLICY_NAME\n || (policy.identity as {\n readonly version?: unknown;\n }).version !== PROJECT_TARGET_POLICY_VERSION) {\n return invalidPlan(\"policy-unsupported\");\n }\n if (!isExecutionIdentity(policy.reuseContract)\n || !isRerunOption(policy.rerun)\n || typeof policy.keepSandbox !== \"boolean\") {\n return invalidPlan(\"policy-input-invalid\");\n }\n const runIds = new Set<string>();\n const slotIds = new Set<string>();\n const ordinals = new Set<string>();\n for (const run of target.runs) {\n if (!isTargetRun(run))\n return invalidPlan(\"target-run-invalid\");\n if (runIds.has(run.runId))\n return invalidPlan(\"target-run-duplicate\");\n runIds.add(run.runId);\n for (const slot of run.slots) {\n if (!isTargetSlot(slot))\n return invalidPlan(\"target-slot-invalid\");\n if (slot.runId !== run.runId)\n return invalidPlan(\"target-slot-run-mismatch\");\n if (slot.experimentId !== run.experimentId) {\n return invalidPlan(\"target-slot-experiment-mismatch\");\n }\n if (slotIds.has(slot.slotId))\n return invalidPlan(\"target-slot-duplicate\");\n slotIds.add(slot.slotId);\n const ordinal = sourceKey(slot.experimentId, slot.evalId, String(slot.attempt));\n if (ordinals.has(ordinal))\n return invalidPlan(\"target-slot-ordinal-duplicate\");\n ordinals.add(ordinal);\n }\n }\n return undefined;\n}\n/**\n * Plans only from Record Host selection references. It neither reconstructs\n * attempt handles from strings nor reads private Record paths.\n */\nexport function planProjectTargetReuse(input: ProjectTargetReusePlanInput): Effect.Effect<ExecutionReusePlan, ProjectTargetReusePlanInvalid | RecordReaderReadError> {\n return Effect.suspend<ExecutionReusePlan, ProjectTargetReusePlanInvalid | RecordReaderReadError, never>(() => {\n const invalid = validateProjectTargetReusePlanInput(input);\n if (invalid !== undefined)\n return Effect.fail(invalid);\n return Effect.gen(function* () {\n const selection = yield* input.reader.selectRuns({ includePublishedActive: true });\n const readable = yield* Effect.forEach(selection.runRefs, (ref) => input.reader.readRun(ref), { concurrency: 1 });\n const runs: ReadableRun[] = [];\n const coreIssues: RecordIssue[] = [];\n for (const read of readable) {\n if (read.state === \"available\")\n runs.push(read.value);\n else if (read.state === \"core-invalid\")\n coreIssues.push(...read.issues);\n }\n const byRunId = new Map(runs.map((run) => [run.document.runId, run] as const));\n const slots: ExecutionReusePlanSlot[] = [];\n for (const target of flattenTargetSlots(input.target)) {\n slots.push(yield* planTargetSlot({\n reader: input.reader,\n target,\n policy: input.policy,\n runs,\n byRunId,\n selectionHasProblem: selection.problems.length > 0 || coreIssues.length > 0,\n coreIssues,\n }));\n }\n const reuse = slots.filter((slot): slot is ReusePlanSlot => slot.state === \"reuse\");\n const gaps = slots.filter((slot): slot is ExecutionGapSlot => slot.state === \"gap\");\n return Object.freeze({\n target: input.target,\n policy: projectTargetPolicyIdentity,\n effectiveOptions: effectiveOptions(input.policy),\n slots: Object.freeze(slots),\n reuse: Object.freeze(reuse),\n gaps: Object.freeze(gaps),\n });\n });\n });\n}\n/** Empty or not-yet-created Record roots produce no source capability. */\nexport function planProjectTargetReuseWithoutSources(input: {\n readonly target: ExecutionTarget;\n readonly policy: ProjectTargetPolicy;\n}): Effect.Effect<ExecutionReusePlan, ProjectTargetReusePlanInvalid> {\n return Effect.suspend(() => {\n const invalid = validateProjectTargetReusePlanInput(input);\n if (invalid !== undefined)\n return Effect.fail(invalid);\n const gaps = Object.freeze(flattenTargetSlots(input.target).map((target) => gapSlot(target, {\n reason: target.reuseEligibility ?? \"no-source-run\",\n scope: \"slot\",\n issues: [],\n comparisons: [],\n })));\n return Effect.succeed(Object.freeze({\n target: input.target,\n policy: projectTargetPolicyIdentity,\n effectiveOptions: effectiveOptions(input.policy),\n slots: gaps,\n reuse: Object.freeze([]),\n gaps,\n }));\n });\n}\nexport const ProjectTargetReusePlanner = Object.freeze({ plan: planProjectTargetReuse });\nfunction planTargetSlot(input: {\n readonly reader: RecordReadSession;\n readonly target: TargetSlot;\n readonly policy: ProjectTargetPolicy;\n readonly runs: readonly ReadableRun[];\n readonly byRunId: ReadonlyMap<RunId, ReadableRun>;\n readonly selectionHasProblem: boolean;\n readonly coreIssues: readonly RecordIssue[];\n}): Effect.Effect<ExecutionReusePlanSlot, RecordReaderReadError> {\n return Effect.gen(function* () {\n if (input.target.reuseEligibility !== undefined) {\n return gapSlot(input.target, {\n reason: input.target.reuseEligibility,\n scope: \"slot\",\n issues: [],\n comparisons: [],\n });\n }\n if (input.selectionHasProblem) {\n return gapSlot(input.target, {\n reason: \"source-core-invalid\",\n scope: \"target\",\n issues: input.coreIssues,\n comparisons: [],\n });\n }\n const sourceRun = latestSourceRun(input.runs, input.target);\n if (sourceRun === undefined) {\n return gapSlot(input.target, {\n reason: \"no-source-run\",\n scope: \"slot\",\n issues: [],\n comparisons: [],\n });\n }\n const sourceBarrier = Object.freeze({\n runId: sourceRun.document.runId,\n startedAt: sourceRun.document.startedAt,\n });\n const expected = sourceRun.document.expectedSlots.find((slot) => slot.evalId === input.target.evalId\n && slot.attemptOrdinal === input.target.attempt);\n if (expected === undefined) {\n return gapSlot(input.target, {\n reason: \"source-slot-missing\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n comparisons: [],\n });\n }\n const member = sourceRun.members.find((candidate) => candidate.document.slotId === expected.slotId);\n if (member === undefined || member.attempt === null) {\n return gapSlot(input.target, {\n reason: \"source-member-missing\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n comparisons: [],\n });\n }\n const readAttempt = yield* input.reader.readAttempt(member.attempt);\n if (readAttempt.state !== \"available\") {\n return gapSlot(input.target, {\n reason: \"source-core-invalid\",\n scope: \"slot\",\n issues: issuesOf(readAttempt),\n sourceBarrier,\n comparisons: [],\n });\n }\n if (!hasPublicationIdentity(readAttempt.value)) {\n return gapSlot(input.target, {\n reason: \"source-publication-unavailable\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n comparisons: [],\n });\n }\n const candidateResolution = candidateFor({\n target: input.target,\n sourceBarrier,\n attempt: readAttempt.value,\n byRunId: input.byRunId,\n });\n if (candidateResolution === undefined) {\n return gapSlot(input.target, {\n reason: \"source-core-invalid\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n comparisons: [],\n });\n }\n const candidate = candidateResolution.source;\n const ordinaryIdentity = reusableSlotIdentityMatches({ target: input.target, sourceExpected: expected, originExpected: candidateResolution.originExpected });\n if (!ordinaryIdentity) {\n const originRun = input.byRunId.get(candidate.origin.runId)!;\n const pureRename = targetMatchesLogicalIdentity(input.target, expected) &&\n candidateResolution.originExpected.evalId === input.target.evalId &&\n candidateResolution.originExpected.attemptOrdinal === input.target.attempt &&\n executionDigestForExperiment(input.target, originRun.document.experimentId) === candidateResolution.originExpected.executionIdentityDigest;\n if (!pureRename)\n return gapSlot(input.target, {\n reason: \"identity-mismatch\", scope: \"slot\", issues: [], sourceBarrier, candidate,\n comparisons: [identityMismatchComparison()],\n });\n if (!hasProvenNoExperimentHooks(sourceRun.document.context) ||\n !hasProvenNoExperimentHooks(originRun.document.context))\n return gapSlot(input.target, {\n reason: \"adoption-unproven\", scope: \"slot\", issues: [], sourceBarrier, candidate, comparisons: [],\n });\n const witness = member.bindingRevision === undefined ? undefined : input.runs.find((run) => {\n if (run.document.experimentId !== input.target.experimentId)\n return false;\n const slot = run.document.expectedSlots.find((entry) => targetMatchesLogicalIdentity(input.target, entry));\n if (slot === undefined)\n return false;\n return run.members.some((entry) => entry.document.slotId === slot.slotId && entry.document.action === \"accepted\" &&\n entry.document.attempt !== null && entry.document.attempt.originRunId === candidate.origin.runId &&\n entry.document.attempt.attemptId === candidate.attemptId && entry.bindingRevision !== undefined &&\n entry.bindingRevision <= member.bindingRevision!);\n });\n if (witness === undefined)\n return gapSlot(input.target, {\n reason: \"adoption-unproven\", scope: \"slot\", issues: [], sourceBarrier, candidate, comparisons: [],\n });\n }\n const assertions = yield* input.reader.read(readAttempt.value.owner, NiceEvalRecordAttachments.assertions);\n if (assertions.state !== \"available\") {\n const problem = attachmentProblem(assertions);\n return gapSlot(input.target, {\n reason: problem.reason,\n scope: \"slot\",\n issues: problem.issues,\n sourceBarrier,\n candidate,\n comparisons: [comparison(\"niceeval.assertions\", \"assertion-verdict\", problem.state, \"not-comparable\", problem.reason)],\n });\n }\n const verdict = recordedAttemptVerdict({\n outcome: readAttempt.value.document.outcome,\n assertions: assertions.value,\n });\n if (readAttempt.value.document.outcome !== \"completed\") {\n return gapSlot(input.target, {\n reason: \"attempt-outcome-ineligible\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n candidate,\n comparisons: [\n comparison(\"core\", \"attempt-outcome\", \"available\", \"ineligible\", `attempt-${readAttempt.value.document.outcome}`),\n verdictComparison(verdict, \"ineligible\"),\n ],\n });\n }\n if (verdict !== \"passed\" && verdict !== \"failed\") {\n return gapSlot(input.target, {\n reason: \"verdict-ineligible\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n candidate,\n comparisons: [verdictComparison(verdict, \"ineligible\")],\n });\n }\n if (!ordinaryIdentity && input.target.evaluationKind === \"score\") {\n const score = foldRecordedAttemptScore({ outcome: readAttempt.value.document.outcome, assertions: assertions.value });\n if (Result.isFailure(score) || score.success.state !== \"complete\")\n return gapSlot(input.target, {\n reason: \"verdict-ineligible\", scope: \"slot\", issues: [], sourceBarrier, candidate,\n comparisons: [verdictComparison(verdict, \"ineligible\")],\n });\n }\n const activities = yield* input.reader.read(readAttempt.value.owner, NiceEvalRecordAttachments.runnerActivities.attempt);\n if (activities.state !== \"available\") {\n const problem = attachmentProblem(activities);\n return gapSlot(input.target, {\n reason: problem.reason,\n scope: \"slot\",\n issues: problem.issues,\n sourceBarrier,\n candidate,\n comparisons: [comparison(\"niceeval.runner-activities\", \"execution-duration\", problem.state, \"not-comparable\", problem.reason)],\n });\n }\n const durationRead = readAttemptExecutionDuration(activities.value);\n if (durationRead.state !== \"available\") {\n return gapSlot(input.target, {\n reason: \"source-attachment-unavailable\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n candidate,\n comparisons: [comparison(\"niceeval.runner-activities\", \"execution-duration\", \"unavailable\", \"not-comparable\", durationRead.reason)],\n });\n }\n const duration = durationComparison({\n source: durationRead.duration,\n target: input.target.timeout,\n });\n if (duration.failure !== undefined) {\n return gapSlot(input.target, {\n reason: duration.failure,\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n candidate,\n comparisons: [duration.comparison],\n });\n }\n if (input.policy.rerun === \"all\"\n || (input.policy.rerun === \"failed\" && verdict === \"failed\")) {\n return gapSlot(input.target, {\n reason: \"rerun-requested\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n candidate,\n comparisons: [verdictComparison(verdict, \"match\"), duration.comparison],\n });\n }\n if (input.policy.keepSandbox) {\n return gapSlot(input.target, {\n reason: \"sandbox-retention-requested\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n candidate,\n comparisons: [verdictComparison(verdict, \"match\"), duration.comparison],\n });\n }\n return Object.freeze({\n ...input.target,\n state: \"reuse\" as const,\n adoption: \"carried\" as const,\n source: candidate,\n comparisons: Object.freeze([\n comparison(\"core\", \"execution-identity\", \"available\", \"match\", \"execution-identity-match\"),\n comparison(\"core\", \"attempt-outcome\", \"available\", \"match\", \"attempt-completed\"),\n verdictComparison(verdict, \"match\"),\n duration.comparison,\n ]),\n });\n });\n}\nfunction latestSourceRun(runs: readonly ReadableRun[], target: TargetSlot): ReadableRun | undefined {\n const candidates = runs.filter((run) => run.document.experimentId === target.experimentId\n && run.document.expectedSlots.some((slot) => slot.evalId === target.evalId));\n return candidates.sort((left, right) => {\n const a = left.createdRevision, b = right.createdRevision;\n if (a !== undefined && b !== undefined)\n return a - b || compareCanonicalIdentity(left.document.runId, right.document.runId);\n return compareReadableRuns(left, right);\n }).at(-1);\n}\nfunction compareReadableRuns(left: ReadableRun, right: ReadableRun): number {\n if (left.document.startedAt !== right.document.startedAt) {\n return left.document.startedAt < right.document.startedAt ? -1 : 1;\n }\n return compareCanonicalIdentity(left.document.runId, right.document.runId);\n}\ninterface CandidateResolution {\n readonly source: ExecutionReusePlanSource;\n readonly originExpected: RecordSlotIdentity;\n}\nfunction hasPublicationIdentity(attempt: ReadableAttempt): attempt is ReadableAttempt & {\n readonly ref: ExecutionReusePlanSource[\"attempt\"];\n} {\n return attempt.ref.publicationIdentity !== undefined;\n}\nfunction candidateFor(input: {\n readonly target: TargetSlot;\n readonly sourceBarrier: ExecutionSourceBarrier;\n readonly attempt: ReadableAttempt & {\n readonly ref: ExecutionReusePlanSource[\"attempt\"];\n };\n readonly byRunId: ReadonlyMap<RunId, ReadableRun>;\n}): CandidateResolution | undefined {\n const document = input.attempt.document;\n const originRun = input.byRunId.get(document.originRunId);\n if (originRun === undefined)\n return undefined;\n const originExpected = originRun.document.expectedSlots.find((slot) => slot.slotId === document.slotId);\n if (originExpected === undefined\n || document.evalId !== originExpected.evalId\n || document.executionIdentityDigest !== originExpected.executionIdentityDigest) {\n return undefined;\n }\n return Object.freeze({\n source: Object.freeze({\n attemptId: input.attempt.ref.attemptId,\n attempt: input.attempt.ref,\n origin: Object.freeze({ runId: document.originRunId, slotId: document.slotId }),\n originRun: originRun.ref,\n sourceBarrier: input.sourceBarrier,\n evaluationKind: input.target.evaluationKind,\n }),\n originExpected,\n });\n}\nfunction sameSlotIdentity(left: RecordSlotIdentity, right: RecordSlotIdentity): boolean {\n return left.slotId === right.slotId\n && left.evalId === right.evalId\n && left.attemptOrdinal === right.attemptOrdinal\n && left.executionIdentityDigest === right.executionIdentityDigest;\n}\n/** Slot IDs are exact references within a Run, not cross-Run equivalence keys. */\nfunction targetMatchesLogicalIdentity(target: TargetSlot, slot: RecordSlotIdentity): boolean {\n return target.evalId === slot.evalId\n && target.attempt === slot.attemptOrdinal\n && target.executionIdentityDigest === slot.executionIdentityDigest;\n}\nfunction targetMatchesSlotIdentity(target: TargetSlot, slot: RecordSlotIdentity): boolean {\n return target.slotId === slot.slotId\n && target.evalId === slot.evalId\n && target.attempt === slot.attemptOrdinal\n && target.executionIdentityDigest === slot.executionIdentityDigest;\n}\nfunction reusableSlotIdentityMatches(input: {\n readonly target: TargetSlot;\n readonly sourceExpected: RecordSlotIdentity;\n readonly originExpected: RecordSlotIdentity;\n}): boolean {\n return sameSlotIdentity(input.sourceExpected, input.originExpected)\n && targetMatchesSlotIdentity(input.target, input.sourceExpected)\n && targetMatchesSlotIdentity(input.target, input.originExpected);\n}\nfunction issuesOf(read: RecordCoreRead<unknown>): readonly RecordIssue[] {\n return read.state === \"core-invalid\" ? read.issues : Object.freeze([]);\n}\nfunction attachmentProblem(input: {\n readonly state: \"not-recorded\" | \"migration-required\" | \"unsupported\" | \"invalid\";\n readonly family?: string;\n readonly schemaVersion?: number;\n readonly issues?: readonly RecordIssue[];\n}): {\n readonly reason: Extract<ExecutionGapReason, \"source-attachment-unavailable\" | \"source-attachment-migration-required\" | \"source-attachment-unsupported\" | \"source-attachment-invalid\">;\n readonly state: Exclude<ExecutionComparisonSourceState, \"available\">;\n readonly issues: readonly RecordIssue[];\n} {\n switch (input.state) {\n case \"not-recorded\":\n return Object.freeze({\n reason: \"source-attachment-unavailable\" as const,\n state: \"unavailable\" as const,\n issues: Object.freeze([]),\n });\n case \"migration-required\":\n return Object.freeze({\n reason: \"source-attachment-migration-required\" as const,\n state: EXECUTION_COMPARISON_PROJECTION_STATE.migrationRequired,\n issues: Object.freeze([]),\n });\n case \"unsupported\":\n return Object.freeze({\n reason: \"source-attachment-unsupported\" as const,\n state: \"unsupported\" as const,\n issues: Object.freeze([]),\n });\n case \"invalid\":\n return Object.freeze({\n reason: \"source-attachment-invalid\" as const,\n state: \"invalid\" as const,\n issues: input.issues ?? Object.freeze([]),\n });\n }\n}\nfunction identityMismatchComparison(): ExecutionComparison {\n return comparison(\"core\", \"execution-identity\", \"available\", \"mismatch\", \"identity-mismatch\");\n}\nfunction verdictComparison(verdict: AssertionsVerdict, result: Extract<ExecutionComparisonResult, \"match\" | \"ineligible\">): ExecutionComparison {\n return comparison(\"niceeval.assertions\", \"assertion-verdict\", \"available\", result, verdict === \"errored\" ? \"verdict-ineligible\" : `verdict-${verdict}`);\n}\nfunction durationComparison(input: {\n readonly source: DurationLimit;\n readonly target: ExecutionDurationLimit | undefined;\n}): {\n readonly comparison: ExecutionComparison;\n readonly failure?: \"duration-domain-mismatch\" | \"timeout-exceeded\";\n} {\n if (input.target === undefined) {\n return {\n comparison: comparison(\"niceeval.runner-activities\", \"execution-duration\", \"available\", \"match\", \"timeout-unbounded\"),\n };\n }\n if (input.source.domain !== input.target.domain) {\n return {\n comparison: comparison(\"niceeval.runner-activities\", \"execution-duration\", \"available\", \"mismatch\", \"duration-domain-mismatch\"),\n failure: \"duration-domain-mismatch\",\n };\n }\n if (input.source.milliseconds > input.target.milliseconds) {\n return {\n comparison: comparison(\"niceeval.runner-activities\", \"execution-duration\", \"available\", \"mismatch\", \"timeout-exceeded\"),\n failure: \"timeout-exceeded\",\n };\n }\n return {\n comparison: comparison(\"niceeval.runner-activities\", \"execution-duration\", \"available\", \"match\", \"duration-within-timeout\"),\n };\n}\nfunction comparison(attachment: ExecutionComparisonAttachment, recordedClaim: ExecutionRecordedClaim, sourceState: ExecutionComparisonSourceState, result: ExecutionComparisonResult, reason: string): ExecutionComparison {\n return Object.freeze({ attachment, recordedClaim, sourceState, result, reason });\n}\nfunction gapSlot(target: TargetSlot, input: {\n readonly reason: ExecutionGapReason;\n readonly scope: ExecutionGapScope;\n readonly issues: readonly RecordIssue[];\n readonly comparisons: readonly ExecutionComparison[];\n readonly sourceBarrier?: ExecutionSourceBarrier;\n readonly candidate?: ExecutionReusePlanSource;\n}): ExecutionGapSlot {\n return Object.freeze({\n ...target,\n state: \"gap\" as const,\n reason: input.reason,\n scope: input.scope,\n issues: Object.freeze([...input.issues]),\n ...(input.sourceBarrier === undefined ? {} : { sourceBarrier: input.sourceBarrier }),\n ...(input.candidate === undefined ? {} : { candidate: input.candidate }),\n comparisons: Object.freeze([...input.comparisons]),\n });\n}\nfunction effectiveOptions(policy: ProjectTargetPolicy): ExecutionReuseEffectiveOptions {\n return Object.freeze({\n rerun: policy.rerun,\n keepSandbox: policy.keepSandbox,\n reuseContract: Object.freeze({\n domain: policy.reuseContract.domain,\n value: policy.reuseContract.value,\n }),\n });\n}\nfunction flattenTargetSlots(target: ExecutionTarget): readonly TargetSlot[] {\n return Object.freeze(target.runs.flatMap((run) => run.slots));\n}\nfunction sourceKey(experimentId: string, evalId: string, ordinal?: string): string {\n return ordinal === undefined\n ? `${experimentId}\\u0000${evalId}`\n : `${experimentId}\\u0000${evalId}\\u0000${ordinal}`;\n}\nfunction invalidPlan(reason: ProjectTargetReusePlanInvalidReason): ProjectTargetReusePlanInvalid {\n return Object.freeze({ code: \"project-target-reuse-plan-invalid\", reason });\n}\nfunction isTargetRun(value: unknown): value is TargetRun {\n if (typeof value !== \"object\" || value === null)\n return false;\n const run = value as Partial<TargetRun>;\n return (typeof run.runId === \"string\"\n && isPortableSegment(run.runId)\n && typeof run.experimentId === \"string\"\n && isBoundedRecordIdentity(run.experimentId)\n && typeof run.startedAt === \"number\"\n && isUtcMillis(run.startedAt)\n && Array.isArray(run.slots));\n}\nfunction isTargetSlot(value: unknown): value is TargetSlot {\n if (typeof value !== \"object\" || value === null)\n return false;\n const slot = value as Partial<TargetSlot>;\n return (typeof slot.runId === \"string\"\n && isPortableSegment(slot.runId)\n && typeof slot.slotId === \"string\"\n && isPortableSegment(slot.slotId)\n && typeof slot.experimentId === \"string\"\n && isBoundedRecordIdentity(slot.experimentId)\n && typeof slot.evalId === \"string\"\n && isBoundedRecordIdentity(slot.evalId)\n && typeof slot.attempt === \"number\"\n && Number.isSafeInteger(slot.attempt)\n && slot.attempt >= 0\n && (slot.evaluationKind === \"pass\" || slot.evaluationKind === \"score\")\n && (slot.reuseEligibility === undefined\n || slot.reuseEligibility === \"adapter-behavior-revision-required\")\n && typeof slot.executionIdentityDigest === \"string\"\n && isSha256Digest(slot.executionIdentityDigest)\n && isExecutionIdentity(slot.inputIdentity)\n && isExecutionIdentity(slot.configIdentity)\n && (slot.timeout === undefined || isExecutionDurationLimit(slot.timeout)));\n}\nfunction isBoundedNonEmptyText(value: string, maximumLength: number): boolean {\n return value.length > 0 && value.length <= maximumLength;\n}\nfunction isBoundedRecordIdentity(value: string): boolean {\n return isBoundedNonEmptyText(value, PROJECT_TARGET_RECORD_IDENTITY_MAXIMUM_LENGTH)\n && !value.includes(\"\\u0000\");\n}\nfunction isRerunOption(value: unknown): value is ProjectTargetPolicy[\"rerun\"] {\n return value === \"none\" || value === \"failed\" || value === \"all\";\n}\nfunction isExecutionIdentity(value: unknown): value is ExecutionIdentity {\n if (typeof value !== \"object\" || value === null)\n return false;\n const identity = value as {\n readonly domain?: unknown;\n readonly value?: unknown;\n };\n return typeof identity.domain === \"string\"\n && isBoundedRecordIdentity(identity.domain)\n && typeof identity.value === \"string\"\n && isBoundedRecordIdentity(identity.value);\n}\nfunction isExecutionDurationLimit(value: unknown): value is ExecutionDurationLimit {\n if (typeof value !== \"object\" || value === null)\n return false;\n const duration = value as {\n readonly domain?: unknown;\n readonly milliseconds?: unknown;\n };\n return typeof duration.domain === \"string\"\n && isBoundedRecordIdentity(duration.domain)\n && typeof duration.milliseconds === \"number\"\n && Number.isFinite(duration.milliseconds)\n && duration.milliseconds >= 0;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"reuse-plan.js","sourceRoot":"","sources":["reuse-plan.ts"],"names":[],"mappings":";;;AAwJA,gEAiBC;AA2DD,wDAKC;AAED,kFA2EC;AAOD,wDAmDC;AAED,oFAuBC;AAuCD,0DA+OC;AA/pBD,qCAAqC;AACrC,wDAAwD;AACxD,gFAAgF;AAChF,qEAAqE;AACrE,mCAAgD;AAChD,0DAAoE;AACpE,mEAAkG;AAClG,qDAAmE;AAEnE,sDAAmE;AACnE,6DAAgG;AAGhG,4DAAwE;AACxE,kEAAoI;AACpI,sFAAiK;AACjK,0DAA2F;AAG3F,mEAAkM;AAIrL,QAAA,0BAA0B,GAAG,gBAAyB,CAAC;AACvD,QAAA,6BAA6B,GAAG,CAAU,CAAC;AAC3C,QAAA,2CAA2C,GAAG,GAAY,CAAC;AAC3D,QAAA,6CAA6C,GAAG,IAAa,CAAC;AAK9D,QAAA,2BAA2B,GAA4B,MAAM,CAAC,MAAM,CAAC;IAC9E,IAAI,EAAE,kCAA0B;IAChC,OAAO,EAAE,qCAA6B;CACzC,CAAC,CAAC;AAUH;;;;GAIG;AACU,QAAA,qCAAqC,GAAG,MAAM,CAAC,MAAM,CAAC;IAC/D,iBAAiB,EAAE,oBAA6B;CACnD,CAAC,CAAC;AACU,QAAA,kCAAkC,GAAG;IAC9C,GAAG,mDAAwB;IAC3B,6CAAqC,CAAC,iBAAiB;CACjD,CAAC;AAgGX,6EAA6E;AAC7E,SAAgB,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7D,CAAC;AACD,SAAS,uBAAuB,CAAC,KAAa;IAC1C,OAAO,qBAAqB,CAAC,KAAK,EAAE,qDAA6C,CAAC;WAC3E,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC;AACD,SAAS,aAAa,CAAC,KAAc;IACjC,OAAO,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,KAAK,CAAC;AACrE,CAAC;AACD,SAAS,mBAAmB,CAAC,KAAc;IACvC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAC3C,OAAO,KAAK,CAAC;IACjB,MAAM,QAAQ,GAAG,KAGhB,CAAC;IACF,OAAO,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ;WACnC,uBAAuB,CAAC,QAAQ,CAAC,MAAM,CAAC;WACxC,OAAO,QAAQ,CAAC,KAAK,KAAK,QAAQ;WAClC,uBAAuB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACnD,CAAC;AACD,SAAS,wBAAwB,CAAC,KAAc;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAC3C,OAAO,KAAK,CAAC;IACjB,MAAM,QAAQ,GAAG,KAGhB,CAAC;IACF,OAAO,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ;WACnC,uBAAuB,CAAC,QAAQ,CAAC,MAAM,CAAC;WACxC,OAAO,QAAQ,CAAC,YAAY,KAAK,QAAQ;WACzC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC;WACtC,QAAQ,CAAC,YAAY,IAAI,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// @concord-file ne-runner-reuse-plan\n// @concord-implements docs/feature/experiments/cache.md\n// @concord-implements docs/feature/experiments/use-case/cache-explicit-rerun.md\n// @concord-implements docs/feature/experiments/use-case/rerun-all.md\nimport { Effect, Result, Schema } from \"effect\";\nimport { RecordIntegrityFailure } from \"../record/reader/errors.ts\";\nimport { RunIdSchema, ExperimentIdSchema, UtcMillisSchema } from \"../record/codec/identifiers.ts\";\nimport { RecordSlotIdentitySchema } from \"../record/codec/core.ts\";\nimport type { ReadableRunResource } from \"../run/storage/types.ts\";\nimport { foldRecordedAttemptScore } from \"../eval/record/score.ts\";\nimport { executionDigestForExperiment, hasProvenNoExperimentHooks } from \"./rename-identity.ts\";\nimport type { RecordIssue } from \"../record/errors/record-errors.ts\";\nimport type { AssertionsAttachment, } from \"../record/family/assertions/definition.ts\";\nimport { NiceEvalRecordAttachments } from \"../record/family/catalog.ts\";\nimport { readAttemptExecutionDuration, type DurationLimit, type AttemptExecutionTimingFacts, } from \"../eval/record/eligibility.ts\";\nimport { COMPARISON_SOURCE_STATES, type ComparisonAttachment, type ComparisonResult, type RecordedAttemptClaim, } from \"../eval/record/membership-provenance.ts\";\nimport { foldRecordedAttemptVerdict, type VerdictState, } from \"../eval/record/verdict.ts\";\nimport type { RecordReadSession, ReadableAttempt, ReadableRun, SelectedAttemptRef, SelectedRunRef, } from \"../record/host/types.ts\";\nimport type { RecordCoreRead, RecordAttachmentRead } from \"../record/model/read-state.ts\";\nimport { compareCanonicalIdentity, isPortableSegment, isSha256Digest, isUtcMillis, type ExecutionIdentityDigest, type RunId, type SlotId, type UtcMillis, } from \"../record/model/identifiers.ts\";\nimport type { AttemptOutcome, AttemptDocument, MemberDocument, RunDocument, RecordSlotIdentity } from \"../record/model/core.ts\";\nimport type { RecordReaderReadError } from \"../record/reader/errors.ts\";\nimport type { EvaluationKind } from \"./types.ts\";\nexport const PROJECT_TARGET_POLICY_NAME = \"project-target\" as const;\nexport const PROJECT_TARGET_POLICY_VERSION = 2 as const;\nexport const PROJECT_TARGET_INVOCATION_ID_MAXIMUM_LENGTH = 255 as const;\nexport const PROJECT_TARGET_RECORD_IDENTITY_MAXIMUM_LENGTH = 4096 as const;\nexport interface ExecutionPolicyIdentity {\n readonly name: typeof PROJECT_TARGET_POLICY_NAME;\n readonly version: typeof PROJECT_TARGET_POLICY_VERSION;\n}\nexport const projectTargetPolicyIdentity: ExecutionPolicyIdentity = Object.freeze({\n name: PROJECT_TARGET_POLICY_NAME,\n version: PROJECT_TARGET_POLICY_VERSION,\n});\n/** Current planner input, kept in memory rather than persisted as an Attachment. */\nexport interface ExecutionIdentity {\n readonly domain: string;\n readonly value: string;\n}\nexport interface ExecutionDurationLimit {\n readonly domain: string;\n readonly milliseconds: number;\n}\n/**\n * Reuse compares current execution identity with the immutable Core Slot,\n * folds Core outcome with Assertions, and reads duration from Runner Activity\n * receipts. None of these facts is a separate eligibility/verdict family.\n */\nexport const EXECUTION_COMPARISON_PROJECTION_STATE = Object.freeze({\n migrationRequired: \"migration-required\" as const,\n});\nexport const EXECUTION_COMPARISON_SOURCE_STATES = [\n ...COMPARISON_SOURCE_STATES,\n EXECUTION_COMPARISON_PROJECTION_STATE.migrationRequired,\n] as const;\nexport type ExecutionComparisonAttachment = ComparisonAttachment;\nexport type ExecutionComparisonSourceState = (typeof EXECUTION_COMPARISON_SOURCE_STATES)[number];\nexport type ExecutionComparisonResult = ComparisonResult;\nexport type ExecutionRecordedClaim = RecordedAttemptClaim;\nexport interface ExecutionComparison {\n readonly attachment: ExecutionComparisonAttachment;\n readonly recordedClaim: ExecutionRecordedClaim;\n readonly sourceState: ExecutionComparisonSourceState;\n readonly result: ExecutionComparisonResult;\n readonly reason: string;\n}\nexport type ExecutionGapReason = \"no-source-run\" | \"source-slot-missing\" | \"source-member-missing\" | \"source-core-invalid\" | \"source-publication-unavailable\" | \"source-attachment-unavailable\" | \"source-attachment-migration-required\" | \"source-attachment-unsupported\" | \"source-attachment-invalid\" | \"reuse-contract-domain-mismatch\" | \"reuse-contract-mismatch\" | \"identity-mismatch\" | \"identity-domain-mismatch\" | \"duration-domain-mismatch\" | \"timeout-exceeded\" | \"attempt-outcome-ineligible\" | \"adoption-unproven\" | \"verdict-ineligible\" | \"score-incomplete\" | \"adapter-behavior-revision-required\" | \"rerun-requested\" | \"sandbox-retention-requested\";\nexport type ExecutionGapScope = \"slot\" | \"experiment\" | \"target\";\n/** Origin identity is read from the immutable Attempt, never reconstructed. */\nexport interface ExecutionSourceOrigin {\n readonly runId: RunId;\n readonly slotId: SlotId;\n}\n/** The selected Run boundary may itself be a reference Run. */\nexport interface ExecutionSourceBarrier {\n readonly runId: RunId;\n readonly startedAt: UtcMillis;\n}\nexport interface ExecutionReuseEffectiveOptions {\n readonly rerun: \"none\" | \"failed\" | \"all\";\n readonly keepSandbox: boolean;\n readonly reuseContract: ExecutionIdentity;\n}\nexport interface ExecutionTarget {\n readonly invocationId: string;\n readonly runs: readonly TargetRun[];\n}\nexport interface TargetRun {\n readonly runId: RunId;\n readonly experimentId: string;\n readonly startedAt: UtcMillis;\n readonly slots: readonly TargetSlot[];\n}\n/**\n * `slotId` and `executionIdentityDigest` are deterministic current planning\n * facts. A carried Member can therefore point at the exact immutable origin\n * Attempt without an out-of-band provenance Attachment.\n */\nexport interface TargetSlot {\n readonly renameFingerprint?: (experimentId: string) => string | undefined;\n readonly runId: RunId;\n readonly slotId: SlotId;\n readonly experimentId: string;\n readonly evalId: string;\n readonly attempt: number;\n readonly evaluationKind: EvaluationKind;\n readonly executionIdentityDigest: ExecutionIdentityDigest;\n readonly inputIdentity: ExecutionIdentity;\n readonly configIdentity: ExecutionIdentity;\n readonly timeout?: ExecutionDurationLimit;\n /** Current-only eligibility fact; omitted means behavior identity is reusable. */\n readonly reuseEligibility?: \"adapter-behavior-revision-required\";\n}\n/** Logical current input; evaluating it never allocates durable identities. */\nexport type CurrentTargetSlot = Omit<TargetSlot, \"runId\" | \"slotId\">;\nexport interface CurrentAssessmentRun<Ref> {\n readonly createdRevision?: number;\n readonly lifecycle?: Pick<ReadableRunResource, \"state\" | \"slots\">;\n readonly document: Pick<RunDocument, \"runId\" | \"experimentId\" | \"startedAt\" | \"expectedSlots\"> & {\n readonly context?: RunDocument[\"context\"];\n };\n readonly members: readonly {\n readonly document: MemberDocument;\n readonly bindingRevision?: number;\n readonly attempt: Ref | null;\n }[];\n}\nexport interface CurrentAssessmentSource {\n readonly attemptId: AttemptDocument[\"attemptId\"];\n readonly origin: ExecutionSourceOrigin;\n readonly sourceBarrier: ExecutionSourceBarrier;\n}\nexport type CurrentSlotAssessment<Target extends CurrentTargetSlot, Source extends CurrentAssessmentSource> = Target & ({\n readonly state: \"reuse\";\n readonly adoption: \"carried\";\n readonly source: Source;\n readonly comparisons: readonly ExecutionComparison[];\n} | {\n readonly state: \"gap\";\n readonly reason: ExecutionGapReason;\n readonly scope: ExecutionGapScope;\n readonly issues: readonly RecordIssue[];\n readonly sourceBarrier?: ExecutionSourceBarrier;\n readonly candidate?: Source;\n readonly comparisons: readonly ExecutionComparison[];\n});\nexport interface CurrentAssessmentAttempt {\n readonly document: AttemptDocument;\n readonly publicationAvailable: boolean;\n}\n/** Both consumers retain every expected lifecycle position at one cutoff. */\nexport function mergeCurrentAssessmentRuns<Ref>(runs: readonly CurrentAssessmentRun<Ref>[], resources: readonly ReadableRunResource[]): Effect.Effect<readonly CurrentAssessmentRun<Ref>[], RecordIntegrityFailure> {\n return Effect.map(Effect.forEach(resources, (resource) => {\n const published = runs.find((run) => run.document.runId === resource.runId);\n const lifecycle = Object.freeze({ state: resource.state, slots: resource.slots });\n if (published !== undefined)\n return Effect.succeed(Object.freeze({ ...published, createdRevision: resource.createdRevision, lifecycle }));\n return Schema.decodeUnknownEffect(Schema.Struct({\n runId: RunIdSchema, experimentId: ExperimentIdSchema, startedAt: UtcMillisSchema,\n expectedSlots: Schema.Array(RecordSlotIdentitySchema),\n }))({\n runId: resource.runId, experimentId: resource.experimentId, startedAt: Date.parse(resource.startedAt),\n expectedSlots: resource.slots.map(({ publication: _publication, ...slot }) => slot),\n }).pipe(Effect.map((document): CurrentAssessmentRun<Ref> => Object.freeze({ createdRevision: resource.createdRevision, lifecycle, document, members: Object.freeze([]) })), Effect.mapError(() => new RecordIntegrityFailure({ code: \"record-integrity-failure\", runId: resource.runId, reason: \"core-invalid\" })));\n }, { concurrency: 1 }), (lifecycle) => Object.freeze([\n ...lifecycle,\n ...runs.filter((run) => !resources.some((resource) => resource.runId === run.document.runId)),\n ]));\n}\nexport type AssertionsVerdict = VerdictState;\n/** The exact selection-issued references remain live only while its reader Scope is live. */\nexport interface ExecutionReusePlanSource {\n readonly attemptId: SelectedAttemptRef[\"attemptId\"];\n readonly attempt: SelectedAttemptRef & {\n readonly publicationIdentity: NonNullable<SelectedAttemptRef[\"publicationIdentity\"]>;\n };\n readonly origin: ExecutionSourceOrigin;\n readonly originRun: SelectedRunRef;\n readonly sourceBarrier: ExecutionSourceBarrier;\n readonly evaluationKind: EvaluationKind;\n}\nexport interface ProjectTargetPolicy {\n readonly identity: ExecutionPolicyIdentity;\n readonly reuseContract: ExecutionIdentity;\n readonly rerun: \"none\" | \"failed\" | \"all\";\n readonly keepSandbox: boolean;\n}\nexport interface ExecutionReusePlanSlotBase extends TargetSlot {\n readonly comparisons: readonly ExecutionComparison[];\n}\nexport interface ReusePlanSlot extends ExecutionReusePlanSlotBase {\n readonly state: \"reuse\";\n readonly adoption: \"carried\";\n readonly source: ExecutionReusePlanSource;\n}\nexport interface ExecutionGapSlot extends ExecutionReusePlanSlotBase {\n readonly state: \"gap\";\n readonly reason: ExecutionGapReason;\n readonly scope: ExecutionGapScope;\n readonly issues: readonly RecordIssue[];\n readonly sourceBarrier?: ExecutionSourceBarrier;\n readonly candidate?: ExecutionReusePlanSource;\n}\nexport type ExecutionReusePlanSlot = ReusePlanSlot | ExecutionGapSlot;\nexport interface ExecutionReusePlan {\n readonly target: ExecutionTarget;\n readonly policy: ExecutionPolicyIdentity;\n readonly effectiveOptions: ExecutionReuseEffectiveOptions;\n readonly slots: readonly ExecutionReusePlanSlot[];\n readonly reuse: readonly ReusePlanSlot[];\n readonly gaps: readonly ExecutionGapSlot[];\n}\nexport interface ProjectTargetReusePlanInput {\n readonly reader: RecordReadSession;\n readonly target: ExecutionTarget;\n readonly policy: ProjectTargetPolicy;\n}\nexport type ProjectTargetReusePlanInvalidReason = \"invocation-id-invalid\" | \"target-run-invalid\" | \"target-run-duplicate\" | \"target-slot-invalid\" | \"target-slot-duplicate\" | \"target-slot-run-mismatch\" | \"target-slot-experiment-mismatch\" | \"target-slot-ordinal-duplicate\" | \"policy-unsupported\" | \"policy-input-invalid\";\nexport interface ProjectTargetReusePlanInvalid {\n readonly code: \"project-target-reuse-plan-invalid\";\n readonly reason: ProjectTargetReusePlanInvalidReason;\n}\n/**\n * Fold the terminal Verdict from the source Attempt's immutable Core outcome\n * and its fixed Assertions facts. This is a projection, not a second durable\n * Verdict family.\n */\nexport function recordedAttemptVerdict(input: {\n readonly outcome: AttemptOutcome;\n readonly assertions: AssertionsAttachment;\n}): AssertionsVerdict {\n return foldRecordedAttemptVerdict(input);\n}\n/** Input validation is pure; it never invents a target Slot or repairs an identity. */\nexport function validateProjectTargetReusePlanInput(input: {\n readonly target: ExecutionTarget;\n readonly policy: ProjectTargetPolicy;\n}): ProjectTargetReusePlanInvalid | undefined {\n const unknownInput: unknown = input;\n if (typeof unknownInput !== \"object\" || unknownInput === null) {\n return invalidPlan(\"target-run-invalid\");\n }\n const envelope = unknownInput as {\n readonly target?: unknown;\n readonly policy?: unknown;\n };\n if (typeof envelope.target !== \"object\" || envelope.target === null) {\n return invalidPlan(\"target-run-invalid\");\n }\n const target = envelope.target as {\n readonly invocationId?: unknown;\n readonly runs?: unknown;\n };\n if (typeof target.invocationId !== \"string\"\n || !isBoundedNonEmptyText(target.invocationId, PROJECT_TARGET_INVOCATION_ID_MAXIMUM_LENGTH)\n || !Array.isArray(target.runs)) {\n return invalidPlan(\"invocation-id-invalid\");\n }\n if (typeof envelope.policy !== \"object\" || envelope.policy === null) {\n return invalidPlan(\"policy-input-invalid\");\n }\n const policy = envelope.policy as {\n readonly identity?: unknown;\n readonly reuseContract?: unknown;\n readonly rerun?: unknown;\n readonly keepSandbox?: unknown;\n };\n if (typeof policy.identity !== \"object\"\n || policy.identity === null\n || (policy.identity as {\n readonly name?: unknown;\n }).name !== PROJECT_TARGET_POLICY_NAME\n || (policy.identity as {\n readonly version?: unknown;\n }).version !== PROJECT_TARGET_POLICY_VERSION) {\n return invalidPlan(\"policy-unsupported\");\n }\n if (!isExecutionIdentity(policy.reuseContract)\n || !isRerunOption(policy.rerun)\n || typeof policy.keepSandbox !== \"boolean\") {\n return invalidPlan(\"policy-input-invalid\");\n }\n const runIds = new Set<string>();\n const slotIds = new Set<string>();\n const ordinals = new Set<string>();\n for (const run of target.runs) {\n if (!isTargetRun(run))\n return invalidPlan(\"target-run-invalid\");\n if (runIds.has(run.runId))\n return invalidPlan(\"target-run-duplicate\");\n runIds.add(run.runId);\n for (const slot of run.slots) {\n if (!isTargetSlot(slot))\n return invalidPlan(\"target-slot-invalid\");\n if (slot.runId !== run.runId)\n return invalidPlan(\"target-slot-run-mismatch\");\n if (slot.experimentId !== run.experimentId) {\n return invalidPlan(\"target-slot-experiment-mismatch\");\n }\n if (slotIds.has(slot.slotId))\n return invalidPlan(\"target-slot-duplicate\");\n slotIds.add(slot.slotId);\n const ordinal = sourceKey(slot.experimentId, slot.evalId, String(slot.attempt));\n if (ordinals.has(ordinal))\n return invalidPlan(\"target-slot-ordinal-duplicate\");\n ordinals.add(ordinal);\n }\n }\n return undefined;\n}\n/**\n * Plans only from Record Host selection references. It neither reconstructs\n * attempt handles from strings nor reads private Record paths.\n */\n// @concord-code ne-runner-plan-reuse\n// @concord-implements docs/feature/experiments/cache.md\nexport function planProjectTargetReuse(input: ProjectTargetReusePlanInput): Effect.Effect<ExecutionReusePlan, ProjectTargetReusePlanInvalid | RecordReaderReadError> {\n return Effect.suspend<ExecutionReusePlan, ProjectTargetReusePlanInvalid | RecordReaderReadError, never>(() => {\n const invalid = validateProjectTargetReusePlanInput(input);\n if (invalid !== undefined)\n return Effect.fail(invalid);\n return Effect.gen(function* () {\n const selection = yield* input.reader.selectRuns({ includePublishedActive: true });\n const readable = yield* Effect.forEach(selection.runRefs, (ref) => input.reader.readRun(ref), { concurrency: 1 });\n const publishedRuns: ReadableRun[] = [];\n const coreIssues: RecordIssue[] = [];\n for (const read of readable) {\n if (read.state === \"available\")\n publishedRuns.push(read.value);\n else if (read.state === \"core-invalid\")\n coreIssues.push(...read.issues);\n }\n const resources: ReadableRunResource[] = [];\n let afterRunId = \"\";\n for (;;) {\n const page = yield* input.reader.listRunResources({ afterRunId, pageSize: 100 });\n resources.push(...page.runs);\n if (page.nextAfterRunId === null)\n break;\n afterRunId = page.nextAfterRunId;\n }\n const runs = yield* mergeCurrentAssessmentRuns(publishedRuns, resources);\n const byRunId = new Map(publishedRuns.map((run) => [run.document.runId, run] as const));\n const slots: ExecutionReusePlanSlot[] = [];\n for (const target of flattenTargetSlots(input.target)) {\n slots.push(yield* planTargetSlot({\n reader: input.reader,\n target,\n policy: input.policy,\n runs,\n byRunId,\n selectionHasProblem: selection.problems.length > 0 || coreIssues.length > 0,\n coreIssues,\n }));\n }\n const reuse = slots.filter((slot): slot is ReusePlanSlot => slot.state === \"reuse\");\n const gaps = slots.filter((slot): slot is ExecutionGapSlot => slot.state === \"gap\");\n return Object.freeze({\n target: input.target,\n policy: projectTargetPolicyIdentity,\n effectiveOptions: effectiveOptions(input.policy),\n slots: Object.freeze(slots),\n reuse: Object.freeze(reuse),\n gaps: Object.freeze(gaps),\n });\n });\n });\n}\n/** Empty or not-yet-created Record roots produce no source capability. */\nexport function planProjectTargetReuseWithoutSources(input: {\n readonly target: ExecutionTarget;\n readonly policy: ProjectTargetPolicy;\n}): Effect.Effect<ExecutionReusePlan, ProjectTargetReusePlanInvalid> {\n return Effect.suspend(() => {\n const invalid = validateProjectTargetReusePlanInput(input);\n if (invalid !== undefined)\n return Effect.fail(invalid);\n const gaps = Object.freeze(flattenTargetSlots(input.target).map((target) => gapSlot(target, {\n reason: target.reuseEligibility ?? \"no-source-run\",\n scope: \"slot\",\n issues: [],\n comparisons: [],\n })));\n return Effect.succeed(Object.freeze({\n target: input.target,\n policy: projectTargetPolicyIdentity,\n effectiveOptions: effectiveOptions(input.policy),\n slots: gaps,\n reuse: Object.freeze([]),\n gaps,\n }));\n });\n}\nexport const ProjectTargetReusePlanner = Object.freeze({ plan: planProjectTargetReuse });\nfunction planTargetSlot(input: {\n readonly reader: RecordReadSession;\n readonly target: TargetSlot;\n readonly policy: ProjectTargetPolicy;\n readonly runs: readonly CurrentAssessmentRun<SelectedAttemptRef>[];\n readonly byRunId: ReadonlyMap<RunId, ReadableRun>;\n readonly selectionHasProblem: boolean;\n readonly coreIssues: readonly RecordIssue[];\n}): Effect.Effect<ExecutionReusePlanSlot, RecordReaderReadError> {\n return assessCurrentTargetSlot({\n ...input,\n readAttempt: (ref) => input.reader.readAttempt(ref).pipe(Effect.map((read) => read.state !== \"available\" ? read : {\n state: \"available\" as const,\n value: { ...read.value, publicationAvailable: read.value.ref.publicationIdentity !== undefined },\n })),\n readAssertions: (attempt) => input.reader.read(attempt.owner, NiceEvalRecordAttachments.assertions),\n readActivities: (attempt) => input.reader.read(attempt.owner, NiceEvalRecordAttachments.runnerActivities.attempt),\n sourceFor: (attempt, sourceBarrier) => {\n if (!hasPublicationIdentity(attempt))\n throw new Error(\"Expected a published Attempt\");\n return candidateFor({ target: input.target, sourceBarrier, attempt, byRunId: input.byRunId })!.source;\n },\n });\n}\n/** Both read-only current results and execution planning use this assessment. */\nexport interface CurrentAssessmentInput<Ref, Attempt extends CurrentAssessmentAttempt, Source extends CurrentAssessmentSource, Target extends CurrentTargetSlot, Error> {\n readonly target: Target;\n readonly policy: ProjectTargetPolicy;\n readonly runs: readonly CurrentAssessmentRun<Ref>[];\n readonly byRunId: ReadonlyMap<RunId, CurrentAssessmentRun<Ref>>;\n readonly selectionHasProblem: boolean;\n readonly coreIssues: readonly RecordIssue[];\n readonly readAttempt: (ref: Ref) => Effect.Effect<RecordCoreRead<Attempt>, Error>;\n readonly readAssertions: (attempt: Attempt) => Effect.Effect<RecordAttachmentRead<AssertionsAttachment>, Error>;\n readonly readActivities: (attempt: Attempt) => Effect.Effect<RecordAttachmentRead<AttemptExecutionTimingFacts>, Error>;\n readonly sourceFor: (attempt: Attempt, barrier: ExecutionSourceBarrier) => Source;\n}\nexport function assessCurrentTargetSlot<Ref, Attempt extends CurrentAssessmentAttempt, Source extends CurrentAssessmentSource, Target extends CurrentTargetSlot, Error>(input: CurrentAssessmentInput<Ref, Attempt, Source, Target, Error>): Effect.Effect<CurrentSlotAssessment<Target, Source>, Error> {\n return Effect.gen(function* () {\n if (input.target.reuseEligibility !== undefined) {\n return gapSlot(input.target, {\n reason: input.target.reuseEligibility,\n scope: \"slot\",\n issues: [],\n comparisons: [],\n });\n }\n if (input.selectionHasProblem) {\n return gapSlot(input.target, {\n reason: \"source-core-invalid\",\n scope: \"target\",\n issues: input.coreIssues,\n comparisons: [],\n });\n }\n const sourceRun = latestSourceRun(input.runs, input.target);\n if (sourceRun === undefined) {\n return gapSlot(input.target, {\n reason: \"no-source-run\",\n scope: \"slot\",\n issues: [],\n comparisons: [],\n });\n }\n const sourceBarrier = Object.freeze({\n runId: sourceRun.document.runId,\n startedAt: sourceRun.document.startedAt,\n });\n const expected = sourceRun.document.expectedSlots.find((slot) => slot.evalId === input.target.evalId\n && slot.attemptOrdinal === input.target.attempt);\n if (expected === undefined) {\n return gapSlot(input.target, {\n reason: \"source-slot-missing\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n comparisons: [],\n });\n }\n const member = sourceRun.members.find((candidate) => candidate.document.slotId === expected.slotId);\n if (member === undefined || member.attempt === null) {\n const publication = sourceRun.lifecycle?.slots.find((slot) => slot.slotId === expected.slotId)?.publication;\n return gapSlot(input.target, {\n reason: \"source-member-missing\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n comparisons: publication?.state === \"pending\" || publication?.state === \"absent\"\n ? [comparison(\"core\", \"attempt-outcome\", \"unavailable\", \"not-comparable\", publication.state === \"pending\" ? \"pending\" : publication.reason)]\n : [],\n });\n }\n const readAttempt = yield* input.readAttempt(member.attempt);\n if (readAttempt.state !== \"available\") {\n return gapSlot(input.target, {\n reason: \"source-core-invalid\",\n scope: \"slot\",\n issues: issuesOf(readAttempt),\n sourceBarrier,\n comparisons: [],\n });\n }\n if (!readAttempt.value.publicationAvailable) {\n return gapSlot(input.target, {\n reason: \"source-publication-unavailable\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n comparisons: [],\n });\n }\n const document = readAttempt.value.document;\n const originRun = input.byRunId.get(document.originRunId);\n const originExpected = originRun?.document.expectedSlots.find((slot) => slot.slotId === document.slotId);\n if (originExpected === undefined || document.evalId !== originExpected.evalId || document.executionIdentityDigest !== originExpected.executionIdentityDigest) {\n return gapSlot(input.target, {\n reason: \"source-core-invalid\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n comparisons: [],\n });\n }\n const candidate = input.sourceFor(readAttempt.value, sourceBarrier);\n const ordinaryIdentity = reusableSlotIdentityMatches({ target: input.target, sourceExpected: expected, originExpected });\n if (!ordinaryIdentity) {\n const originRun = input.byRunId.get(candidate.origin.runId)!;\n const pureRename = targetMatchesLogicalIdentity(input.target, expected) &&\n originExpected.evalId === input.target.evalId &&\n originExpected.attemptOrdinal === input.target.attempt &&\n executionDigestForExperiment(input.target, originRun.document.experimentId) === originExpected.executionIdentityDigest;\n if (!pureRename)\n return gapSlot(input.target, {\n reason: \"identity-mismatch\", scope: \"slot\", issues: [], sourceBarrier, candidate,\n comparisons: [identityMismatchComparison()],\n });\n if (sourceRun.document.context === undefined || originRun.document.context === undefined ||\n !hasProvenNoExperimentHooks(sourceRun.document.context) ||\n !hasProvenNoExperimentHooks(originRun.document.context))\n return gapSlot(input.target, {\n reason: \"adoption-unproven\", scope: \"slot\", issues: [], sourceBarrier, candidate, comparisons: [],\n });\n const witness = member.bindingRevision === undefined ? undefined : input.runs.find((run) => {\n if (run.document.experimentId !== input.target.experimentId)\n return false;\n const slot = run.document.expectedSlots.find((entry) => targetMatchesLogicalIdentity(input.target, entry));\n if (slot === undefined)\n return false;\n return run.members.some((entry) => entry.document.slotId === slot.slotId && entry.document.action === \"accepted\" &&\n entry.document.attempt !== null && entry.document.attempt.originRunId === candidate.origin.runId &&\n entry.document.attempt.attemptId === candidate.attemptId && entry.bindingRevision !== undefined &&\n entry.bindingRevision <= member.bindingRevision!);\n });\n if (witness === undefined)\n return gapSlot(input.target, {\n reason: \"adoption-unproven\", scope: \"slot\", issues: [], sourceBarrier, candidate, comparisons: [],\n });\n }\n const assertions = yield* input.readAssertions(readAttempt.value);\n if (assertions.state !== \"available\") {\n const problem = attachmentProblem(assertions);\n return gapSlot(input.target, {\n reason: problem.reason,\n scope: \"slot\",\n issues: problem.issues,\n sourceBarrier,\n candidate,\n comparisons: [comparison(\"niceeval.assertions\", \"assertion-verdict\", problem.state, \"not-comparable\", problem.reason)],\n });\n }\n const verdict = recordedAttemptVerdict({\n outcome: readAttempt.value.document.outcome,\n assertions: assertions.value,\n });\n if (readAttempt.value.document.outcome !== \"completed\") {\n return gapSlot(input.target, {\n reason: \"attempt-outcome-ineligible\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n candidate,\n comparisons: [\n comparison(\"core\", \"attempt-outcome\", \"available\", \"ineligible\", `attempt-${readAttempt.value.document.outcome}`),\n verdictComparison(verdict, \"ineligible\"),\n ],\n });\n }\n if (input.target.evaluationKind === \"score\") {\n const score = foldRecordedAttemptScore({ outcome: readAttempt.value.document.outcome, assertions: assertions.value });\n if (Result.isFailure(score) || score.success.state !== \"complete\")\n return gapSlot(input.target, {\n reason: \"score-incomplete\", scope: \"slot\", issues: [], sourceBarrier, candidate,\n comparisons: [comparison(\"niceeval.assertions\", \"assertion-verdict\", \"available\", \"ineligible\", \"score-incomplete\")],\n });\n }\n if (verdict !== \"passed\" && verdict !== \"failed\") {\n return gapSlot(input.target, {\n reason: \"verdict-ineligible\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n candidate,\n comparisons: [verdictComparison(verdict, \"ineligible\")],\n });\n }\n const activities = yield* input.readActivities(readAttempt.value);\n if (activities.state !== \"available\") {\n const problem = attachmentProblem(activities);\n return gapSlot(input.target, {\n reason: problem.reason,\n scope: \"slot\",\n issues: problem.issues,\n sourceBarrier,\n candidate,\n comparisons: [comparison(\"niceeval.runner-activities\", \"execution-duration\", problem.state, \"not-comparable\", problem.reason)],\n });\n }\n const durationRead = readAttemptExecutionDuration(activities.value);\n if (durationRead.state !== \"available\") {\n return gapSlot(input.target, {\n reason: \"source-attachment-unavailable\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n candidate,\n comparisons: [comparison(\"niceeval.runner-activities\", \"execution-duration\", \"unavailable\", \"not-comparable\", durationRead.reason)],\n });\n }\n const duration = durationComparison({\n source: durationRead.duration,\n target: input.target.timeout,\n });\n if (duration.failure !== undefined) {\n return gapSlot(input.target, {\n reason: duration.failure,\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n candidate,\n comparisons: [duration.comparison],\n });\n }\n if (input.policy.rerun === \"all\"\n || (input.policy.rerun === \"failed\" && verdict === \"failed\")) {\n return gapSlot(input.target, {\n reason: \"rerun-requested\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n candidate,\n comparisons: [verdictComparison(verdict, \"match\"), duration.comparison],\n });\n }\n if (input.policy.keepSandbox) {\n return gapSlot(input.target, {\n reason: \"sandbox-retention-requested\",\n scope: \"slot\",\n issues: [],\n sourceBarrier,\n candidate,\n comparisons: [verdictComparison(verdict, \"match\"), duration.comparison],\n });\n }\n return Object.freeze({\n ...input.target,\n state: \"reuse\" as const,\n adoption: \"carried\" as const,\n source: candidate,\n comparisons: Object.freeze([\n comparison(\"core\", \"execution-identity\", \"available\", \"match\", \"execution-identity-match\"),\n comparison(\"core\", \"attempt-outcome\", \"available\", \"match\", \"attempt-completed\"),\n verdictComparison(verdict, \"match\"),\n duration.comparison,\n ]),\n });\n });\n}\nfunction latestSourceRun<Ref>(runs: readonly CurrentAssessmentRun<Ref>[], target: CurrentTargetSlot): CurrentAssessmentRun<Ref> | undefined {\n const candidates = runs.filter((run) => run.document.experimentId === target.experimentId\n // Execution refreshes may see their own already-created pending Run.\n // Logical current targets have no Run identity and keep every barrier.\n && (!(\"runId\" in target) || run.document.runId !== target.runId)\n && run.document.expectedSlots.some((slot) => slot.evalId === target.evalId && slot.attemptOrdinal === target.attempt));\n return candidates.sort((left, right) => {\n const a = left.createdRevision ?? 0, b = right.createdRevision ?? 0;\n return a - b || compareCanonicalIdentity(left.document.runId, right.document.runId);\n }).at(-1);\n}\ninterface CandidateResolution {\n readonly source: ExecutionReusePlanSource;\n readonly originExpected: RecordSlotIdentity;\n}\nfunction hasPublicationIdentity(attempt: ReadableAttempt): attempt is ReadableAttempt & {\n readonly ref: ExecutionReusePlanSource[\"attempt\"];\n} {\n return attempt.ref.publicationIdentity !== undefined;\n}\nfunction candidateFor(input: {\n readonly target: TargetSlot;\n readonly sourceBarrier: ExecutionSourceBarrier;\n readonly attempt: ReadableAttempt & {\n readonly ref: ExecutionReusePlanSource[\"attempt\"];\n };\n readonly byRunId: ReadonlyMap<RunId, ReadableRun>;\n}): CandidateResolution | undefined {\n const document = input.attempt.document;\n const originRun = input.byRunId.get(document.originRunId);\n if (originRun === undefined)\n return undefined;\n const originExpected = originRun.document.expectedSlots.find((slot) => slot.slotId === document.slotId);\n if (originExpected === undefined\n || document.evalId !== originExpected.evalId\n || document.executionIdentityDigest !== originExpected.executionIdentityDigest) {\n return undefined;\n }\n return Object.freeze({\n source: Object.freeze({\n attemptId: input.attempt.ref.attemptId,\n attempt: input.attempt.ref,\n origin: Object.freeze({ runId: document.originRunId, slotId: document.slotId }),\n originRun: originRun.ref,\n sourceBarrier: input.sourceBarrier,\n evaluationKind: input.target.evaluationKind,\n }),\n originExpected,\n });\n}\nfunction sameSlotIdentity(left: RecordSlotIdentity, right: RecordSlotIdentity): boolean {\n return left.slotId === right.slotId\n && left.evalId === right.evalId\n && left.attemptOrdinal === right.attemptOrdinal\n && left.executionIdentityDigest === right.executionIdentityDigest;\n}\n/** Slot IDs are exact references within a Run, not cross-Run equivalence keys. */\nfunction targetMatchesLogicalIdentity(target: CurrentTargetSlot, slot: RecordSlotIdentity): boolean {\n return target.evalId === slot.evalId\n && target.attempt === slot.attemptOrdinal\n && target.executionIdentityDigest === slot.executionIdentityDigest;\n}\nfunction targetMatchesSlotIdentity(target: CurrentTargetSlot, slot: RecordSlotIdentity): boolean {\n return (!(\"slotId\" in target) || target.slotId === slot.slotId)\n && target.evalId === slot.evalId\n && target.attempt === slot.attemptOrdinal\n && target.executionIdentityDigest === slot.executionIdentityDigest;\n}\nfunction reusableSlotIdentityMatches(input: {\n readonly target: CurrentTargetSlot;\n readonly sourceExpected: RecordSlotIdentity;\n readonly originExpected: RecordSlotIdentity;\n}): boolean {\n return sameSlotIdentity(input.sourceExpected, input.originExpected)\n && targetMatchesSlotIdentity(input.target, input.sourceExpected)\n && targetMatchesSlotIdentity(input.target, input.originExpected);\n}\nfunction issuesOf(read: RecordCoreRead<unknown>): readonly RecordIssue[] {\n return read.state === \"core-invalid\" ? read.issues : Object.freeze([]);\n}\nfunction attachmentProblem(input: {\n readonly state: \"not-recorded\" | \"migration-required\" | \"unsupported\" | \"invalid\";\n readonly family?: string;\n readonly schemaVersion?: number;\n readonly issues?: readonly RecordIssue[];\n}): {\n readonly reason: Extract<ExecutionGapReason, \"source-attachment-unavailable\" | \"source-attachment-migration-required\" | \"source-attachment-unsupported\" | \"source-attachment-invalid\">;\n readonly state: Exclude<ExecutionComparisonSourceState, \"available\">;\n readonly issues: readonly RecordIssue[];\n} {\n switch (input.state) {\n case \"not-recorded\":\n return Object.freeze({\n reason: \"source-attachment-unavailable\" as const,\n state: \"unavailable\" as const,\n issues: Object.freeze([]),\n });\n case \"migration-required\":\n return Object.freeze({\n reason: \"source-attachment-migration-required\" as const,\n state: EXECUTION_COMPARISON_PROJECTION_STATE.migrationRequired,\n issues: Object.freeze([]),\n });\n case \"unsupported\":\n return Object.freeze({\n reason: \"source-attachment-unsupported\" as const,\n state: \"unsupported\" as const,\n issues: Object.freeze([]),\n });\n case \"invalid\":\n return Object.freeze({\n reason: \"source-attachment-invalid\" as const,\n state: \"invalid\" as const,\n issues: input.issues ?? Object.freeze([]),\n });\n }\n}\nfunction identityMismatchComparison(): ExecutionComparison {\n return comparison(\"core\", \"execution-identity\", \"available\", \"mismatch\", \"identity-mismatch\");\n}\nfunction verdictComparison(verdict: AssertionsVerdict, result: Extract<ExecutionComparisonResult, \"match\" | \"ineligible\">): ExecutionComparison {\n return comparison(\"niceeval.assertions\", \"assertion-verdict\", \"available\", result, verdict === \"errored\" ? \"verdict-ineligible\" : `verdict-${verdict}`);\n}\nfunction durationComparison(input: {\n readonly source: DurationLimit;\n readonly target: ExecutionDurationLimit | undefined;\n}): {\n readonly comparison: ExecutionComparison;\n readonly failure?: \"duration-domain-mismatch\" | \"timeout-exceeded\";\n} {\n if (input.target === undefined) {\n return {\n comparison: comparison(\"niceeval.runner-activities\", \"execution-duration\", \"available\", \"match\", \"timeout-unbounded\"),\n };\n }\n if (input.source.domain !== input.target.domain) {\n return {\n comparison: comparison(\"niceeval.runner-activities\", \"execution-duration\", \"available\", \"mismatch\", \"duration-domain-mismatch\"),\n failure: \"duration-domain-mismatch\",\n };\n }\n if (input.source.milliseconds > input.target.milliseconds) {\n return {\n comparison: comparison(\"niceeval.runner-activities\", \"execution-duration\", \"available\", \"mismatch\", \"timeout-exceeded\"),\n failure: \"timeout-exceeded\",\n };\n }\n return {\n comparison: comparison(\"niceeval.runner-activities\", \"execution-duration\", \"available\", \"match\", \"duration-within-timeout\"),\n };\n}\nfunction comparison(attachment: ExecutionComparisonAttachment, recordedClaim: ExecutionRecordedClaim, sourceState: ExecutionComparisonSourceState, result: ExecutionComparisonResult, reason: string): ExecutionComparison {\n return Object.freeze({ attachment, recordedClaim, sourceState, result, reason });\n}\nfunction gapSlot<Target extends CurrentTargetSlot, Source extends CurrentAssessmentSource = ExecutionReusePlanSource>(target: Target, input: {\n readonly reason: ExecutionGapReason;\n readonly scope: ExecutionGapScope;\n readonly issues: readonly RecordIssue[];\n readonly comparisons: readonly ExecutionComparison[];\n readonly sourceBarrier?: ExecutionSourceBarrier;\n readonly candidate?: Source;\n}): Extract<CurrentSlotAssessment<Target, Source>, {\n readonly state: \"gap\";\n}> {\n return Object.freeze({\n ...target,\n state: \"gap\" as const,\n reason: input.reason,\n scope: input.scope,\n issues: Object.freeze([...input.issues]),\n ...(input.sourceBarrier === undefined ? {} : { sourceBarrier: input.sourceBarrier }),\n ...(input.candidate === undefined ? {} : { candidate: input.candidate }),\n comparisons: Object.freeze([...input.comparisons]),\n });\n}\nfunction effectiveOptions(policy: ProjectTargetPolicy): ExecutionReuseEffectiveOptions {\n return Object.freeze({\n rerun: policy.rerun,\n keepSandbox: policy.keepSandbox,\n reuseContract: Object.freeze({\n domain: policy.reuseContract.domain,\n value: policy.reuseContract.value,\n }),\n });\n}\nfunction flattenTargetSlots(target: ExecutionTarget): readonly TargetSlot[] {\n return Object.freeze(target.runs.flatMap((run) => run.slots));\n}\nfunction sourceKey(experimentId: string, evalId: string, ordinal?: string): string {\n return ordinal === undefined\n ? `${experimentId}\\u0000${evalId}`\n : `${experimentId}\\u0000${evalId}\\u0000${ordinal}`;\n}\nfunction invalidPlan(reason: ProjectTargetReusePlanInvalidReason): ProjectTargetReusePlanInvalid {\n return Object.freeze({ code: \"project-target-reuse-plan-invalid\", reason });\n}\nfunction isTargetRun(value: unknown): value is TargetRun {\n if (typeof value !== \"object\" || value === null)\n return false;\n const run = value as Partial<TargetRun>;\n return (typeof run.runId === \"string\"\n && isPortableSegment(run.runId)\n && typeof run.experimentId === \"string\"\n && isBoundedRecordIdentity(run.experimentId)\n && typeof run.startedAt === \"number\"\n && isUtcMillis(run.startedAt)\n && Array.isArray(run.slots));\n}\nfunction isTargetSlot(value: unknown): value is TargetSlot {\n if (typeof value !== \"object\" || value === null)\n return false;\n const slot = value as Partial<TargetSlot>;\n return (typeof slot.runId === \"string\"\n && isPortableSegment(slot.runId)\n && typeof slot.slotId === \"string\"\n && isPortableSegment(slot.slotId)\n && typeof slot.experimentId === \"string\"\n && isBoundedRecordIdentity(slot.experimentId)\n && typeof slot.evalId === \"string\"\n && isBoundedRecordIdentity(slot.evalId)\n && typeof slot.attempt === \"number\"\n && Number.isSafeInteger(slot.attempt)\n && slot.attempt >= 0\n && (slot.evaluationKind === \"pass\" || slot.evaluationKind === \"score\")\n && (slot.reuseEligibility === undefined\n || slot.reuseEligibility === \"adapter-behavior-revision-required\")\n && typeof slot.executionIdentityDigest === \"string\"\n && isSha256Digest(slot.executionIdentityDigest)\n && isExecutionIdentity(slot.inputIdentity)\n && isExecutionIdentity(slot.configIdentity)\n && (slot.timeout === undefined || isExecutionDurationLimit(slot.timeout)));\n}\nfunction isBoundedNonEmptyText(value: string, maximumLength: number): boolean {\n return value.length > 0 && value.length <= maximumLength;\n}\nfunction isBoundedRecordIdentity(value: string): boolean {\n return isBoundedNonEmptyText(value, PROJECT_TARGET_RECORD_IDENTITY_MAXIMUM_LENGTH)\n && !value.includes(\"\\u0000\");\n}\nfunction isRerunOption(value: unknown): value is ProjectTargetPolicy[\"rerun\"] {\n return value === \"none\" || value === \"failed\" || value === \"all\";\n}\nfunction isExecutionIdentity(value: unknown): value is ExecutionIdentity {\n if (typeof value !== \"object\" || value === null)\n return false;\n const identity = value as {\n readonly domain?: unknown;\n readonly value?: unknown;\n };\n return typeof identity.domain === \"string\"\n && isBoundedRecordIdentity(identity.domain)\n && typeof identity.value === \"string\"\n && isBoundedRecordIdentity(identity.value);\n}\nfunction isExecutionDurationLimit(value: unknown): value is ExecutionDurationLimit {\n if (typeof value !== \"object\" || value === null)\n return false;\n const duration = value as {\n readonly domain?: unknown;\n readonly milliseconds?: unknown;\n };\n return typeof duration.domain === \"string\"\n && isBoundedRecordIdentity(duration.domain)\n && typeof duration.milliseconds === \"number\"\n && Number.isFinite(duration.milliseconds)\n && duration.milliseconds >= 0;\n}\n"]}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
+
import { RecordIntegrityFailure } from "../record/reader/errors.cjs";
|
|
3
|
+
import type { ReadableRunResource } from "../run/storage/types.cjs";
|
|
2
4
|
import type { RecordIssue } from "../record/errors/record-errors.cjs";
|
|
3
5
|
import type { AssertionsAttachment } from "../record/family/assertions/definition.cjs";
|
|
6
|
+
import { type AttemptExecutionTimingFacts } from "../eval/record/eligibility.cjs";
|
|
4
7
|
import { type ComparisonAttachment, type ComparisonResult, type RecordedAttemptClaim } from "../eval/record/membership-provenance.cjs";
|
|
5
8
|
import { type VerdictState } from "../eval/record/verdict.cjs";
|
|
6
9
|
import type { RecordReadSession, SelectedAttemptRef, SelectedRunRef } from "../record/host/types.cjs";
|
|
10
|
+
import type { RecordCoreRead, RecordAttachmentRead } from "../record/model/read-state.cjs";
|
|
7
11
|
import { type ExecutionIdentityDigest, type RunId, type SlotId, type UtcMillis } from "../record/model/identifiers.cjs";
|
|
8
|
-
import type { AttemptOutcome } from "../record/model/core.cjs";
|
|
12
|
+
import type { AttemptOutcome, AttemptDocument, MemberDocument, RunDocument } from "../record/model/core.cjs";
|
|
9
13
|
import type { RecordReaderReadError } from "../record/reader/errors.cjs";
|
|
10
14
|
import type { EvaluationKind } from "./types.cjs";
|
|
11
15
|
export declare const PROJECT_TARGET_POLICY_NAME: "project-target";
|
|
12
|
-
export declare const PROJECT_TARGET_POLICY_VERSION:
|
|
16
|
+
export declare const PROJECT_TARGET_POLICY_VERSION: 2;
|
|
13
17
|
export declare const PROJECT_TARGET_INVOCATION_ID_MAXIMUM_LENGTH: 255;
|
|
14
18
|
export declare const PROJECT_TARGET_RECORD_IDENTITY_MAXIMUM_LENGTH: 4096;
|
|
15
19
|
export interface ExecutionPolicyIdentity {
|
|
@@ -46,7 +50,7 @@ export interface ExecutionComparison {
|
|
|
46
50
|
readonly result: ExecutionComparisonResult;
|
|
47
51
|
readonly reason: string;
|
|
48
52
|
}
|
|
49
|
-
export type ExecutionGapReason = "no-source-run" | "source-slot-missing" | "source-member-missing" | "source-core-invalid" | "source-publication-unavailable" | "source-attachment-unavailable" | "source-attachment-migration-required" | "source-attachment-unsupported" | "source-attachment-invalid" | "reuse-contract-domain-mismatch" | "reuse-contract-mismatch" | "identity-mismatch" | "identity-domain-mismatch" | "duration-domain-mismatch" | "timeout-exceeded" | "attempt-outcome-ineligible" | "adoption-unproven" | "verdict-ineligible" | "adapter-behavior-revision-required" | "rerun-requested" | "sandbox-retention-requested";
|
|
53
|
+
export type ExecutionGapReason = "no-source-run" | "source-slot-missing" | "source-member-missing" | "source-core-invalid" | "source-publication-unavailable" | "source-attachment-unavailable" | "source-attachment-migration-required" | "source-attachment-unsupported" | "source-attachment-invalid" | "reuse-contract-domain-mismatch" | "reuse-contract-mismatch" | "identity-mismatch" | "identity-domain-mismatch" | "duration-domain-mismatch" | "timeout-exceeded" | "attempt-outcome-ineligible" | "adoption-unproven" | "verdict-ineligible" | "score-incomplete" | "adapter-behavior-revision-required" | "rerun-requested" | "sandbox-retention-requested";
|
|
50
54
|
export type ExecutionGapScope = "slot" | "experiment" | "target";
|
|
51
55
|
/** Origin identity is read from the immutable Attempt, never reconstructed. */
|
|
52
56
|
export interface ExecutionSourceOrigin {
|
|
@@ -93,6 +97,45 @@ export interface TargetSlot {
|
|
|
93
97
|
/** Current-only eligibility fact; omitted means behavior identity is reusable. */
|
|
94
98
|
readonly reuseEligibility?: "adapter-behavior-revision-required";
|
|
95
99
|
}
|
|
100
|
+
/** Logical current input; evaluating it never allocates durable identities. */
|
|
101
|
+
export type CurrentTargetSlot = Omit<TargetSlot, "runId" | "slotId">;
|
|
102
|
+
export interface CurrentAssessmentRun<Ref> {
|
|
103
|
+
readonly createdRevision?: number;
|
|
104
|
+
readonly lifecycle?: Pick<ReadableRunResource, "state" | "slots">;
|
|
105
|
+
readonly document: Pick<RunDocument, "runId" | "experimentId" | "startedAt" | "expectedSlots"> & {
|
|
106
|
+
readonly context?: RunDocument["context"];
|
|
107
|
+
};
|
|
108
|
+
readonly members: readonly {
|
|
109
|
+
readonly document: MemberDocument;
|
|
110
|
+
readonly bindingRevision?: number;
|
|
111
|
+
readonly attempt: Ref | null;
|
|
112
|
+
}[];
|
|
113
|
+
}
|
|
114
|
+
export interface CurrentAssessmentSource {
|
|
115
|
+
readonly attemptId: AttemptDocument["attemptId"];
|
|
116
|
+
readonly origin: ExecutionSourceOrigin;
|
|
117
|
+
readonly sourceBarrier: ExecutionSourceBarrier;
|
|
118
|
+
}
|
|
119
|
+
export type CurrentSlotAssessment<Target extends CurrentTargetSlot, Source extends CurrentAssessmentSource> = Target & ({
|
|
120
|
+
readonly state: "reuse";
|
|
121
|
+
readonly adoption: "carried";
|
|
122
|
+
readonly source: Source;
|
|
123
|
+
readonly comparisons: readonly ExecutionComparison[];
|
|
124
|
+
} | {
|
|
125
|
+
readonly state: "gap";
|
|
126
|
+
readonly reason: ExecutionGapReason;
|
|
127
|
+
readonly scope: ExecutionGapScope;
|
|
128
|
+
readonly issues: readonly RecordIssue[];
|
|
129
|
+
readonly sourceBarrier?: ExecutionSourceBarrier;
|
|
130
|
+
readonly candidate?: Source;
|
|
131
|
+
readonly comparisons: readonly ExecutionComparison[];
|
|
132
|
+
});
|
|
133
|
+
export interface CurrentAssessmentAttempt {
|
|
134
|
+
readonly document: AttemptDocument;
|
|
135
|
+
readonly publicationAvailable: boolean;
|
|
136
|
+
}
|
|
137
|
+
/** Both consumers retain every expected lifecycle position at one cutoff. */
|
|
138
|
+
export declare function mergeCurrentAssessmentRuns<Ref>(runs: readonly CurrentAssessmentRun<Ref>[], resources: readonly ReadableRunResource[]): Effect.Effect<readonly CurrentAssessmentRun<Ref>[], RecordIntegrityFailure>;
|
|
96
139
|
export type AssertionsVerdict = VerdictState;
|
|
97
140
|
/** The exact selection-issued references remain live only while its reader Scope is live. */
|
|
98
141
|
export interface ExecutionReusePlanSource {
|
|
@@ -173,3 +216,17 @@ export declare function planProjectTargetReuseWithoutSources(input: {
|
|
|
173
216
|
export declare const ProjectTargetReusePlanner: Readonly<{
|
|
174
217
|
plan: typeof planProjectTargetReuse;
|
|
175
218
|
}>;
|
|
219
|
+
/** Both read-only current results and execution planning use this assessment. */
|
|
220
|
+
export interface CurrentAssessmentInput<Ref, Attempt extends CurrentAssessmentAttempt, Source extends CurrentAssessmentSource, Target extends CurrentTargetSlot, Error> {
|
|
221
|
+
readonly target: Target;
|
|
222
|
+
readonly policy: ProjectTargetPolicy;
|
|
223
|
+
readonly runs: readonly CurrentAssessmentRun<Ref>[];
|
|
224
|
+
readonly byRunId: ReadonlyMap<RunId, CurrentAssessmentRun<Ref>>;
|
|
225
|
+
readonly selectionHasProblem: boolean;
|
|
226
|
+
readonly coreIssues: readonly RecordIssue[];
|
|
227
|
+
readonly readAttempt: (ref: Ref) => Effect.Effect<RecordCoreRead<Attempt>, Error>;
|
|
228
|
+
readonly readAssertions: (attempt: Attempt) => Effect.Effect<RecordAttachmentRead<AssertionsAttachment>, Error>;
|
|
229
|
+
readonly readActivities: (attempt: Attempt) => Effect.Effect<RecordAttachmentRead<AttemptExecutionTimingFacts>, Error>;
|
|
230
|
+
readonly sourceFor: (attempt: Attempt, barrier: ExecutionSourceBarrier) => Source;
|
|
231
|
+
}
|
|
232
|
+
export declare function assessCurrentTargetSlot<Ref, Attempt extends CurrentAssessmentAttempt, Source extends CurrentAssessmentSource, Target extends CurrentTargetSlot, Error>(input: CurrentAssessmentInput<Ref, Attempt, Source, Target, Error>): Effect.Effect<CurrentSlotAssessment<Target, Source>, Error>;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
+
import { RecordIntegrityFailure } from "../record/reader/errors.mjs";
|
|
3
|
+
import type { ReadableRunResource } from "../run/storage/types.mjs";
|
|
2
4
|
import type { RecordIssue } from "../record/errors/record-errors.mjs";
|
|
3
5
|
import type { AssertionsAttachment } from "../record/family/assertions/definition.mjs";
|
|
6
|
+
import { type AttemptExecutionTimingFacts } from "../eval/record/eligibility.mjs";
|
|
4
7
|
import { type ComparisonAttachment, type ComparisonResult, type RecordedAttemptClaim } from "../eval/record/membership-provenance.mjs";
|
|
5
8
|
import { type VerdictState } from "../eval/record/verdict.mjs";
|
|
6
9
|
import type { RecordReadSession, SelectedAttemptRef, SelectedRunRef } from "../record/host/types.mjs";
|
|
10
|
+
import type { RecordCoreRead, RecordAttachmentRead } from "../record/model/read-state.mjs";
|
|
7
11
|
import { type ExecutionIdentityDigest, type RunId, type SlotId, type UtcMillis } from "../record/model/identifiers.mjs";
|
|
8
|
-
import type { AttemptOutcome } from "../record/model/core.mjs";
|
|
12
|
+
import type { AttemptOutcome, AttemptDocument, MemberDocument, RunDocument } from "../record/model/core.mjs";
|
|
9
13
|
import type { RecordReaderReadError } from "../record/reader/errors.mjs";
|
|
10
14
|
import type { EvaluationKind } from "./types.mjs";
|
|
11
15
|
export declare const PROJECT_TARGET_POLICY_NAME: "project-target";
|
|
12
|
-
export declare const PROJECT_TARGET_POLICY_VERSION:
|
|
16
|
+
export declare const PROJECT_TARGET_POLICY_VERSION: 2;
|
|
13
17
|
export declare const PROJECT_TARGET_INVOCATION_ID_MAXIMUM_LENGTH: 255;
|
|
14
18
|
export declare const PROJECT_TARGET_RECORD_IDENTITY_MAXIMUM_LENGTH: 4096;
|
|
15
19
|
export interface ExecutionPolicyIdentity {
|
|
@@ -46,7 +50,7 @@ export interface ExecutionComparison {
|
|
|
46
50
|
readonly result: ExecutionComparisonResult;
|
|
47
51
|
readonly reason: string;
|
|
48
52
|
}
|
|
49
|
-
export type ExecutionGapReason = "no-source-run" | "source-slot-missing" | "source-member-missing" | "source-core-invalid" | "source-publication-unavailable" | "source-attachment-unavailable" | "source-attachment-migration-required" | "source-attachment-unsupported" | "source-attachment-invalid" | "reuse-contract-domain-mismatch" | "reuse-contract-mismatch" | "identity-mismatch" | "identity-domain-mismatch" | "duration-domain-mismatch" | "timeout-exceeded" | "attempt-outcome-ineligible" | "adoption-unproven" | "verdict-ineligible" | "adapter-behavior-revision-required" | "rerun-requested" | "sandbox-retention-requested";
|
|
53
|
+
export type ExecutionGapReason = "no-source-run" | "source-slot-missing" | "source-member-missing" | "source-core-invalid" | "source-publication-unavailable" | "source-attachment-unavailable" | "source-attachment-migration-required" | "source-attachment-unsupported" | "source-attachment-invalid" | "reuse-contract-domain-mismatch" | "reuse-contract-mismatch" | "identity-mismatch" | "identity-domain-mismatch" | "duration-domain-mismatch" | "timeout-exceeded" | "attempt-outcome-ineligible" | "adoption-unproven" | "verdict-ineligible" | "score-incomplete" | "adapter-behavior-revision-required" | "rerun-requested" | "sandbox-retention-requested";
|
|
50
54
|
export type ExecutionGapScope = "slot" | "experiment" | "target";
|
|
51
55
|
/** Origin identity is read from the immutable Attempt, never reconstructed. */
|
|
52
56
|
export interface ExecutionSourceOrigin {
|
|
@@ -93,6 +97,45 @@ export interface TargetSlot {
|
|
|
93
97
|
/** Current-only eligibility fact; omitted means behavior identity is reusable. */
|
|
94
98
|
readonly reuseEligibility?: "adapter-behavior-revision-required";
|
|
95
99
|
}
|
|
100
|
+
/** Logical current input; evaluating it never allocates durable identities. */
|
|
101
|
+
export type CurrentTargetSlot = Omit<TargetSlot, "runId" | "slotId">;
|
|
102
|
+
export interface CurrentAssessmentRun<Ref> {
|
|
103
|
+
readonly createdRevision?: number;
|
|
104
|
+
readonly lifecycle?: Pick<ReadableRunResource, "state" | "slots">;
|
|
105
|
+
readonly document: Pick<RunDocument, "runId" | "experimentId" | "startedAt" | "expectedSlots"> & {
|
|
106
|
+
readonly context?: RunDocument["context"];
|
|
107
|
+
};
|
|
108
|
+
readonly members: readonly {
|
|
109
|
+
readonly document: MemberDocument;
|
|
110
|
+
readonly bindingRevision?: number;
|
|
111
|
+
readonly attempt: Ref | null;
|
|
112
|
+
}[];
|
|
113
|
+
}
|
|
114
|
+
export interface CurrentAssessmentSource {
|
|
115
|
+
readonly attemptId: AttemptDocument["attemptId"];
|
|
116
|
+
readonly origin: ExecutionSourceOrigin;
|
|
117
|
+
readonly sourceBarrier: ExecutionSourceBarrier;
|
|
118
|
+
}
|
|
119
|
+
export type CurrentSlotAssessment<Target extends CurrentTargetSlot, Source extends CurrentAssessmentSource> = Target & ({
|
|
120
|
+
readonly state: "reuse";
|
|
121
|
+
readonly adoption: "carried";
|
|
122
|
+
readonly source: Source;
|
|
123
|
+
readonly comparisons: readonly ExecutionComparison[];
|
|
124
|
+
} | {
|
|
125
|
+
readonly state: "gap";
|
|
126
|
+
readonly reason: ExecutionGapReason;
|
|
127
|
+
readonly scope: ExecutionGapScope;
|
|
128
|
+
readonly issues: readonly RecordIssue[];
|
|
129
|
+
readonly sourceBarrier?: ExecutionSourceBarrier;
|
|
130
|
+
readonly candidate?: Source;
|
|
131
|
+
readonly comparisons: readonly ExecutionComparison[];
|
|
132
|
+
});
|
|
133
|
+
export interface CurrentAssessmentAttempt {
|
|
134
|
+
readonly document: AttemptDocument;
|
|
135
|
+
readonly publicationAvailable: boolean;
|
|
136
|
+
}
|
|
137
|
+
/** Both consumers retain every expected lifecycle position at one cutoff. */
|
|
138
|
+
export declare function mergeCurrentAssessmentRuns<Ref>(runs: readonly CurrentAssessmentRun<Ref>[], resources: readonly ReadableRunResource[]): Effect.Effect<readonly CurrentAssessmentRun<Ref>[], RecordIntegrityFailure>;
|
|
96
139
|
export type AssertionsVerdict = VerdictState;
|
|
97
140
|
/** The exact selection-issued references remain live only while its reader Scope is live. */
|
|
98
141
|
export interface ExecutionReusePlanSource {
|
|
@@ -173,3 +216,17 @@ export declare function planProjectTargetReuseWithoutSources(input: {
|
|
|
173
216
|
export declare const ProjectTargetReusePlanner: Readonly<{
|
|
174
217
|
plan: typeof planProjectTargetReuse;
|
|
175
218
|
}>;
|
|
219
|
+
/** Both read-only current results and execution planning use this assessment. */
|
|
220
|
+
export interface CurrentAssessmentInput<Ref, Attempt extends CurrentAssessmentAttempt, Source extends CurrentAssessmentSource, Target extends CurrentTargetSlot, Error> {
|
|
221
|
+
readonly target: Target;
|
|
222
|
+
readonly policy: ProjectTargetPolicy;
|
|
223
|
+
readonly runs: readonly CurrentAssessmentRun<Ref>[];
|
|
224
|
+
readonly byRunId: ReadonlyMap<RunId, CurrentAssessmentRun<Ref>>;
|
|
225
|
+
readonly selectionHasProblem: boolean;
|
|
226
|
+
readonly coreIssues: readonly RecordIssue[];
|
|
227
|
+
readonly readAttempt: (ref: Ref) => Effect.Effect<RecordCoreRead<Attempt>, Error>;
|
|
228
|
+
readonly readAssertions: (attempt: Attempt) => Effect.Effect<RecordAttachmentRead<AssertionsAttachment>, Error>;
|
|
229
|
+
readonly readActivities: (attempt: Attempt) => Effect.Effect<RecordAttachmentRead<AttemptExecutionTimingFacts>, Error>;
|
|
230
|
+
readonly sourceFor: (attempt: Attempt, barrier: ExecutionSourceBarrier) => Source;
|
|
231
|
+
}
|
|
232
|
+
export declare function assessCurrentTargetSlot<Ref, Attempt extends CurrentAssessmentAttempt, Source extends CurrentAssessmentSource, Target extends CurrentTargetSlot, Error>(input: CurrentAssessmentInput<Ref, Attempt, Source, Target, Error>): Effect.Effect<CurrentSlotAssessment<Target, Source>, Error>;
|