niceeval 0.13.3-canary.37 → 0.13.3
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/dist/agents/bub.cjs +4 -4
- package/dist/agents/bub.cjs.map +1 -1
- package/dist/agents/bub.d.cts +2 -2
- package/dist/agents/bub.d.mts +2 -2
- package/dist/agents/bub.d.ts +2 -2
- package/dist/agents/codex-app-server.cjs +2 -3
- package/dist/agents/codex-app-server.cjs.map +1 -1
- package/dist/agents/codex.cjs +4 -4
- package/dist/agents/codex.cjs.map +1 -1
- package/dist/agents/codex.d.cts +3 -3
- package/dist/agents/codex.d.mts +3 -3
- package/dist/agents/codex.d.ts +3 -3
- package/dist/agents/sdk-streams.cjs +11 -4
- package/dist/agents/sdk-streams.cjs.map +1 -1
- package/dist/analysis/bindings.cjs +74 -19
- package/dist/analysis/bindings.cjs.map +1 -1
- package/dist/analysis/bindings.d.cts +534 -156
- package/dist/analysis/bindings.d.mts +534 -156
- package/dist/analysis/bindings.d.ts +534 -156
- package/dist/analysis/domain-view.cjs.map +1 -1
- package/dist/analysis/domain-view.d.cts +137 -8
- package/dist/analysis/domain-view.d.mts +137 -8
- package/dist/analysis/domain-view.d.ts +137 -8
- package/dist/analysis/index.cjs.map +1 -1
- package/dist/analysis/index.d.cts +1 -1
- package/dist/analysis/index.d.mts +1 -1
- package/dist/analysis/index.d.ts +1 -1
- package/dist/assertions/api.cjs.map +1 -1
- package/dist/assertions/api.d.cts +62 -0
- package/dist/assertions/api.d.mts +62 -0
- package/dist/assertions/api.d.ts +62 -0
- package/dist/assertions/judge.cjs +56 -5
- package/dist/assertions/judge.cjs.map +1 -1
- package/dist/assertions/match.cjs +66 -42
- package/dist/assertions/match.cjs.map +1 -1
- package/dist/assertions/match.d.cts +13 -0
- package/dist/assertions/match.d.mts +13 -0
- package/dist/assertions/match.d.ts +13 -0
- package/dist/assertions/record/attachment.cjs +104 -33
- package/dist/assertions/record/attachment.cjs.map +1 -1
- package/dist/assertions/record/attachment.d.cts +294 -57
- package/dist/assertions/record/attachment.d.mts +294 -57
- package/dist/assertions/record/attachment.d.ts +294 -57
- package/dist/assertions/record/codec.cjs +91 -17
- package/dist/assertions/record/codec.cjs.map +1 -1
- package/dist/assertions/record/codec.d.cts +280 -52
- package/dist/assertions/record/codec.d.mts +280 -52
- package/dist/assertions/record/codec.d.ts +280 -52
- package/dist/assertions/record/index.js +2 -0
- package/dist/assertions/record/model.cjs +16 -0
- package/dist/assertions/record/model.cjs.map +1 -1
- package/dist/assertions/record/model.d.cts +120 -13
- package/dist/assertions/record/model.d.mts +120 -13
- package/dist/assertions/record/model.d.ts +120 -13
- package/dist/assertions/record/model.js +2 -0
- package/dist/assertions/record/producer.cjs +70 -50
- package/dist/assertions/record/producer.cjs.map +1 -1
- package/dist/assertions/record/producer.d.cts +8 -7
- package/dist/assertions/record/producer.d.mts +8 -7
- package/dist/assertions/record/producer.d.ts +8 -7
- package/dist/assertions/runtime.cjs +49 -7
- package/dist/assertions/runtime.cjs.map +1 -1
- package/dist/cli/application.cjs +40 -0
- package/dist/cli/application.cjs.map +1 -0
- package/dist/cli/application.d.cts +129 -0
- package/dist/cli/application.d.mts +129 -0
- package/dist/cli/application.d.ts +129 -0
- package/dist/cli/application.js +24 -0
- package/dist/cli/application.js.map +1 -0
- package/dist/cli/bootstrap.cjs +10 -4
- package/dist/cli/bootstrap.cjs.map +1 -1
- package/dist/cli/node-application.cjs +123 -0
- package/dist/cli/node-application.cjs.map +1 -0
- package/dist/cli/node-application.d.cts +14 -0
- package/dist/cli/node-application.d.mts +14 -0
- package/dist/cli/node-application.d.ts +14 -0
- package/dist/cli/node-application.js +26 -0
- package/dist/cli/node-application.js.map +1 -0
- package/dist/cli/program.cjs +2807 -0
- package/dist/cli/program.cjs.map +1 -0
- package/dist/cli/program.d.cts +352 -0
- package/dist/cli/program.d.mts +352 -0
- package/dist/cli/program.d.ts +352 -0
- package/dist/cli/program.js +36 -0
- package/dist/cli/program.js.map +1 -0
- package/dist/cli/project-configuration.cjs +134 -0
- package/dist/cli/project-configuration.cjs.map +1 -0
- package/dist/cli/project-configuration.d.cts +64 -0
- package/dist/cli/project-configuration.d.mts +64 -0
- package/dist/cli/project-configuration.d.ts +64 -0
- package/dist/cli/project-configuration.js +22 -0
- package/dist/cli/project-configuration.js.map +1 -0
- package/dist/cli/record.cjs +20 -4
- package/dist/cli/record.cjs.map +1 -1
- package/dist/cli/record.d.cts +3 -3
- package/dist/cli/record.d.mts +3 -3
- package/dist/cli/record.d.ts +3 -3
- package/dist/cli.cjs +19 -3130
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.d.cts +2 -148
- package/dist/cli.d.mts +2 -148
- package/dist/cli.d.ts +2 -148
- package/dist/cli.js +22 -30
- package/dist/context/assert-first.cjs +20 -15
- package/dist/context/assert-first.cjs.map +1 -1
- package/dist/eval/record/verdict.cjs +3 -2
- package/dist/eval/record/verdict.cjs.map +1 -1
- package/dist/experiment/host/index.cjs +1 -6
- package/dist/experiment/host/index.cjs.map +1 -1
- package/dist/experiment/host/index.d.cts +1 -0
- package/dist/experiment/host/index.d.mts +1 -0
- package/dist/experiment/host/index.d.ts +1 -0
- package/dist/load-config.cjs +13 -4
- package/dist/load-config.cjs.map +1 -1
- package/dist/load-config.d.cts +4 -3
- package/dist/load-config.d.mts +4 -3
- package/dist/load-config.d.ts +4 -3
- package/dist/load-config.js +4 -2
- package/dist/o11y/parsers/codex.cjs +29 -7
- package/dist/o11y/parsers/codex.cjs.map +1 -1
- package/dist/record/codec/core.d.cts +0 -2
- package/dist/record/codec/core.d.mts +0 -2
- package/dist/record/codec/core.d.ts +0 -2
- package/dist/record/codec/identifiers.cjs +2 -3
- package/dist/record/codec/identifiers.cjs.map +1 -1
- package/dist/record/codec/identifiers.d.cts +1 -2
- package/dist/record/codec/identifiers.d.mts +1 -2
- package/dist/record/codec/identifiers.d.ts +1 -2
- package/dist/record/codec/identifiers.js +10 -12
- package/dist/record/codec/index.js +42 -44
- package/dist/record/definition/attachment.cjs +1 -0
- package/dist/record/definition/attachment.cjs.map +1 -1
- package/dist/record/definition/attachment.d.cts +14 -0
- package/dist/record/definition/attachment.d.mts +14 -0
- package/dist/record/definition/attachment.d.ts +14 -0
- package/dist/record/family/assertions-v1.cjs +104 -0
- package/dist/record/family/assertions-v1.cjs.map +1 -0
- package/dist/record/family/assertions-v1.d.cts +2 -0
- package/dist/record/family/assertions-v1.d.mts +2 -0
- package/dist/record/family/assertions-v1.d.ts +2 -0
- package/dist/record/family/assertions-v1.js +6 -0
- package/dist/record/family/assertions-v1.js.map +1 -0
- package/dist/record/family/assertions.cjs +16 -5
- package/dist/record/family/assertions.cjs.map +1 -1
- package/dist/record/family/assertions.d.cts +510 -56
- package/dist/record/family/assertions.d.mts +510 -56
- package/dist/record/family/assertions.d.ts +510 -56
- package/dist/record/family/assertions.js +14 -10
- package/dist/record/family/catalog.cjs +17 -1
- package/dist/record/family/catalog.cjs.map +1 -1
- package/dist/record/family/catalog.d.cts +1292 -104
- package/dist/record/family/catalog.d.mts +1292 -104
- package/dist/record/family/catalog.d.ts +1292 -104
- package/dist/record/family/catalog.js +22 -20
- package/dist/record/family/index.js +144 -138
- package/dist/record/family/observability-v1.cjs +5 -0
- package/dist/record/family/observability-v1.cjs.map +1 -1
- package/dist/record/family/observability.cjs +1 -1
- package/dist/record/family/observability.cjs.map +1 -1
- package/dist/record/host/runtime.cjs +323 -173
- package/dist/record/host/runtime.cjs.map +1 -1
- package/dist/record/host/types.cjs.map +1 -1
- package/dist/record/host/types.d.cts +9 -7
- package/dist/record/host/types.d.mts +9 -7
- package/dist/record/host/types.d.ts +9 -7
- package/dist/record/model/core.cjs.map +1 -1
- package/dist/record/model/core.d.cts +1 -2
- package/dist/record/model/core.d.mts +1 -2
- package/dist/record/model/core.d.ts +1 -2
- package/dist/record/model/definition.cjs +1 -2
- package/dist/record/model/definition.cjs.map +1 -1
- package/dist/record/model/definition.d.cts +1 -7
- package/dist/record/model/definition.d.mts +1 -7
- package/dist/record/model/definition.d.ts +1 -7
- package/dist/record/model/identifiers.cjs +2 -3
- package/dist/record/model/identifiers.cjs.map +1 -1
- package/dist/record/model/identifiers.d.cts +1 -3
- package/dist/record/model/identifiers.d.mts +1 -3
- package/dist/record/model/identifiers.d.ts +1 -3
- package/dist/record/model/identifiers.js +36 -38
- package/dist/record/model/index.js +60 -62
- package/dist/record/platform/node.cjs +17 -7
- package/dist/record/platform/node.cjs.map +1 -1
- package/dist/record/platform/services.cjs.map +1 -1
- package/dist/record/platform/services.d.cts +8 -3
- package/dist/record/platform/services.d.mts +8 -3
- package/dist/record/platform/services.d.ts +8 -3
- package/dist/record/reader/format.cjs +16 -65
- package/dist/record/reader/format.cjs.map +1 -1
- package/dist/record/reader/format.d.cts +5 -9
- package/dist/record/reader/format.d.mts +5 -9
- package/dist/record/reader/format.d.ts +5 -9
- package/dist/record/reader/index.js +10 -8
- package/dist/record/reader/runtime.cjs +63 -32
- package/dist/record/reader/runtime.cjs.map +1 -1
- package/dist/record/reader/runtime.d.cts +40 -4
- package/dist/record/reader/runtime.d.mts +40 -4
- package/dist/record/reader/runtime.d.ts +40 -4
- package/dist/record/reader/runtime.js +6 -4
- package/dist/report/assets/enhance.js +5 -5
- package/dist/report/assets/styles.css +186 -24
- package/dist/report/built-in/result-components.cjs +8 -5
- package/dist/report/built-in/result-components.cjs.map +1 -1
- package/dist/report/built-in/standard.cjs +3 -0
- package/dist/report/built-in/standard.cjs.map +1 -1
- package/dist/report/built-in/standard.d.cts +2 -0
- package/dist/report/built-in/standard.d.mts +2 -0
- package/dist/report/built-in/standard.d.ts +2 -0
- package/dist/report/client-dist/app.js +53 -0
- package/dist/report/components/attempt-detail/compute.cjs +106 -231
- package/dist/report/components/attempt-detail/compute.cjs.map +1 -1
- package/dist/report/components/attempt-detail/compute.d.cts +9 -43
- package/dist/report/components/attempt-detail/compute.d.mts +9 -43
- package/dist/report/components/attempt-detail/compute.d.ts +9 -43
- package/dist/report/components/attempt-detail/compute.js +2 -4
- package/dist/report/components/attempt-detail/content.cjs +3 -4
- package/dist/report/components/attempt-detail/content.cjs.map +1 -1
- package/dist/report/components/attempt-detail/validate.cjs +44 -2
- package/dist/report/components/attempt-detail/validate.cjs.map +1 -1
- package/dist/report/components/entity-lists/compute.cjs +9 -15
- package/dist/report/components/entity-lists/compute.cjs.map +1 -1
- package/dist/report/components/entity-lists/content.cjs +53 -40
- package/dist/report/components/entity-lists/content.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.cjs +1 -3
- package/dist/report/components/entity-lists/index.cjs.map +1 -1
- package/dist/report/components/experiment-detail/compute.cjs +4 -6
- package/dist/report/components/experiment-detail/compute.cjs.map +1 -1
- package/dist/report/definition/cell.cjs +14 -7
- package/dist/report/definition/cell.cjs.map +1 -1
- package/dist/report/definition/cell.d.cts +4 -0
- package/dist/report/definition/cell.d.mts +4 -0
- package/dist/report/definition/cell.d.ts +4 -0
- package/dist/report/definition/primitives/assertion-evidence.cjs +96 -0
- package/dist/report/definition/primitives/assertion-evidence.cjs.map +1 -0
- package/dist/report/definition/primitives/assertion-evidence.d.cts +11 -0
- package/dist/report/definition/primitives/assertion-evidence.d.mts +11 -0
- package/dist/report/definition/primitives/assertion-evidence.d.ts +11 -0
- package/dist/report/definition/primitives/assertion-evidence.js +6 -0
- package/dist/report/definition/primitives/assertion-evidence.js.map +1 -0
- package/dist/report/definition/primitives.cjs +14 -1
- package/dist/report/definition/primitives.cjs.map +1 -1
- package/dist/report/definition/report.cjs +16 -8
- package/dist/report/definition/report.cjs.map +1 -1
- package/dist/report/definition/report.d.cts +6 -0
- package/dist/report/definition/report.d.mts +6 -0
- package/dist/report/definition/report.d.ts +6 -0
- package/dist/report/definition/table-text.cjs +12 -3
- package/dist/report/definition/table-text.cjs.map +1 -1
- package/dist/report/definition/table-text.d.cts +6 -1
- package/dist/report/definition/table-text.d.mts +6 -1
- package/dist/report/definition/table-text.d.ts +6 -1
- package/dist/report/execution/model.cjs +6 -14
- package/dist/report/execution/model.cjs.map +1 -1
- package/dist/report/execution/model.d.cts +5 -10
- package/dist/report/execution/model.d.mts +5 -10
- package/dist/report/execution/model.d.ts +5 -10
- package/dist/report/execution/model.js +6 -6
- package/dist/report/execution/paths.cjs +0 -11
- package/dist/report/execution/paths.cjs.map +1 -1
- package/dist/report/execution/paths.d.cts +0 -1
- package/dist/report/execution/paths.d.mts +0 -1
- package/dist/report/execution/paths.d.ts +0 -1
- package/dist/report/execution/paths.js +6 -8
- package/dist/report/host/execute.cjs +13 -22
- package/dist/report/host/execute.cjs.map +1 -1
- package/dist/report/host/execute.d.cts +1 -4
- package/dist/report/host/execute.d.mts +1 -4
- package/dist/report/host/execute.d.ts +1 -4
- package/dist/report/host/from-record.cjs +3 -0
- package/dist/report/host/from-record.cjs.map +1 -1
- package/dist/report/host/from-record.d.cts +4 -1
- package/dist/report/host/from-record.d.mts +4 -1
- package/dist/report/host/from-record.d.ts +4 -1
- package/dist/report/host/site-assets.cjs +1 -2
- package/dist/report/host/site-assets.cjs.map +1 -1
- package/dist/report/host/site-assets.d.cts +0 -1
- package/dist/report/host/site-assets.d.mts +0 -1
- package/dist/report/host/site-assets.d.ts +0 -1
- package/dist/report/host/site-assets.js +2 -4
- package/dist/report/host/static.cjs +71 -346
- package/dist/report/host/static.cjs.map +1 -1
- package/dist/report/host/static.d.cts +1 -3
- package/dist/report/host/static.d.mts +1 -3
- package/dist/report/host/static.d.ts +1 -3
- package/dist/report/host/static.js +2 -2
- package/dist/report/host/view-session.cjs.map +1 -1
- package/dist/report/host/view-session.d.cts +1 -1
- package/dist/report/host/view-session.d.mts +1 -1
- package/dist/report/host/view-session.d.ts +1 -1
- package/dist/report/model/locale.cjs +1 -1
- package/dist/report/model/locale.cjs.map +1 -1
- package/dist/report/model/locale.d.cts +1 -1
- package/dist/report/model/locale.d.mts +1 -1
- package/dist/report/model/locale.d.ts +1 -1
- package/dist/report/model/pricing.cjs +2 -2
- package/dist/report/model/pricing.cjs.map +1 -1
- package/dist/report/react/enhance.js +5 -5
- package/dist/report/react/styles.css +186 -24
- package/dist/runner/adoption.cjs +4 -7
- package/dist/runner/adoption.cjs.map +1 -1
- package/dist/runner/feedback/failure.cjs +77 -2
- package/dist/runner/feedback/failure.cjs.map +1 -1
- package/dist/runner/feedback/failure.d.cts +2 -1
- package/dist/runner/feedback/failure.d.mts +2 -1
- package/dist/runner/feedback/failure.d.ts +2 -1
- package/dist/runner/project-current.cjs +2 -13
- package/dist/runner/project-current.cjs.map +1 -1
- package/dist/runner/project-current.d.cts +4 -2
- package/dist/runner/project-current.d.mts +4 -2
- package/dist/runner/project-current.d.ts +4 -2
- package/dist/runner/reporters/braintrust.cjs +7 -7
- package/dist/runner/reporters/braintrust.cjs.map +1 -1
- package/dist/runner/reuse-readback.cjs +3 -4
- package/dist/runner/reuse-readback.cjs.map +1 -1
- package/dist/runner/run.cjs +5 -2
- package/dist/runner/run.cjs.map +1 -1
- package/dist/view/server.cjs +2 -37
- package/dist/view/server.cjs.map +1 -1
- package/dist/view/server.d.cts +0 -3
- package/dist/view/server.d.mts +0 -3
- package/dist/view/server.d.ts +0 -3
- package/docs-site/zh/reference/builtin-agents.mdx +7 -7
- package/docs-site/zh/reference/official-adapters.mdx +4 -4
- package/docs-site/zh/reference/report-components.mdx +2 -2
- package/docs-site/zh/tutorials/configuration.mdx +2 -2
- package/docs-site/zh/tutorials/deploy-report-site.mdx +24 -2
- package/docs-site/zh/tutorials/publish-report.mdx +4 -4
- package/docs-site/zh/tutorials/sandbox-agent.mdx +5 -5
- package/docs-site/zh/tutorials/theming.mdx +2 -2
- package/package.json +4 -6
- package/dist/record/migration/index.cjs +0 -5
- package/dist/record/migration/index.cjs.map +0 -1
- package/dist/record/migration/index.d.cts +0 -11
- package/dist/record/migration/index.d.mts +0 -11
- package/dist/record/migration/index.d.ts +0 -11
- package/dist/record/migration/index.js +0 -6
- package/dist/record/migration/index.js.map +0 -1
- package/dist/report/host/site-runtime.cjs +0 -92
- package/dist/report/host/site-runtime.cjs.map +0 -1
- package/dist/report/host/site-runtime.d.cts +0 -9
- package/dist/report/host/site-runtime.d.mts +0 -9
- package/dist/report/host/site-runtime.d.ts +0 -9
- package/dist/report/host/site-runtime.js +0 -10
- package/dist/report/host/site-runtime.js.map +0 -1
- package/dist/view/client-dist/app.css +0 -2
- package/dist/view/client-dist/app.js +0 -49
- package/dist/view/data.cjs +0 -3
- package/dist/view/data.cjs.map +0 -1
- package/dist/view/data.d.cts +0 -9
- package/dist/view/data.d.mts +0 -9
- package/dist/view/data.d.ts +0 -9
- package/dist/view/data.js +0 -4
- package/dist/view/data.js.map +0 -1
- package/dist/view/index.cjs +0 -24
- package/dist/view/index.cjs.map +0 -1
- package/dist/view/index.d.cts +0 -9
- package/dist/view/index.d.mts +0 -9
- package/dist/view/index.d.ts +0 -9
- package/dist/view/index.js +0 -28
- package/dist/view/index.js.map +0 -1
- package/dist/view/report-view-cache.cjs +0 -200
- package/dist/view/report-view-cache.cjs.map +0 -1
- package/dist/view/report-view-cache.d.cts +0 -67
- package/dist/view/report-view-cache.d.mts +0 -67
- package/dist/view/report-view-cache.d.ts +0 -67
- package/dist/view/report-view-cache.js +0 -8
- package/dist/view/report-view-cache.js.map +0 -1
- package/dist/view/shared/types.cjs +0 -3
- package/dist/view/shared/types.cjs.map +0 -1
- package/dist/view/shared/types.d.cts +0 -51
- package/dist/view/shared/types.d.mts +0 -51
- package/dist/view/shared/types.d.ts +0 -51
- package/dist/view/shared/types.js +0 -4
- package/dist/view/shared/types.js.map +0 -1
- package/dist/view/site.cjs +0 -32
- package/dist/view/site.cjs.map +0 -1
- package/dist/view/site.d.cts +0 -24
- package/dist/view/site.d.mts +0 -24
- package/dist/view/site.d.ts +0 -24
- package/dist/view/site.js +0 -8
- package/dist/view/site.js.map +0 -1
- package/dist/view/styles.css +0 -170
- package/dist/view/template.html +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reuse-readback.js","sourceRoot":"","sources":["reuse-readback.ts"],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AAM,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC;YACzC,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,SAAS;SAC5C,CAAC;QACF,cAAc,EAAE,MAAM,CAAC,cAAc;KACxC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { Effect, Either } from \"effect\";\nimport { encodeAttemptLocator } from \"../attempt-locator.ts\";\nimport type { RecordIssue } from \"../record/errors/record-errors.ts\";\nimport type { FixedFamilyRead, ReadableAttempt, RecordReadSession, SelectedAttemptRef, } from \"../record/host/types.ts\";\nimport type { RecordReaderReadError } from \"../record/reader/errors.ts\";\nimport { projectSourcesAttachment } from \"../sources/projector.ts\";\nimport type { Verdict } from \"../shared/types.ts\";\nimport { recordedAttemptVerdict, type ExecutionReusePlan, type ExecutionReusePlanSource, type ReusePlanSlot, type TargetSlot, } from \"./reuse-plan.ts\";\n/** Fixed-family read states remain visible; a readback never invents a result file. */\nexport type CurrentRecordRead<Value> = {\n readonly state: \"available\";\n readonly value: Value;\n} | {\n readonly state: \"not-recorded\";\n} | {\n readonly state: \"migration-required\";\n readonly family: string;\n readonly fromSchemaVersion: number;\n readonly toSchemaVersion: number;\n readonly command: \"niceeval migrate\";\n} | {\n readonly state: \"unsupported\";\n readonly family: string;\n readonly schemaVersion: number;\n} | {\n readonly state: \"invalid\";\n readonly issues: readonly RecordIssue[];\n};\nexport interface CurrentReusedAttemptReadback {\n readonly state: \"reused\";\n readonly target: CurrentReusedAttemptTarget;\n readonly source: CurrentReusedAttemptSource;\n readonly verdict: \"passed\" | \"failed\";\n readonly score: CurrentReusedAttemptScore;\n readonly executionErrors: CurrentRecordRead<readonly CurrentReusedExecutionError[]>;\n}\nexport interface CurrentReuseCandidateReadback {\n readonly state: \"prior\";\n readonly target: CurrentReusedAttemptTarget;\n readonly source: CurrentReusedAttemptSource;\n readonly verdict: CurrentRecordRead<Verdict>;\n readonly score: CurrentReusedAttemptScore;\n readonly executionErrors: CurrentRecordRead<readonly CurrentReusedExecutionError[]>;\n readonly sourceFiles: CurrentReuseSourceFiles;\n}\nexport type CurrentReuseReadback = CurrentReusedAttemptReadback | CurrentReuseCandidateReadback;\nexport interface CurrentReusedAttemptTarget {\n readonly runId: TargetSlot[\"runId\"];\n readonly slotId: TargetSlot[\"slotId\"];\n readonly experimentId: TargetSlot[\"experimentId\"];\n readonly evalId: TargetSlot[\"evalId\"];\n readonly attempt: TargetSlot[\"attempt\"];\n}\nexport interface CurrentReusedAttemptSource {\n readonly attempt: SelectedAttemptRef;\n readonly attemptId: ExecutionReusePlanSource[\"attemptId\"];\n readonly origin: ExecutionReusePlanSource[\"origin\"];\n readonly sourceBarrier: ExecutionReusePlanSource[\"sourceBarrier\"];\n readonly evaluationKind: ExecutionReusePlanSource[\"evaluationKind\"];\n}\nexport type CurrentReusedAttemptScore = {\n readonly state: \"not-applicable\";\n} | {\n readonly state: \"applicable\";\n readonly attachment: CurrentRecordRead<{\n readonly state: \"complete\" | \"partial\" | \"unavailable\";\n readonly earned?: number;\n }>;\n};\nexport interface CurrentReusedExecutionCause {\n readonly code: string;\n readonly summary: string;\n}\nexport interface CurrentReusedExecutionError {\n readonly kind: \"execution-error\";\n readonly code: string;\n readonly phase: string;\n readonly summary: string;\n readonly causes: readonly CurrentReusedExecutionCause[];\n}\nexport interface CurrentReuseSourceFile {\n readonly path: string;\n readonly sha256: string;\n}\nexport type CurrentReuseSourceFiles = CurrentRecordRead<readonly CurrentReuseSourceFile[]> | {\n readonly state: \"origin-run-missing\";\n} | {\n readonly state: \"origin-run-invalid\";\n readonly issues: readonly RecordIssue[];\n} | {\n readonly state: \"projection-invalid\";\n};\nexport interface CurrentReuseReadbackPlanInvalid {\n readonly code: \"current-reuse-readback-plan-invalid\";\n readonly reason: \"source-attempt-unavailable\" | \"source-verdict-unavailable\" | \"source-verdict-ineligible\";\n}\nexport interface CurrentReusedAttemptSourceSnapshot {\n readonly attemptId: string;\n readonly locator: string;\n readonly origin: {\n readonly runId: string;\n readonly slotId: string;\n };\n readonly sourceBarrier: {\n readonly runId: string;\n readonly startedAt: number;\n };\n readonly evaluationKind: CurrentReusedAttemptSource[\"evaluationKind\"];\n}\nexport interface CurrentReusedAttemptTargetSnapshot {\n readonly runId: string;\n readonly slotId: string;\n readonly experimentId: string;\n readonly evalId: string;\n readonly attempt: number;\n}\nexport interface CurrentReusedAttemptSnapshot {\n readonly state: \"reused\";\n readonly target: CurrentReusedAttemptTargetSnapshot;\n readonly source: CurrentReusedAttemptSourceSnapshot;\n readonly verdict: CurrentReusedAttemptReadback[\"verdict\"];\n readonly score: CurrentReusedAttemptScore;\n readonly executionErrors: CurrentReusedAttemptReadback[\"executionErrors\"];\n}\nexport interface CurrentReuseCandidateSnapshot {\n readonly state: \"prior\";\n readonly target: CurrentReusedAttemptTargetSnapshot;\n readonly source: CurrentReusedAttemptSourceSnapshot;\n readonly verdict: CurrentReuseCandidateReadback[\"verdict\"];\n readonly score: CurrentReusedAttemptScore;\n readonly executionErrors: CurrentReusedAttemptReadback[\"executionErrors\"];\n readonly sourceFiles: CurrentReuseSourceFiles;\n}\nexport type CurrentReuseReadbackSnapshot = CurrentReusedAttemptSnapshot | CurrentReuseCandidateSnapshot;\nfunction recordRead<Value>(value: FixedFamilyRead<Value>): CurrentRecordRead<Value> {\n switch (value.state) {\n case \"available\":\n return Object.freeze({ state: \"available\" as const, value: value.value as Value });\n case \"not-recorded\":\n return Object.freeze({ state: \"not-recorded\" as const });\n case \"unsupported\":\n return Object.freeze({\n state: \"unsupported\" as const,\n family: value.family,\n schemaVersion: value.schemaVersion,\n });\n case \"migration-required\":\n return Object.freeze({\n state: \"migration-required\" as const,\n family: value.family,\n fromSchemaVersion: value.fromSchemaVersion,\n toSchemaVersion: value.toSchemaVersion,\n command: value.command,\n });\n case \"invalid\":\n return Object.freeze({ state: \"invalid\" as const, issues: Object.freeze([...value.issues]) });\n }\n}\nfunction nonAvailableRead<Value>(value: Exclude<FixedFamilyRead<unknown>, {\n readonly state: \"available\";\n}>): CurrentRecordRead<Value> {\n switch (value.state) {\n case \"not-recorded\":\n return Object.freeze({ state: \"not-recorded\" as const });\n case \"unsupported\":\n return Object.freeze({\n state: \"unsupported\" as const,\n family: value.family,\n schemaVersion: value.schemaVersion,\n });\n case \"migration-required\":\n return Object.freeze({\n state: \"migration-required\" as const,\n family: value.family,\n fromSchemaVersion: value.fromSchemaVersion,\n toSchemaVersion: value.toSchemaVersion,\n command: value.command,\n });\n case \"invalid\":\n return Object.freeze({ state: \"invalid\" as const, issues: Object.freeze([...value.issues]) });\n }\n}\nfunction invalid(reason: CurrentReuseReadbackPlanInvalid[\"reason\"]): CurrentReuseReadbackPlanInvalid {\n return Object.freeze({ code: \"current-reuse-readback-plan-invalid\", reason });\n}\nfunction readSourceAttempt(input: {\n readonly reader: RecordReadSession;\n readonly source: ExecutionReusePlanSource;\n}): Effect.Effect<ReadableAttempt, RecordReaderReadError | CurrentReuseReadbackPlanInvalid> {\n return input.reader.readAttempt(input.source.attempt).pipe(Effect.flatMap((read) => read.state === \"available\"\n ? Effect.succeed(read.value)\n : Effect.fail(invalid(\"source-attempt-unavailable\"))));\n}\nfunction scoreOf(entries: readonly {\n readonly result: {\n readonly score: unknown;\n };\n}[]): {\n readonly state: \"complete\" | \"partial\" | \"unavailable\";\n readonly earned?: number;\n} {\n let earned = 0;\n let unavailable = false;\n for (const entry of entries) {\n const score = entry.result.score as {\n readonly state?: unknown;\n readonly earned?: unknown;\n };\n if (score.state === \"earned\" && typeof score.earned === \"number\")\n earned += score.earned;\n if (score.state === \"unavailable\")\n unavailable = true;\n }\n return unavailable\n ? Object.freeze({ state: earned > 0 ? \"partial\" as const : \"unavailable\" as const, ...(earned > 0 ? { earned } : {}) })\n : Object.freeze({ state: \"complete\" as const, earned });\n}\nfunction detailsFor(input: {\n readonly reader: RecordReadSession;\n readonly attempt: ReadableAttempt;\n readonly evaluationKind: ExecutionReusePlanSource[\"evaluationKind\"];\n}): Effect.Effect<{\n readonly assertions: CurrentRecordRead<Verdict>;\n readonly score: CurrentReusedAttemptScore;\n readonly executionErrors: CurrentRecordRead<readonly CurrentReusedExecutionError[]>;\n}, RecordReaderReadError> {\n return Effect.gen(function* () {\n const assertions = yield* input.reader.readAssertions(input.attempt.owner);\n const assertionRead: CurrentRecordRead<Verdict> = assertions.state === \"available\"\n ? Object.freeze({\n state: \"available\" as const,\n value: recordedAttemptVerdict({\n outcome: input.attempt.document.outcome,\n assertions: assertions.value,\n }) as Verdict,\n })\n : nonAvailableRead(assertions);\n const observability = yield* input.reader.readAttemptObservability(input.attempt.owner);\n const executionErrors: CurrentRecordRead<readonly CurrentReusedExecutionError[]> = observability.state === \"available\"\n ? Object.freeze({\n state: \"available\" as const,\n value: Object.freeze(observability.value.diagnostics.diagnostics\n .filter((diagnostic) => diagnostic.kind === \"execution-error\")\n .map((diagnostic) => Object.freeze({\n kind: \"execution-error\" as const,\n code: diagnostic.code,\n phase: diagnostic.phase,\n summary: diagnostic.summary,\n causes: Object.freeze(diagnostic.causes.map((cause) => Object.freeze({\n code: cause.code,\n summary: cause.summary,\n }))),\n }))),\n })\n : nonAvailableRead(observability);\n const scoreAttachment: CurrentRecordRead<{\n readonly state: \"complete\" | \"partial\" | \"unavailable\";\n readonly earned?: number;\n }> = assertions.state === \"available\"\n ? Object.freeze({ state: \"available\" as const, value: scoreOf(assertions.value.entries) })\n : nonAvailableRead(assertions);\n const score: CurrentReusedAttemptScore = input.evaluationKind === \"score\"\n ? Object.freeze({ state: \"applicable\" as const, attachment: scoreAttachment })\n : Object.freeze({ state: \"not-applicable\" as const });\n return Object.freeze({ assertions: assertionRead, score, executionErrors });\n });\n}\nexport function readCurrentReusedAttempt(input: {\n readonly reader: RecordReadSession;\n readonly slot: ReusePlanSlot;\n}): Effect.Effect<CurrentReusedAttemptReadback, RecordReaderReadError | CurrentReuseReadbackPlanInvalid> {\n return Effect.gen(function* () {\n const attempt = yield* readSourceAttempt({ reader: input.reader, source: input.slot.source });\n const details = yield* detailsFor({\n reader: input.reader,\n attempt,\n evaluationKind: input.slot.source.evaluationKind,\n });\n if (details.assertions.state !== \"available\") {\n return yield* Effect.fail(invalid(\"source-verdict-unavailable\"));\n }\n if (details.assertions.value !== \"passed\" && details.assertions.value !== \"failed\") {\n return yield* Effect.fail(invalid(\"source-verdict-ineligible\"));\n }\n return Object.freeze({\n state: \"reused\" as const,\n target: targetOf(input.slot),\n source: sourceOf(input.slot.source),\n verdict: details.assertions.value,\n score: details.score,\n executionErrors: details.executionErrors,\n });\n });\n}\nexport function readCurrentReuseCandidate(input: {\n readonly reader: RecordReadSession;\n readonly slot: Extract<ExecutionReusePlan[\"slots\"][number], {\n readonly state: \"gap\";\n }>;\n}): Effect.Effect<CurrentReuseCandidateReadback | undefined, RecordReaderReadError | CurrentReuseReadbackPlanInvalid> {\n return Effect.suspend(() => {\n const source = input.slot.candidate;\n if (source === undefined)\n return Effect.succeed(undefined);\n return Effect.gen(function* () {\n const attempt = yield* readSourceAttempt({ reader: input.reader, source });\n const details = yield* detailsFor({ reader: input.reader, attempt, evaluationKind: source.evaluationKind });\n const sourceFiles = yield* readCurrentReuseSourceFiles({ reader: input.reader, source });\n return Object.freeze({\n state: \"prior\" as const,\n target: targetOf(input.slot),\n source: sourceOf(source),\n verdict: details.assertions,\n score: details.score,\n executionErrors: details.executionErrors,\n sourceFiles,\n });\n });\n });\n}\nexport function readCurrentExecutionReusePlanReadbacks(input: {\n readonly reader: RecordReadSession;\n readonly plan: ExecutionReusePlan;\n}): Effect.Effect<readonly CurrentReuseReadback[], RecordReaderReadError | CurrentReuseReadbackPlanInvalid> {\n return Effect.forEach(input.plan.slots, (slot) => slot.state === \"reuse\"\n ? readCurrentReusedAttempt({ reader: input.reader, slot }).pipe(Effect.map((value): CurrentReuseReadback | undefined => value))\n : readCurrentReuseCandidate({ reader: input.reader, slot }), { concurrency: 1 }).pipe(Effect.map((values) => Object.freeze(values.flatMap((value) => value === undefined ? [] : [value]))));\n}\nexport function readCurrentExecutionReusePlanResults(input: {\n readonly reader: RecordReadSession;\n readonly plan: ExecutionReusePlan;\n}): Effect.Effect<readonly CurrentReusedAttemptReadback[], RecordReaderReadError | CurrentReuseReadbackPlanInvalid> {\n return Effect.forEach(input.plan.reuse, (slot) => readCurrentReusedAttempt({ reader: input.reader, slot }), { concurrency: 1 }).pipe(Effect.map((values) => Object.freeze(values)));\n}\nfunction readCurrentReuseSourceFiles(input: {\n readonly reader: RecordReadSession;\n readonly source: ExecutionReusePlanSource;\n}): Effect.Effect<CurrentReuseSourceFiles, RecordReaderReadError> {\n return Effect.gen(function* () {\n const origin = yield* input.reader.readRun(input.source.originRun);\n if (origin.state === \"missing\")\n return Object.freeze({ state: \"origin-run-missing\" as const });\n if (origin.state === \"core-invalid\") {\n return Object.freeze({ state: \"origin-run-invalid\" as const, issues: Object.freeze([...origin.issues]) });\n }\n const sources = yield* input.reader.readSources(origin.value.owner);\n if (sources.state !== \"available\")\n return nonAvailableRead(sources);\n const projection = projectSourcesAttachment(sources.value, sources.blobs);\n if (Either.isLeft(projection))\n return Object.freeze({ state: \"projection-invalid\" as const });\n return Object.freeze({\n state: \"available\" as const,\n value: Object.freeze(projection.right.items.map((item) => Object.freeze({\n path: item.path,\n sha256: item.sha256,\n }))),\n });\n });\n}\nexport function projectCurrentReuseReadback(readback: CurrentReuseReadback): CurrentReuseReadbackSnapshot {\n return readback.state === \"reused\"\n ? projectCurrentReusedAttemptReadback(readback)\n : projectCurrentReuseCandidateReadback(readback);\n}\nexport function projectCurrentReusedAttemptReadback(readback: CurrentReusedAttemptReadback): CurrentReusedAttemptSnapshot {\n return Object.freeze({\n state: \"reused\" as const,\n target: targetSnapshotOf(readback.target),\n source: sourceSnapshotOf(readback.source),\n verdict: readback.verdict,\n score: readback.score,\n executionErrors: readback.executionErrors,\n });\n}\nexport function projectCurrentReuseCandidateReadback(readback: CurrentReuseCandidateReadback): CurrentReuseCandidateSnapshot {\n return Object.freeze({\n state: \"prior\" as const,\n target: targetSnapshotOf(readback.target),\n source: sourceSnapshotOf(readback.source),\n verdict: readback.verdict,\n score: readback.score,\n executionErrors: readback.executionErrors,\n sourceFiles: readback.sourceFiles,\n });\n}\nfunction targetOf(slot: TargetSlot): CurrentReusedAttemptTarget {\n return Object.freeze({\n runId: slot.runId,\n slotId: slot.slotId,\n experimentId: slot.experimentId,\n evalId: slot.evalId,\n attempt: slot.attempt,\n });\n}\nfunction sourceOf(source: ExecutionReusePlanSource): CurrentReusedAttemptSource {\n return Object.freeze({\n attempt: source.attempt,\n attemptId: source.attemptId,\n origin: source.origin,\n sourceBarrier: source.sourceBarrier,\n evaluationKind: source.evaluationKind,\n });\n}\nfunction targetSnapshotOf(target: CurrentReusedAttemptTarget): CurrentReusedAttemptTargetSnapshot {\n return Object.freeze({\n runId: String(target.runId),\n slotId: String(target.slotId),\n experimentId: target.experimentId,\n evalId: target.evalId,\n attempt: target.attempt,\n });\n}\nfunction sourceSnapshotOf(source: CurrentReusedAttemptSource): CurrentReusedAttemptSourceSnapshot {\n return Object.freeze({\n attemptId: String(source.attemptId),\n locator: encodeAttemptLocator(source.attemptId),\n origin: Object.freeze({ runId: String(source.origin.runId), slotId: String(source.origin.slotId) }),\n sourceBarrier: Object.freeze({\n runId: String(source.sourceBarrier.runId),\n startedAt: source.sourceBarrier.startedAt,\n }),\n evaluationKind: source.evaluationKind,\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"reuse-readback.js","sourceRoot":"","sources":["reuse-readback.ts"],"names":[],"mappings":";;AAoQA,4DA0BC;AACD,8DAyBC;AACD,wFAOC;AACD,oFAKC;AA2BD,kEAIC;AACD,kFASC;AACD,oFAUC;AA1XD,mCAAwC;AACxC,8DAA6D;AAK7D,0DAAmE;AAEnE,mDAAuJ;AA+HvJ,SAAS,UAAU,CAAQ,KAA6B;IACpD,QAAQ,KAAK,CAAC,KAAK,EAAE,CAAC;QAClB,KAAK,WAAW;YACZ,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,WAAoB,EAAE,KAAK,E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AAM,CAAC,SAAS;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,aAAa,EAAE,MAAM,CAAC,aAAa;QACnC,cAAc,EAAE,MAAM,CAAC,cAAc;KACxC,CAAC,CAAC;AACP,CAAC;AACD,SAAS,gBAAgB,CAAC,MAAkC;IACxD,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;QAC7B,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;KAC1B,CAAC,CAAC;AACP,CAAC;AACD,SAAS,gBAAgB,CAAC,MAAkC;IACxD,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;QACnC,OAAO,EAAE,IAAA,yCAAoB,EAAC,MAAM,CAAC,SAAS,CAAC;QAC/C,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACnG,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC;YACzB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC;YACzC,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,SAAS;SAC5C,CAAC;QACF,cAAc,EAAE,MAAM,CAAC,cAAc;KACxC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import { Effect, Either } from \"effect\";\nimport { encodeAttemptLocator } from \"../attempt-locator.ts\";\nimport type { ScoreContribution } from \"../assertions/record/model.ts\";\nimport type { RecordIssue } from \"../record/errors/record-errors.ts\";\nimport type { FixedFamilyRead, ReadableAttempt, RecordReadSession, SelectedAttemptRef, } from \"../record/host/types.ts\";\nimport type { RecordReaderReadError } from \"../record/reader/errors.ts\";\nimport { projectSourcesAttachment } from \"../sources/projector.ts\";\nimport type { Verdict } from \"../shared/types.ts\";\nimport { recordedAttemptVerdict, type ExecutionReusePlan, type ExecutionReusePlanSource, type ReusePlanSlot, type TargetSlot, } from \"./reuse-plan.ts\";\n/** Fixed-family read states remain visible; a readback never invents a result file. */\nexport type CurrentRecordRead<Value> = {\n readonly state: \"available\";\n readonly value: Value;\n} | {\n readonly state: \"not-recorded\";\n} | {\n readonly state: \"migration-required\";\n readonly family: string;\n readonly fromSchemaVersion: number;\n readonly toSchemaVersion: number;\n readonly command: \"niceeval migrate\";\n} | {\n readonly state: \"unsupported\";\n readonly family: string;\n readonly schemaVersion: number;\n} | {\n readonly state: \"invalid\";\n readonly issues: readonly RecordIssue[];\n};\nexport interface CurrentReusedAttemptReadback {\n readonly state: \"reused\";\n readonly target: CurrentReusedAttemptTarget;\n readonly source: CurrentReusedAttemptSource;\n readonly verdict: \"passed\" | \"failed\";\n readonly score: CurrentReusedAttemptScore;\n readonly executionErrors: CurrentRecordRead<readonly CurrentReusedExecutionError[]>;\n}\nexport interface CurrentReuseCandidateReadback {\n readonly state: \"prior\";\n readonly target: CurrentReusedAttemptTarget;\n readonly source: CurrentReusedAttemptSource;\n readonly verdict: CurrentRecordRead<Verdict>;\n readonly score: CurrentReusedAttemptScore;\n readonly executionErrors: CurrentRecordRead<readonly CurrentReusedExecutionError[]>;\n readonly sourceFiles: CurrentReuseSourceFiles;\n}\nexport type CurrentReuseReadback = CurrentReusedAttemptReadback | CurrentReuseCandidateReadback;\nexport interface CurrentReusedAttemptTarget {\n readonly runId: TargetSlot[\"runId\"];\n readonly slotId: TargetSlot[\"slotId\"];\n readonly experimentId: TargetSlot[\"experimentId\"];\n readonly evalId: TargetSlot[\"evalId\"];\n readonly attempt: TargetSlot[\"attempt\"];\n}\nexport interface CurrentReusedAttemptSource {\n readonly attempt: SelectedAttemptRef;\n readonly attemptId: ExecutionReusePlanSource[\"attemptId\"];\n readonly origin: ExecutionReusePlanSource[\"origin\"];\n readonly sourceBarrier: ExecutionReusePlanSource[\"sourceBarrier\"];\n readonly evaluationKind: ExecutionReusePlanSource[\"evaluationKind\"];\n}\nexport type CurrentReusedAttemptScore = {\n readonly state: \"not-applicable\";\n} | {\n readonly state: \"applicable\";\n readonly attachment: CurrentRecordRead<{\n readonly state: \"complete\" | \"partial\" | \"unavailable\";\n readonly earned?: number;\n }>;\n};\nexport interface CurrentReusedExecutionCause {\n readonly code: string;\n readonly summary: string;\n}\nexport interface CurrentReusedExecutionError {\n readonly kind: \"execution-error\";\n readonly code: string;\n readonly phase: string;\n readonly summary: string;\n readonly causes: readonly CurrentReusedExecutionCause[];\n}\nexport interface CurrentReuseSourceFile {\n readonly path: string;\n readonly sha256: string;\n}\nexport type CurrentReuseSourceFiles = CurrentRecordRead<readonly CurrentReuseSourceFile[]> | {\n readonly state: \"origin-run-missing\";\n} | {\n readonly state: \"origin-run-invalid\";\n readonly issues: readonly RecordIssue[];\n} | {\n readonly state: \"projection-invalid\";\n};\nexport interface CurrentReuseReadbackPlanInvalid {\n readonly code: \"current-reuse-readback-plan-invalid\";\n readonly reason: \"source-attempt-unavailable\" | \"source-verdict-unavailable\" | \"source-verdict-ineligible\";\n}\nexport interface CurrentReusedAttemptSourceSnapshot {\n readonly attemptId: string;\n readonly locator: string;\n readonly origin: {\n readonly runId: string;\n readonly slotId: string;\n };\n readonly sourceBarrier: {\n readonly runId: string;\n readonly startedAt: number;\n };\n readonly evaluationKind: CurrentReusedAttemptSource[\"evaluationKind\"];\n}\nexport interface CurrentReusedAttemptTargetSnapshot {\n readonly runId: string;\n readonly slotId: string;\n readonly experimentId: string;\n readonly evalId: string;\n readonly attempt: number;\n}\nexport interface CurrentReusedAttemptSnapshot {\n readonly state: \"reused\";\n readonly target: CurrentReusedAttemptTargetSnapshot;\n readonly source: CurrentReusedAttemptSourceSnapshot;\n readonly verdict: CurrentReusedAttemptReadback[\"verdict\"];\n readonly score: CurrentReusedAttemptScore;\n readonly executionErrors: CurrentReusedAttemptReadback[\"executionErrors\"];\n}\nexport interface CurrentReuseCandidateSnapshot {\n readonly state: \"prior\";\n readonly target: CurrentReusedAttemptTargetSnapshot;\n readonly source: CurrentReusedAttemptSourceSnapshot;\n readonly verdict: CurrentReuseCandidateReadback[\"verdict\"];\n readonly score: CurrentReusedAttemptScore;\n readonly executionErrors: CurrentReusedAttemptReadback[\"executionErrors\"];\n readonly sourceFiles: CurrentReuseSourceFiles;\n}\nexport type CurrentReuseReadbackSnapshot = CurrentReusedAttemptSnapshot | CurrentReuseCandidateSnapshot;\nfunction recordRead<Value>(value: FixedFamilyRead<Value>): CurrentRecordRead<Value> {\n switch (value.state) {\n case \"available\":\n return Object.freeze({ state: \"available\" as const, value: value.value as Value });\n case \"not-recorded\":\n return Object.freeze({ state: \"not-recorded\" as const });\n case \"unsupported\":\n return Object.freeze({\n state: \"unsupported\" as const,\n family: value.family,\n schemaVersion: value.schemaVersion,\n });\n case \"migration-required\":\n return Object.freeze({\n state: \"migration-required\" as const,\n family: value.family,\n fromSchemaVersion: value.fromSchemaVersion,\n toSchemaVersion: value.toSchemaVersion,\n command: value.command,\n });\n case \"invalid\":\n return Object.freeze({ state: \"invalid\" as const, issues: Object.freeze([...value.issues]) });\n }\n}\nfunction nonAvailableRead<Value>(value: Exclude<FixedFamilyRead<unknown>, {\n readonly state: \"available\";\n}>): CurrentRecordRead<Value> {\n switch (value.state) {\n case \"not-recorded\":\n return Object.freeze({ state: \"not-recorded\" as const });\n case \"unsupported\":\n return Object.freeze({\n state: \"unsupported\" as const,\n family: value.family,\n schemaVersion: value.schemaVersion,\n });\n case \"migration-required\":\n return Object.freeze({\n state: \"migration-required\" as const,\n family: value.family,\n fromSchemaVersion: value.fromSchemaVersion,\n toSchemaVersion: value.toSchemaVersion,\n command: value.command,\n });\n case \"invalid\":\n return Object.freeze({ state: \"invalid\" as const, issues: Object.freeze([...value.issues]) });\n }\n}\nfunction invalid(reason: CurrentReuseReadbackPlanInvalid[\"reason\"]): CurrentReuseReadbackPlanInvalid {\n return Object.freeze({ code: \"current-reuse-readback-plan-invalid\", reason });\n}\nfunction readSourceAttempt(input: {\n readonly reader: RecordReadSession;\n readonly source: ExecutionReusePlanSource;\n}): Effect.Effect<ReadableAttempt, RecordReaderReadError | CurrentReuseReadbackPlanInvalid> {\n return input.reader.readAttempt(input.source.attempt).pipe(Effect.flatMap((read) => read.state === \"available\"\n ? Effect.succeed(read.value)\n : Effect.fail(invalid(\"source-attempt-unavailable\"))));\n}\nfunction scoreOf(contributions: readonly ScoreContribution[]): {\n readonly state: \"complete\" | \"partial\" | \"unavailable\";\n readonly earned?: number;\n} {\n let earned = 0;\n let unavailable = false;\n for (const score of contributions) {\n if (score.state === \"earned\" && typeof score.earned === \"number\")\n earned += score.earned;\n if (score.state === \"unavailable\")\n unavailable = true;\n }\n return unavailable\n ? Object.freeze({ state: earned > 0 ? \"partial\" as const : \"unavailable\" as const, ...(earned > 0 ? { earned } : {}) })\n : Object.freeze({ state: \"complete\" as const, earned });\n}\nfunction detailsFor(input: {\n readonly reader: RecordReadSession;\n readonly attempt: ReadableAttempt;\n readonly evaluationKind: ExecutionReusePlanSource[\"evaluationKind\"];\n}): Effect.Effect<{\n readonly assertions: CurrentRecordRead<Verdict>;\n readonly score: CurrentReusedAttemptScore;\n readonly executionErrors: CurrentRecordRead<readonly CurrentReusedExecutionError[]>;\n}, RecordReaderReadError> {\n return Effect.gen(function* () {\n const assertions = yield* input.reader.readAssertions(input.attempt.owner);\n const assertionRead: CurrentRecordRead<Verdict> = assertions.state === \"available\"\n ? Object.freeze({\n state: \"available\" as const,\n value: recordedAttemptVerdict({\n outcome: input.attempt.document.outcome,\n assertions: assertions.value,\n }) as Verdict,\n })\n : nonAvailableRead(assertions);\n const observability = yield* input.reader.readAttemptObservability(input.attempt.owner);\n const executionErrors: CurrentRecordRead<readonly CurrentReusedExecutionError[]> = observability.state === \"available\"\n ? Object.freeze({\n state: \"available\" as const,\n value: Object.freeze(observability.value.diagnostics.diagnostics\n .filter((diagnostic) => diagnostic.kind === \"execution-error\")\n .map((diagnostic) => Object.freeze({\n kind: \"execution-error\" as const,\n code: diagnostic.code,\n phase: diagnostic.phase,\n summary: diagnostic.summary,\n causes: Object.freeze(diagnostic.causes.map((cause) => Object.freeze({\n code: cause.code,\n summary: cause.summary,\n }))),\n }))),\n })\n : nonAvailableRead(observability);\n const scoreAttachment: CurrentRecordRead<{\n readonly state: \"complete\" | \"partial\" | \"unavailable\";\n readonly earned?: number;\n }> = assertions.state === \"available\"\n ? Object.freeze({ state: \"available\" as const, value: scoreOf(assertions.value.entries.map((entry) => entry.contribution)) })\n : nonAvailableRead(assertions);\n const score: CurrentReusedAttemptScore = input.evaluationKind === \"score\"\n ? Object.freeze({ state: \"applicable\" as const, attachment: scoreAttachment })\n : Object.freeze({ state: \"not-applicable\" as const });\n return Object.freeze({ assertions: assertionRead, score, executionErrors });\n });\n}\nexport function readCurrentReusedAttempt(input: {\n readonly reader: RecordReadSession;\n readonly slot: ReusePlanSlot;\n}): Effect.Effect<CurrentReusedAttemptReadback, RecordReaderReadError | CurrentReuseReadbackPlanInvalid> {\n return Effect.gen(function* () {\n const attempt = yield* readSourceAttempt({ reader: input.reader, source: input.slot.source });\n const details = yield* detailsFor({\n reader: input.reader,\n attempt,\n evaluationKind: input.slot.source.evaluationKind,\n });\n if (details.assertions.state !== \"available\") {\n return yield* Effect.fail(invalid(\"source-verdict-unavailable\"));\n }\n if (details.assertions.value !== \"passed\" && details.assertions.value !== \"failed\") {\n return yield* Effect.fail(invalid(\"source-verdict-ineligible\"));\n }\n return Object.freeze({\n state: \"reused\" as const,\n target: targetOf(input.slot),\n source: sourceOf(input.slot.source),\n verdict: details.assertions.value,\n score: details.score,\n executionErrors: details.executionErrors,\n });\n });\n}\nexport function readCurrentReuseCandidate(input: {\n readonly reader: RecordReadSession;\n readonly slot: Extract<ExecutionReusePlan[\"slots\"][number], {\n readonly state: \"gap\";\n }>;\n}): Effect.Effect<CurrentReuseCandidateReadback | undefined, RecordReaderReadError | CurrentReuseReadbackPlanInvalid> {\n return Effect.suspend(() => {\n const source = input.slot.candidate;\n if (source === undefined)\n return Effect.succeed(undefined);\n return Effect.gen(function* () {\n const attempt = yield* readSourceAttempt({ reader: input.reader, source });\n const details = yield* detailsFor({ reader: input.reader, attempt, evaluationKind: source.evaluationKind });\n const sourceFiles = yield* readCurrentReuseSourceFiles({ reader: input.reader, source });\n return Object.freeze({\n state: \"prior\" as const,\n target: targetOf(input.slot),\n source: sourceOf(source),\n verdict: details.assertions,\n score: details.score,\n executionErrors: details.executionErrors,\n sourceFiles,\n });\n });\n });\n}\nexport function readCurrentExecutionReusePlanReadbacks(input: {\n readonly reader: RecordReadSession;\n readonly plan: ExecutionReusePlan;\n}): Effect.Effect<readonly CurrentReuseReadback[], RecordReaderReadError | CurrentReuseReadbackPlanInvalid> {\n return Effect.forEach(input.plan.slots, (slot) => slot.state === \"reuse\"\n ? readCurrentReusedAttempt({ reader: input.reader, slot }).pipe(Effect.map((value): CurrentReuseReadback | undefined => value))\n : readCurrentReuseCandidate({ reader: input.reader, slot }), { concurrency: 1 }).pipe(Effect.map((values) => Object.freeze(values.flatMap((value) => value === undefined ? [] : [value]))));\n}\nexport function readCurrentExecutionReusePlanResults(input: {\n readonly reader: RecordReadSession;\n readonly plan: ExecutionReusePlan;\n}): Effect.Effect<readonly CurrentReusedAttemptReadback[], RecordReaderReadError | CurrentReuseReadbackPlanInvalid> {\n return Effect.forEach(input.plan.reuse, (slot) => readCurrentReusedAttempt({ reader: input.reader, slot }), { concurrency: 1 }).pipe(Effect.map((values) => Object.freeze(values)));\n}\nfunction readCurrentReuseSourceFiles(input: {\n readonly reader: RecordReadSession;\n readonly source: ExecutionReusePlanSource;\n}): Effect.Effect<CurrentReuseSourceFiles, RecordReaderReadError> {\n return Effect.gen(function* () {\n const origin = yield* input.reader.readRun(input.source.originRun);\n if (origin.state === \"missing\")\n return Object.freeze({ state: \"origin-run-missing\" as const });\n if (origin.state === \"core-invalid\") {\n return Object.freeze({ state: \"origin-run-invalid\" as const, issues: Object.freeze([...origin.issues]) });\n }\n const sources = yield* input.reader.readSources(origin.value.owner);\n if (sources.state !== \"available\")\n return nonAvailableRead(sources);\n const projection = projectSourcesAttachment(sources.value, sources.blobs);\n if (Either.isLeft(projection))\n return Object.freeze({ state: \"projection-invalid\" as const });\n return Object.freeze({\n state: \"available\" as const,\n value: Object.freeze(projection.right.items.map((item) => Object.freeze({\n path: item.path,\n sha256: item.sha256,\n }))),\n });\n });\n}\nexport function projectCurrentReuseReadback(readback: CurrentReuseReadback): CurrentReuseReadbackSnapshot {\n return readback.state === \"reused\"\n ? projectCurrentReusedAttemptReadback(readback)\n : projectCurrentReuseCandidateReadback(readback);\n}\nexport function projectCurrentReusedAttemptReadback(readback: CurrentReusedAttemptReadback): CurrentReusedAttemptSnapshot {\n return Object.freeze({\n state: \"reused\" as const,\n target: targetSnapshotOf(readback.target),\n source: sourceSnapshotOf(readback.source),\n verdict: readback.verdict,\n score: readback.score,\n executionErrors: readback.executionErrors,\n });\n}\nexport function projectCurrentReuseCandidateReadback(readback: CurrentReuseCandidateReadback): CurrentReuseCandidateSnapshot {\n return Object.freeze({\n state: \"prior\" as const,\n target: targetSnapshotOf(readback.target),\n source: sourceSnapshotOf(readback.source),\n verdict: readback.verdict,\n score: readback.score,\n executionErrors: readback.executionErrors,\n sourceFiles: readback.sourceFiles,\n });\n}\nfunction targetOf(slot: TargetSlot): CurrentReusedAttemptTarget {\n return Object.freeze({\n runId: slot.runId,\n slotId: slot.slotId,\n experimentId: slot.experimentId,\n evalId: slot.evalId,\n attempt: slot.attempt,\n });\n}\nfunction sourceOf(source: ExecutionReusePlanSource): CurrentReusedAttemptSource {\n return Object.freeze({\n attempt: source.attempt,\n attemptId: source.attemptId,\n origin: source.origin,\n sourceBarrier: source.sourceBarrier,\n evaluationKind: source.evaluationKind,\n });\n}\nfunction targetSnapshotOf(target: CurrentReusedAttemptTarget): CurrentReusedAttemptTargetSnapshot {\n return Object.freeze({\n runId: String(target.runId),\n slotId: String(target.slotId),\n experimentId: target.experimentId,\n evalId: target.evalId,\n attempt: target.attempt,\n });\n}\nfunction sourceSnapshotOf(source: CurrentReusedAttemptSource): CurrentReusedAttemptSourceSnapshot {\n return Object.freeze({\n attemptId: String(source.attemptId),\n locator: encodeAttemptLocator(source.attemptId),\n origin: Object.freeze({ runId: String(source.origin.runId), slotId: String(source.origin.slotId) }),\n sourceBarrier: Object.freeze({\n runId: String(source.sourceBarrier.runId),\n startedAt: source.sourceBarrier.startedAt,\n }),\n evaluationKind: source.evaluationKind,\n });\n}\n"]}
|
package/dist/runner/run.cjs
CHANGED
|
@@ -2121,6 +2121,7 @@ function runEvals(opts) {
|
|
|
2121
2121
|
// 且混进兄弟 fiber 的 interrupt 后被当成用户中断吞掉正文(见
|
|
2122
2122
|
// docs/feature/error-classification/architecture.md「Effect 边界」:attempt fiber 的
|
|
2123
2123
|
// E 恒为 never;memory/experiment-fatal-presented-as-user-interrupt.md)。
|
|
2124
|
+
let sealedEvaluation;
|
|
2124
2125
|
const completed = yield* effect_1.Effect.scoped(effect_1.Effect.gen(function* () {
|
|
2125
2126
|
const leased = poolSelection._tag === "Reuse"
|
|
2126
2127
|
? effect_1.Either.match(yield* effect_1.Effect.either(poolSelection.pool.acquire((0, timeout_ts_1.resolveAttemptTimeout)(a.run, a.evalDef, opts.config)?.timeoutMs, buildLocators)), {
|
|
@@ -2194,7 +2195,9 @@ function runEvals(opts) {
|
|
|
2194
2195
|
},
|
|
2195
2196
|
}
|
|
2196
2197
|
: {}),
|
|
2197
|
-
onSealedEvaluation: (sealed) =>
|
|
2198
|
+
onSealedEvaluation: (sealed) => effect_1.Effect.sync(() => {
|
|
2199
|
+
sealedEvaluation = sealed;
|
|
2200
|
+
}).pipe(effect_1.Effect.zipRight(recordCoordinator.noteSealedOrMarkIncomplete(recordedAttempt, sealed))),
|
|
2198
2201
|
});
|
|
2199
2202
|
if (lease) {
|
|
2200
2203
|
// Attempt 的 Eval/Agent 收尾已在 runAttemptEffect 内完成;reset 失败会淘汰实例,
|
|
@@ -2314,7 +2317,7 @@ function runEvals(opts) {
|
|
|
2314
2317
|
// 的省略规则一致),且只报真正计入 results 的 attempt(上面的并发去重分支已经
|
|
2315
2318
|
// return 掉、不会走到这里,不会为一条被丢弃的重复 attempt 误报失败)。
|
|
2316
2319
|
if (locator) {
|
|
2317
|
-
const failure = (0, failure_ts_1.failureDetailFromResult)(result);
|
|
2320
|
+
const failure = (0, failure_ts_1.failureDetailFromResult)(result, sealedEvaluation);
|
|
2318
2321
|
if (failure)
|
|
2319
2322
|
(0, sink_ts_1.reportFailure)(failure);
|
|
2320
2323
|
}
|