niceeval 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/INDEX.md +1 -0
  2. package/dist/adapter.cjs +4 -0
  3. package/dist/adapter.cjs.map +1 -1
  4. package/dist/adapter.d.cts +25 -14
  5. package/dist/adapter.d.mts +25 -14
  6. package/dist/adapter.d.ts +25 -14
  7. package/dist/assertions/measurements.cjs +45 -0
  8. package/dist/assertions/measurements.cjs.map +1 -0
  9. package/dist/assertions/measurements.d.cts +17 -0
  10. package/dist/assertions/measurements.d.mts +17 -0
  11. package/dist/assertions/measurements.d.ts +17 -0
  12. package/dist/assertions/measurements.js +8 -0
  13. package/dist/assertions/measurements.js.map +1 -0
  14. package/dist/define.cjs +2 -0
  15. package/dist/define.cjs.map +1 -1
  16. package/dist/expect/index.cjs +4 -1
  17. package/dist/expect/index.cjs.map +1 -1
  18. package/dist/expect/index.d.cts +3 -1
  19. package/dist/expect/index.d.mts +3 -1
  20. package/dist/expect/index.d.ts +3 -1
  21. package/dist/expect/index.js +20 -16
  22. package/dist/expect/index.mjs +20 -16
  23. package/dist/experiment/host/operations.cjs +3 -1
  24. package/dist/experiment/host/operations.cjs.map +1 -1
  25. package/dist/experiment/host/runtime.cjs +3 -1
  26. package/dist/experiment/host/runtime.cjs.map +1 -1
  27. package/dist/experiment/host/teardown.cjs +1 -0
  28. package/dist/experiment/host/teardown.cjs.map +1 -1
  29. package/dist/index.cjs +3 -19
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +3 -7
  32. package/dist/index.d.mts +3 -7
  33. package/dist/index.d.ts +3 -7
  34. package/dist/index.js +12 -34
  35. package/dist/index.mjs +12 -34
  36. package/dist/model-slots.cjs +19 -0
  37. package/dist/model-slots.cjs.map +1 -1
  38. package/dist/model-slots.d.cts +7 -0
  39. package/dist/model-slots.d.mts +7 -0
  40. package/dist/model-slots.d.ts +7 -0
  41. package/dist/model-slots.js +8 -2
  42. package/dist/o11y/eval-usage.cjs +20 -2
  43. package/dist/o11y/eval-usage.cjs.map +1 -1
  44. package/dist/o11y/eval-usage.d.cts +7 -2
  45. package/dist/o11y/eval-usage.d.mts +7 -2
  46. package/dist/o11y/eval-usage.d.ts +7 -2
  47. package/dist/runner/adoption.cjs +1 -0
  48. package/dist/runner/adoption.cjs.map +1 -1
  49. package/dist/runner/eval-selection.cjs +15 -1
  50. package/dist/runner/eval-selection.cjs.map +1 -1
  51. package/dist/runner/eval-selection.d.cts +4 -0
  52. package/dist/runner/eval-selection.d.mts +4 -0
  53. package/dist/runner/eval-selection.d.ts +4 -0
  54. package/dist/runner/lock.cjs +1 -3
  55. package/dist/runner/lock.cjs.map +1 -1
  56. package/dist/runner/lock.d.cts +0 -2
  57. package/dist/runner/lock.d.mts +0 -2
  58. package/dist/runner/lock.d.ts +0 -2
  59. package/dist/runner/lock.js +14 -16
  60. package/dist/runner/types.cjs.map +1 -1
  61. package/dist/runner/types.d.cts +1 -0
  62. package/dist/runner/types.d.mts +1 -0
  63. package/dist/runner/types.d.ts +1 -0
  64. package/dist/sandbox/docker-profile/registry.cjs +1 -2
  65. package/dist/sandbox/docker-profile/registry.cjs.map +1 -1
  66. package/dist/sandbox/docker-profile/registry.d.cts +0 -1
  67. package/dist/sandbox/docker-profile/registry.d.mts +0 -1
  68. package/dist/sandbox/docker-profile/registry.d.ts +0 -1
  69. package/dist/sandbox/docker-profile/registry.js +2 -4
  70. package/dist/sandbox/index.cjs +1 -2
  71. package/dist/sandbox/index.cjs.map +1 -1
  72. package/dist/sandbox/index.d.cts +1 -1
  73. package/dist/sandbox/index.d.mts +1 -1
  74. package/dist/sandbox/index.d.ts +1 -1
  75. package/dist/sandbox/index.js +32 -34
  76. package/dist/sandbox/index.mjs +32 -34
  77. package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +5 -5
  78. package/docs-site/zh/examples/integrations/claude-sdk.mdx +5 -5
  79. package/docs-site/zh/examples/integrations/langgraph.mdx +3 -3
  80. package/docs-site/zh/examples/integrations/pi-sdk.mdx +5 -5
  81. package/docs-site/zh/explanation/judge.mdx +1 -1
  82. package/docs-site/zh/index.mdx +18 -0
  83. package/docs-site/zh/introduction.mdx +2 -1
  84. package/docs-site/zh/reference/define-agent.mdx +2 -2
  85. package/docs-site/zh/tutorials/authoring.mdx +2 -1
  86. package/docs-site/zh/tutorials/control-run-cost.mdx +84 -5
  87. package/docs-site/zh/tutorials/upgrade-0-18.mdx +64 -0
  88. package/docs-site/zh/tutorials/verify-judge.mdx +2 -1
  89. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"adoption.js","sourceRoot":"","sources":["adoption.ts"],"names":[],"mappings":";;;AA+KA,kEAMC;AAED,gDAKC;AAED,kDAgBC;AA4GD,oEAkIC;AAKD,sEAqBC;AAED,wDA8CC;AAOD,4DAgBC;AACD,kDAEC;AAKD,sEAiBC;AA2ED,sEAkEC;AAqCD,oEAgBC;AAED,wEA4EC;AAcD,gFAEC;AACD,8CAKC;AAED,gDAQC;AAOD,sEAqBC;AAcD,wEAkDC;AAl8BD,mCAAmC;AACnC,wDAAwD;AACxD,0DAA0D;AAC1D,sDAAmE;AACnE,6DAAgG;AAChG,oDAA4D;AAC5D,6CAAyC;AACzC,yCAAoC;AACpC,mCAAgD;AAChD,8CAAgD;AAChD,8DAAwG;AACxG,oFAAyE;AACzE,kEAAiJ;AAEjJ,0DAA0F;AAC1F,0DAAuD;AACvD,kEAAmL;AACnL,4DAAwE;AAExE,mEAA8J;AAE9J,mEAA0F;AAE1F,wDAAiI;AAGjI,sDAAoK;AAEpK,+CAAoE;AACpE,2DAA6D;AAC7D,mEAAyE;AACzE,qDAA8D;AAC9D,iEAAmF;AACnF,6CAAwE;AACxE,yCAAsD;AAEtD,oEAAoE;AACvD,QAAA,8BAA8B,GAAG,+BAAwC,CAAC;AAC1E,QAAA,+BAA+B,GAAG,6BAAsC,CAAC;AACtF,MAAM,8BAA8B,GAAG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MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["// @concord-file ne-runner-adoption\n// @concord-implements docs/feature/experiments/cache.md\n// @concord-implements docs/feature/experiments/library.md\nimport { foldRecordedAttemptScore } from \"../eval/record/score.ts\";\nimport { executionDigestForExperiment, hasProvenNoExperimentHooks } from \"./rename-identity.ts\";\nimport { experimentHooksForRun } from \"./record/context.ts\";\nimport { randomUUID } from \"node:crypto\";\nimport { resolve } from \"node:path\";\nimport { Effect, Result, Schema } from \"effect\";\nimport { adapterIdentity } from \"../adapter.ts\";\nimport { encodeAttemptLocator, parseAttemptLocator, type AttemptLocator, } from \"../attempt-locator.ts\";\nimport { resolveAttemptLocator } from \"../attempt-locator-resolution.ts\";\nimport { EXECUTION_DURATION_DOMAIN, readAttemptExecutionDuration, type DurationLimit, type EqualityToken, } from \"../eval/record/eligibility.ts\";\nimport { type ComparisonProvenance, } from \"../eval/record/membership-provenance.ts\";\nimport { foldRecordedAttemptVerdict, type VerdictState } from \"../eval/record/verdict.ts\";\nimport { recordHost } from \"../record/host/runtime.ts\";\nimport { detachPlanningReference, selectPlanningLocator, stagePlanningReference, writerGenerationForRunSession, type PlanningExactReference } from \"../record/host/sqlite-host.ts\";\nimport { NiceEvalRecordAttachments } from \"../record/family/catalog.ts\";\nimport type { RecordReadSession, SelectedAttemptRef, } from \"../record/host/types.ts\";\nimport { EvalIdSchema, ExecutionIdentityDigestSchema, ExperimentIdSchema, RunIdSchema, SlotIdSchema, UtcMillisSchema, } from \"../record/codec/identifiers.ts\";\nimport type { AttemptOutcome, RecordSlotIdentity } from \"../record/model/core.ts\";\nimport { canonicalizeRunContext, type RunContext, } from \"../record/model/run-context.ts\";\nimport type { EvalId, ExperimentId, ExecutionIdentityDigest, RunId, SlotId, UtcMillis, } from \"../record/model/identifiers.ts\";\nimport { makeRecordRoot, recordRootPaths, type RecordRoot, type RecordRootConstructionError, } from \"../record/platform/root.ts\";\nimport type { RecordReaderOpenError, RecordReaderReadError } from \"../record/reader/errors.ts\";\nimport type { RecordWriteError } from \"../record/writer/types.ts\";\nimport { asRunStorageError, bindAttemptReference, closeRunResource, createRunResource, createRunWriterGeneration, RunStorageError, } from \"../run/storage/index.ts\";\nimport type { SandboxPlanningServices } from \"../sandbox/plan.ts\";\nimport { discoverEvals, discoverExperiments, } from \"./discover.ts\";\nimport { resolveExperimentEvals } from \"./eval-selection.ts\";\nimport { slotExecutionIdentityDigestHex } from \"./execution-identity.ts\";\nimport { planPreparedProjectTarget, } from \"./fingerprint.ts\";\nimport { prepareRunSandboxes, type PreparedRunPair } from \"./sandbox-selection.ts\";\nimport { resolveAttemptTimeout, resolveRunTimeout } from \"./timeout.ts\";\nimport { resolveSandboxSetupCache } from \"./types.ts\";\nimport type { AgentRun, Config, DiscoveredEval, DiscoveredExperiment, } from \"./types.ts\";\n/** Shared domains emitted by the current ProjectTarget producer. */\nexport const ADOPTION_INPUT_IDENTITY_DOMAIN = \"niceeval.input/fingerprint-v1\" as const;\nexport const ADOPTION_CONFIG_IDENTITY_DOMAIN = \"niceeval.config/identity-v1\" as const;\nconst ADOPTION_TARGET_SLOT_SEPARATOR = \"\\u0000\";\nexport type ExplicitAdoptionIntent = \"accept\" | \"rename\";\nexport type ExplicitAdoptionFailureCode = \"rename-run-not-closed\" | \"rename-identity-mismatch\" | \"rename-behavior-unproven\" | \"adoption-locator-malformed\" | \"adoption-locator-not-found\" | \"adoption-locator-ambiguous\" | \"adoption-batch-locator-duplicate\" | \"adoption-source-core-invalid\" | \"adoption-source-verdict-unavailable\" | \"adoption-source-observability-unavailable\" | \"adoption-source-verdict-ineligible\" | \"adoption-target-experiment-not-found\" | \"adoption-target-eval-not-selected\" | \"adoption-target-attempt-not-selected\" | \"adoption-target-planning-failed\" | \"adoption-target-invalid\" | \"adoption-target-slot-duplicate\" | \"adoption-target-member-duplicate\" | \"adoption-duration-domain-mismatch\" | \"adoption-timeout-exceeded\" | \"adoption-source-run-required\" | \"adoption-source-run-not-found\" | \"adoption-source-run-mismatch\" | \"accept-run-not-closed\" | \"run-not-found\" | \"adoption-provenance-invalid\" | \"adoption-evaluation-plan-invalid\";\n/** Expected product failures retain a stable code without collapsing Effect causes. */\nexport class ExplicitAdoptionError extends Error {\n readonly name = \"ExplicitAdoptionError\";\n constructor(readonly code: ExplicitAdoptionFailureCode, message: string) {\n super(message);\n }\n}\nexport type ExplicitAdoptionReadError = ExplicitAdoptionError | RecordReaderReadError;\nexport type ExplicitAdoptionOpenError = ExplicitAdoptionError | RecordRootConstructionError | RecordReaderOpenError | RecordReaderReadError | RecordWriteError;\nexport interface AdoptionProjectInput {\n readonly cwd: string;\n readonly config?: Config;\n readonly evals?: readonly DiscoveredEval[];\n readonly experiments?: readonly DiscoveredExperiment[];\n readonly planningServices?: SandboxPlanningServices;\n}\nexport interface AdoptionProject {\n readonly cwd: string;\n readonly config: Config;\n readonly evals: readonly DiscoveredEval[];\n readonly experiments: readonly DiscoveredExperiment[];\n readonly planningServices?: SandboxPlanningServices;\n}\nexport interface ExplicitAttemptLocator {\n readonly text: string;\n readonly locator: AttemptLocator;\n readonly attemptId: SelectedAttemptRef[\"attemptId\"];\n}\ninterface ParsedExplicitAttemptLocator {\n readonly text: string;\n readonly locator: AttemptLocator;\n}\nexport interface ResolvedAdoptionAttempt {\n readonly reference: PlanningExactReference;\n readonly originContext: RunContext;\n readonly locator: ExplicitAttemptLocator;\n readonly attempt: SelectedAttemptRef;\n readonly origin: {\n readonly runId: RunId;\n readonly slotId: SlotId;\n readonly startedAt: UtcMillis;\n };\n readonly originExperimentId: string;\n readonly originEvalId: string;\n readonly originAttempt: number;\n readonly executionIdentityDigest: ExecutionIdentityDigest;\n}\nexport interface CurrentAdoptionSlot {\n readonly evaluationKind: \"pass\" | \"score\";\n readonly renameFingerprint?: (experimentId: string) => string | undefined;\n readonly slotId: SlotId;\n readonly experimentId: string;\n readonly evalId: string;\n /** Durable Slot identity; `attempt` remains the caller-facing selector. */\n readonly attemptOrdinal: number;\n readonly attempt: number;\n readonly inputIdentity: EqualityToken;\n readonly configIdentity: EqualityToken;\n readonly executionIdentityDigest: ExecutionIdentityDigest;\n readonly timeout?: DurationLimit;\n}\nexport interface CurrentAdoptionTarget {\n readonly experimentId: string;\n readonly startedAt: UtcMillis;\n readonly expectedSlots: readonly RecordSlotIdentity[];\n readonly context: RunContext;\n readonly slots: readonly CurrentAdoptionSlot[];\n readonly slotFor: (evalId: string, attempt: number) => CurrentAdoptionSlot | undefined;\n}\nexport interface ExplicitAdoptionMember {\n readonly target: CurrentAdoptionSlot;\n readonly source: ResolvedAdoptionAttempt;\n readonly locator: string;\n readonly verdict: \"passed\" | \"failed\";\n readonly comparisons: readonly ComparisonProvenance[];\n readonly operatorReason?: string;\n}\nexport interface ExplicitAdoptionRunPlan {\n readonly intent: ExplicitAdoptionIntent;\n readonly target: CurrentAdoptionTarget;\n readonly members: readonly ExplicitAdoptionMember[];\n}\nexport interface ExplicitAdoptionMemberReceipt {\n readonly slotId: SlotId;\n readonly locator: string;\n readonly sourceRunId: RunId;\n readonly attemptId: SelectedAttemptRef[\"attemptId\"];\n}\nexport interface ExplicitAdoptionRunReceipt {\n /** Explicit target identity; receipt ordering is never provenance. */\n readonly experimentId: string;\n readonly runId: RunId;\n readonly members: readonly ExplicitAdoptionMemberReceipt[];\n}\n/** Real Host write/open failures after all domain preflight has already passed. */\nexport type ExplicitAdoptionCommitError = RecordWriteError | RecordReaderOpenError | RunStorageError;\nfunction adoptionError(code: ExplicitAdoptionFailureCode, message: string): ExplicitAdoptionError {\n return new ExplicitAdoptionError(code, message);\n}\nfunction safeMessage(cause: unknown): string {\n if (typeof cause === \"object\" && cause !== null) {\n const message = Reflect.get(cause, \"message\");\n if (typeof message === \"string\")\n return message;\n const code = Reflect.get(cause, \"code\");\n if (typeof code === \"string\")\n return code;\n const tag = Reflect.get(cause, \"_tag\");\n if (typeof tag === \"string\")\n return tag;\n }\n return String(cause);\n}\nfunction decodeBrandedId<Id>(schema: Schema.Codec<Id, string>, value: string, code: ExplicitAdoptionFailureCode, label: string): Effect.Effect<Id, ExplicitAdoptionError> {\n const decoded = Schema.decodeUnknownResult(schema)(value);\n return Result.isFailure(decoded)\n ? Effect.fail(adoptionError(code, `${label} is not a current Record identity.`))\n : Effect.succeed(decoded.success);\n}\nfunction utcMillis(value: number): Effect.Effect<UtcMillis, ExplicitAdoptionError> {\n const decoded = Schema.decodeUnknownResult(UtcMillisSchema)(value);\n return Result.isFailure(decoded)\n ? Effect.fail(adoptionError(\"adoption-target-invalid\", \"Adoption timestamp is invalid.\"))\n : Effect.succeed(decoded.success);\n}\nfunction slotKey(evalId: string, attempt: number): string {\n return `${evalId}${ADOPTION_TARGET_SLOT_SEPARATOR}${String(attempt)}`;\n}\nfunction attemptLocatorFor(attemptId: SelectedAttemptRef[\"attemptId\"]): ExplicitAttemptLocator {\n const locator = encodeAttemptLocator(attemptId);\n return Object.freeze({ text: locator, locator, attemptId });\n}\n/** Strict v1 parser accepts only the current canonical short locator. */\nexport function parseExplicitAttemptLocator(value: string): Effect.Effect<ParsedExplicitAttemptLocator, ExplicitAdoptionError> {\n const parsed = parseAttemptLocator(value);\n if (!parsed.valid) {\n return Effect.fail(adoptionError(\"adoption-locator-malformed\", \"An explicit adoption locator must match @1 followed by 12 canonical uppercase Crockford characters.\"));\n }\n return Effect.succeed(Object.freeze({ text: value, locator: parsed.locator }));\n}\n/** Adoption writes only to the discovered project's canonical Record. */\nexport function adoptionRecordRoot(input: {\n readonly cwd: string;\n}): Effect.Effect<RecordRoot, RecordRootConstructionError> {\n const root = makeRecordRoot(resolve(input.cwd, \".niceeval\"));\n return Result.isFailure(root) ? Effect.fail(root.failure) : Effect.succeed(root.success);\n}\n/** Discovery is rerun for both read preflight and the write-session frozen view. */\nexport function loadAdoptionProject(input: AdoptionProjectInput): Effect.Effect<AdoptionProject, ExplicitAdoptionError> {\n return Effect.gen(function* () {\n const cwd = resolve(input.cwd);\n const config = input.config ?? (yield* Effect.fail(adoptionError(\"adoption-target-invalid\", \"An adapter host must supply the resolved project configuration.\")));\n const evals = input.evals ?? (yield* discoverEvals(cwd).pipe(Effect.mapError((error) => adoptionError(\"adoption-target-invalid\", `Current Eval discovery failed: ${error.message}`))));\n const experiments = input.experiments ?? (yield* discoverExperiments(cwd).pipe(Effect.mapError((error) => adoptionError(\"adoption-target-invalid\", `Current Experiment discovery failed: ${error.message}`))));\n return Object.freeze({\n cwd,\n config,\n evals: Object.freeze([...evals]),\n experiments: Object.freeze([...experiments]),\n ...(input.planningServices === undefined\n ? {}\n : { planningServices: input.planningServices }),\n });\n });\n}\nfunction runForExperiment(experiment: DiscoveredExperiment, selectedEvalIds: readonly string[], config: Config): AgentRun {\n return Object.freeze({\n adapter: experiment.adapter,\n ...(experiment.agent === undefined ? {} : { agent: experiment.agent }),\n ...(experiment.models === undefined ? {} : { models: experiment.models }),\n ...(experiment.model === undefined ? {} : { model: experiment.model }),\n ...(experiment.reasoningEffort === undefined\n ? {}\n : { reasoningEffort: experiment.reasoningEffort }),\n flags: experiment.flags,\n plugins: experiment.plugins,\n attempts: experiment.attempts,\n earlyExit: experiment.earlyExit,\n sandboxSetupCache: resolveSandboxSetupCache(undefined, experiment.sandboxCache, config.sandboxCache),\n ...(experiment.sandbox === undefined ? {} : { sandbox: experiment.sandbox }),\n sandboxReuse: experiment.sandboxReuse,\n ...(experiment.sharedState === undefined ? {} : { sharedState: experiment.sharedState }),\n ...(experiment.judgeRuntime === undefined ? {} : { judgeRuntime: experiment.judgeRuntime }),\n ...resolveRunTimeout(undefined, experiment.timeoutMs),\n ...(experiment.budget === undefined ? {} : { budget: experiment.budget }),\n experimentId: experiment.id,\n experimentBaseDir: experiment.baseDir,\n experimentSourcePath: experiment.sourcePath,\n ...(experiment.description === undefined\n ? {}\n : { description: experiment.description }),\n ...(Object.keys(experiment.labels).length === 0\n ? {}\n : { labels: experiment.labels }),\n selectedEvalIds: Object.freeze([...selectedEvalIds]),\n ...(experiment.maxConcurrency === undefined\n ? {}\n : { maxConcurrency: experiment.maxConcurrency }),\n ...(experiment.setup === undefined ? {} : { setup: experiment.setup }),\n ...(experiment.teardown === undefined ? {} : { teardown: experiment.teardown }),\n ...(experiment.classifyFailure === undefined\n ? {}\n : { classifyFailure: experiment.classifyFailure }),\n });\n}\nfunction adoptionRunContext(run: AgentRun): Result.Result<RunContext, ExplicitAdoptionError> {\n const context = canonicalizeRunContext({\n experimentId: run.experimentId,\n execution: {\n adapter: adapterIdentity(run.adapter),\n ...(run.adapter.kind === \"custom\" ? { models: run.models ?? Object.freeze({}) } : {}),\n model: run.model ?? null,\n reasoningEffort: run.reasoningEffort ?? null,\n flags: run.flags,\n experimentHooks: experimentHooksForRun(run),\n },\n labels: run.labels ?? {},\n });\n return Result.isFailure(context)\n ? Result.fail(adoptionError(\"adoption-target-invalid\", `Run Context for \"${run.experimentId}\" is invalid.`))\n : Result.succeed(context.success);\n}\nfunction currentTargetSlotIdentity(input: {\n readonly experimentId: string;\n readonly evalId: string;\n readonly attempt: number;\n readonly inputIdentity: EqualityToken;\n readonly configIdentity: EqualityToken;\n readonly timeout?: DurationLimit;\n}): Effect.Effect<{\n readonly slotId: SlotId;\n readonly evalId: EvalId;\n readonly attemptOrdinal: number;\n readonly executionIdentityDigest: ExecutionIdentityDigest;\n}, ExplicitAdoptionError> {\n return Effect.gen(function* () {\n const digestValue = slotExecutionIdentityDigestHex({\n experimentId: input.experimentId,\n evalId: input.evalId,\n attempt: input.attempt,\n input: input.inputIdentity,\n config: input.configIdentity,\n timeout: input.timeout === undefined\n ? null\n : { domain: input.timeout.domain, milliseconds: input.timeout.milliseconds },\n });\n const digest = yield* decodeBrandedId(ExecutionIdentityDigestSchema, digestValue, \"adoption-target-invalid\", \"Adoption target execution identity\");\n const evalId = yield* decodeBrandedId(EvalIdSchema, input.evalId, \"adoption-target-invalid\", \"Adoption target Eval\");\n const slotId = yield* decodeBrandedId(SlotIdSchema, `slot-${digest}`, \"adoption-target-invalid\", \"Adoption target Slot\");\n return Object.freeze({\n slotId,\n evalId,\n attemptOrdinal: input.attempt,\n executionIdentityDigest: digest,\n });\n });\n}\ninterface CurrentTargetPair {\n readonly renameFingerprint?: (experimentId: string) => string | undefined;\n readonly pair: PreparedRunPair;\n readonly inputIdentity: EqualityToken;\n readonly configIdentity: EqualityToken;\n readonly timeout?: DurationLimit;\n}\n/**\n * Rebuilds current discovery, physical planning, config identity and timeout\n * before any adoption decision. It intentionally plans every selected Eval so\n * a produced Run has the complete current denominator rather than only the\n * manually adopted Members.\n */\n// @concord-code ne-runner-prepare-adoption-target\n// @concord-implements docs/feature/experiments/cache.md\nexport function prepareCurrentAdoptionTarget(input: {\n readonly project: AdoptionProject;\n readonly experimentId: string;\n readonly startedAt: UtcMillis;\n}): Effect.Effect<CurrentAdoptionTarget, ExplicitAdoptionError> {\n return Effect.gen(function* () {\n const experiment = input.project.experiments.find((candidate) => candidate.id === input.experimentId);\n if (experiment === undefined) {\n return yield* Effect.fail(adoptionError(\"adoption-target-experiment-not-found\", `Current discovery does not contain Experiment \"${input.experimentId}\".`));\n }\n const selection = yield* Effect.try({\n try: () => resolveExperimentEvals({\n experimentId: experiment.id,\n selector: experiment.evals,\n cliPatterns: [],\n evals: input.project.evals,\n }),\n catch: (cause) => adoptionError(\"adoption-target-invalid\", `Current Eval selection for \"${experiment.id}\" failed: ${safeMessage(cause)}`),\n });\n if (selection.selectedEvals.length === 0 || experiment.attempts < 1) {\n return yield* Effect.fail(adoptionError(\"adoption-target-invalid\", `Current Experiment \"${experiment.id}\" has no selectable target Slots.`));\n }\n const run = runForExperiment(experiment, selection.selectedEvalIds, input.project.config);\n const pairs = yield* prepareRunSandboxes(selection.selectedEvals, [run], input.project.planningServices, { configTimeoutMs: input.project.config.timeoutMs }).pipe(Effect.mapError((error) => adoptionError(\"adoption-target-planning-failed\", `Current planning for \"${experiment.id}\" failed: ${safeMessage(error)}`)));\n if (pairs.length !== selection.selectedEvals.length) {\n return yield* Effect.fail(adoptionError(\"adoption-target-planning-failed\", `Current planning for \"${experiment.id}\" did not return every selected Eval.`));\n }\n const contextResult = adoptionRunContext(pairs[0]!.run);\n const context = Result.isFailure(contextResult)\n ? yield* Effect.fail(contextResult.failure)\n : contextResult.success;\n const projectPlan = yield* planPreparedProjectTarget(pairs, {\n configJudge: input.project.config.judgeRuntime,\n }).pipe(Effect.mapError((cause) => adoptionError(\"adoption-target-planning-failed\", `Current identity planning for \"${experiment.id}\" failed: ${safeMessage(cause)}`)));\n const plannedPairs: CurrentTargetPair[] = [];\n for (const pair of pairs) {\n const fingerprint = projectPlan.plannedFingerprints.get(pair.key);\n const configHash = projectPlan.plannedConfigHashes.get(pair.key);\n if (fingerprint === undefined || configHash === undefined) {\n return yield* Effect.fail(adoptionError(\"adoption-target-planning-failed\", `Current identity planning omitted Eval \"${pair.evalDef.id}\".`));\n }\n const timeout = resolveAttemptTimeout(run, pair.evalDef, input.project.config);\n if (timeout !== undefined && !Number.isFinite(timeout.timeoutMs)) {\n return yield* Effect.fail(adoptionError(\"adoption-target-invalid\", `Current timeout for \"${pair.evalDef.id}\" is invalid.`));\n }\n const renameFingerprint = projectPlan.renameFingerprintsByKey.get(pair.key);\n plannedPairs.push(Object.freeze({\n ...(renameFingerprint === undefined ? {} : { renameFingerprint }),\n pair,\n inputIdentity: Object.freeze({\n domain: ADOPTION_INPUT_IDENTITY_DOMAIN,\n value: fingerprint,\n }),\n configIdentity: Object.freeze({\n domain: ADOPTION_CONFIG_IDENTITY_DOMAIN,\n value: configHash,\n }),\n ...(timeout === undefined\n ? {}\n : {\n timeout: Object.freeze({\n domain: EXECUTION_DURATION_DOMAIN,\n milliseconds: timeout.timeoutMs,\n }),\n }),\n }));\n }\n const pairByEval = new Map<string, CurrentTargetPair>();\n for (const planned of plannedPairs) {\n if (pairByEval.has(planned.pair.evalDef.id)) {\n return yield* Effect.fail(adoptionError(\"adoption-target-slot-duplicate\", `Current planning produced duplicate Eval \"${planned.pair.evalDef.id}\".`));\n }\n pairByEval.set(planned.pair.evalDef.id, planned);\n }\n const slots: CurrentAdoptionSlot[] = [];\n const seenSlots = new Set<string>();\n for (const evalDef of selection.selectedEvals) {\n const planned = pairByEval.get(evalDef.id);\n if (planned === undefined) {\n return yield* Effect.fail(adoptionError(\"adoption-target-planning-failed\", `Current planning omitted selected Eval \"${evalDef.id}\".`));\n }\n for (let attempt = 0; attempt < run.attempts; attempt += 1) {\n const identity = yield* currentTargetSlotIdentity({\n experimentId: experiment.id,\n evalId: evalDef.id,\n attempt,\n inputIdentity: planned.inputIdentity,\n configIdentity: planned.configIdentity,\n ...(planned.timeout === undefined ? {} : { timeout: planned.timeout }),\n });\n if (seenSlots.has(identity.slotId)) {\n return yield* Effect.fail(adoptionError(\"adoption-target-slot-duplicate\", `Current target produced duplicate Slot \"${identity.slotId}\".`));\n }\n seenSlots.add(identity.slotId);\n const targetSlot = Object.freeze({\n evaluationKind: planned.pair.evalDef.evaluationKind,\n ...(planned.renameFingerprint === undefined ? {} : { renameFingerprint: planned.renameFingerprint }),\n slotId: identity.slotId,\n experimentId: experiment.id,\n evalId: evalDef.id,\n attemptOrdinal: identity.attemptOrdinal,\n attempt,\n inputIdentity: planned.inputIdentity,\n configIdentity: planned.configIdentity,\n executionIdentityDigest: identity.executionIdentityDigest,\n ...(planned.timeout === undefined ? {} : { timeout: planned.timeout }),\n });\n slots.push(targetSlot);\n }\n }\n const byKey = new Map<string, CurrentAdoptionSlot>();\n for (const slot of slots)\n byKey.set(slotKey(slot.evalId, slot.attemptOrdinal), slot);\n const expectedSlots = Object.freeze([...slots]\n .map((slot) => Object.freeze({\n slotId: slot.slotId,\n evalId: Schema.decodeUnknownSync(EvalIdSchema)(slot.evalId),\n attemptOrdinal: slot.attemptOrdinal,\n executionIdentityDigest: slot.executionIdentityDigest,\n }))\n .sort((left, right) => left.slotId < right.slotId ? -1 : left.slotId > right.slotId ? 1 : 0));\n return Object.freeze({\n experimentId: experiment.id,\n startedAt: input.startedAt,\n context,\n expectedSlots,\n slots: Object.freeze([...slots]),\n slotFor: (evalId: string, attempt: number) => byKey.get(slotKey(evalId, attempt)),\n });\n });\n}\nfunction sourceCoreInvalid(message: string): ExplicitAdoptionError {\n return adoptionError(\"adoption-source-core-invalid\", message);\n}\n/** Locates one canonical short locator through the live Record Host session. */\nexport function resolveExplicitAttemptLocator(reader: RecordReadSession, text: string): Effect.Effect<ResolvedAdoptionAttempt, ExplicitAdoptionReadError> {\n return Effect.gen(function* () {\n const parsed = yield* parseExplicitAttemptLocator(text);\n const selected = yield* selectPlanningLocator(reader, parsed.locator);\n const resolved = yield* resolveAttemptLocator({\n reader,\n selection: selected,\n locator: parsed.locator,\n });\n if (resolved.kind === \"not-found\") {\n return yield* Effect.fail(adoptionError(\"adoption-locator-not-found\", `No published current-Record Attempt matches locator \"${parsed.text}\".`));\n }\n if (resolved.kind === \"ambiguous\") {\n return yield* Effect.fail(adoptionError(\"adoption-locator-ambiguous\", `Locator \"${parsed.text}\" resolves to more than one immutable Attempt.`));\n }\n return yield* resolveAdoptionAttempt(reader, resolved.attempt, Object.freeze({\n text: parsed.text,\n locator: parsed.locator,\n attemptId: resolved.attempt.attemptId,\n }));\n });\n}\n/** Validates the origin anchor and evaluates its source Run/Slot metadata. */\nexport function resolveAdoptionAttempt(reader: RecordReadSession, attempt: SelectedAttemptRef, locator?: ExplicitAttemptLocator): Effect.Effect<ResolvedAdoptionAttempt, ExplicitAdoptionReadError> {\n return Effect.gen(function* () {\n const sourceLocator = locator ?? attemptLocatorFor(attempt.attemptId);\n const selected = yield* reader.selectRuns({ runIds: Object.freeze([attempt.originRunId]) });\n if (selected.runRefs.length !== 1) {\n return yield* Effect.fail(sourceCoreInvalid(`Source locator \"${sourceLocator.text}\" has no readable origin Run.`));\n }\n const originRun = yield* reader.readRun(selected.runRefs[0]!);\n if (originRun.state !== \"available\") {\n return yield* Effect.fail(sourceCoreInvalid(`Source locator \"${sourceLocator.text}\" has no readable origin Run.`));\n }\n const attemptRead = yield* reader.readAttempt(attempt);\n if (attemptRead.state !== \"available\") {\n return yield* Effect.fail(sourceCoreInvalid(`Locator \"${sourceLocator.text}\" points at a missing or invalid source Attempt.`));\n }\n const originSlot = originRun.value.document.expectedSlots.find((slot) => slot.slotId === attemptRead.value.document.slotId);\n if (originSlot === undefined) {\n return yield* Effect.fail(sourceCoreInvalid(`Source locator \"${sourceLocator.text}\" has no origin Member.`));\n }\n const matchingMembers = originRun.value.members.filter((member) => member.attempt !== null\n && member.attempt.originRunId === attempt.originRunId\n && member.attempt.attemptId === attempt.attemptId);\n if (matchingMembers.length !== 1) {\n return yield* Effect.fail(sourceCoreInvalid(matchingMembers.length === 0\n ? `Source locator \"${sourceLocator.text}\" has no origin Member.`\n : `Source origin Run for \"${sourceLocator.text}\" has duplicate origin Members.`));\n }\n const reference = detachPlanningReference(reader, attempt);\n if (reference === undefined)\n return yield* Effect.fail(sourceCoreInvalid(`Source locator \"${sourceLocator.text}\" has no exact publication identity.`));\n return Object.freeze({\n reference,\n locator: sourceLocator,\n attempt,\n origin: Object.freeze({\n runId: originRun.value.document.runId,\n slotId: originSlot.slotId,\n startedAt: originRun.value.document.startedAt,\n }),\n originExperimentId: originRun.value.document.experimentId,\n originContext: originRun.value.document.context,\n originEvalId: originSlot.evalId,\n originAttempt: originSlot.attemptOrdinal,\n executionIdentityDigest: originSlot.executionIdentityDigest,\n });\n });\n}\nexport interface AdoptionAttemptFacts {\n readonly scoreComplete: boolean;\n readonly outcome: AttemptOutcome;\n readonly verdict: VerdictState;\n}\n/** Reads the exact Core outcome and its Assertion-derived terminal Verdict together. */\nexport function readAdoptionAttemptFacts(reader: RecordReadSession, source: ResolvedAdoptionAttempt): Effect.Effect<AdoptionAttemptFacts, ExplicitAdoptionReadError> {\n return Effect.gen(function* () {\n const attempt = yield* reader.readAttempt(source.attempt);\n if (attempt.state !== \"available\") {\n return yield* Effect.fail(adoptionError(\"adoption-source-verdict-unavailable\", \"Source Attempt/Core is unavailable.\"));\n }\n const assertions = yield* reader.read(attempt.value.owner, NiceEvalRecordAttachments.assertions);\n if (assertions.state !== \"available\") {\n const detail = assertions.state === \"invalid\" ? \"invalid\" : assertions.state;\n return yield* Effect.fail(adoptionError(\"adoption-source-verdict-unavailable\", `Source Assertions is ${detail}.`));\n }\n const outcome = attempt.value.document.outcome;\n const verdict = foldRecordedAttemptVerdict({ outcome, assertions: assertions.value });\n const score = foldRecordedAttemptScore({ outcome, assertions: assertions.value });\n return Object.freeze({ outcome, verdict, scoreComplete: Result.isSuccess(score) && score.success.state === \"complete\" });\n });\n}\nexport function readAdoptionVerdict(reader: RecordReadSession, source: ResolvedAdoptionAttempt): Effect.Effect<VerdictState, ExplicitAdoptionReadError> {\n return readAdoptionAttemptFacts(reader, source).pipe(Effect.map((facts) => facts.verdict));\n}\n/**\n * Timing is a fixed Runner Activity receipt. No missing, partial, or invalid\n * timing collection is eligible for adoption, including an unbounded target.\n */\nexport function readAdoptionExecutionDuration(reader: RecordReadSession, source: ResolvedAdoptionAttempt): Effect.Effect<DurationLimit, ExplicitAdoptionReadError> {\n return Effect.gen(function* () {\n const attempt = yield* reader.readAttempt(source.attempt);\n if (attempt.state !== \"available\") {\n return yield* Effect.fail(adoptionError(\"adoption-source-observability-unavailable\", `Source timing for locator \"${source.locator.text}\" has no readable Attempt.`));\n }\n const activities = yield* reader.read(attempt.value.owner, NiceEvalRecordAttachments.runnerActivities.attempt);\n if (activities.state !== \"available\") {\n const detail = activities.state === \"invalid\" ? \"invalid\" : activities.state;\n return yield* Effect.fail(adoptionError(\"adoption-source-observability-unavailable\", `Source timing for locator \"${source.locator.text}\" is ${detail}.`));\n }\n const duration = readAttemptExecutionDuration(activities.value);\n if (duration.state !== \"available\") {\n return yield* Effect.fail(adoptionError(\"adoption-source-observability-unavailable\", `Source timing for locator \"${source.locator.text}\" is ${duration.reason}.`));\n }\n return duration.duration;\n });\n}\nfunction executionIdentityComparison(input: {\n readonly source: ExecutionIdentityDigest;\n readonly target: ExecutionIdentityDigest;\n}): ComparisonProvenance {\n const reason = input.source === input.target\n ? \"execution-identity-match\"\n : \"execution-identity-mismatch\";\n return Object.freeze({\n attachment: \"core\" as const,\n recordedClaim: \"execution-identity\" as const,\n sourceState: \"available\" as const,\n result: reason.endsWith(\"-match\") ? \"match\" as const : \"mismatch\" as const,\n reason,\n });\n}\nfunction durationComparison(input: {\n readonly source: DurationLimit;\n readonly target?: DurationLimit;\n}): {\n readonly comparison: ComparisonProvenance;\n readonly failure?: \"adoption-duration-domain-mismatch\" | \"adoption-timeout-exceeded\";\n} {\n if (input.target === undefined) {\n return Object.freeze({\n comparison: Object.freeze({\n attachment: \"niceeval.runner-activities\" as const,\n recordedClaim: \"execution-duration\" as const,\n sourceState: \"available\" as const,\n result: \"match\" as const,\n reason: \"timeout-unbounded\",\n }),\n });\n }\n if (input.source.domain !== input.target.domain) {\n return Object.freeze({\n comparison: Object.freeze({\n attachment: \"niceeval.runner-activities\" as const,\n recordedClaim: \"execution-duration\" as const,\n sourceState: \"available\" as const,\n result: \"mismatch\" as const,\n reason: \"duration-domain-mismatch\",\n }),\n failure: \"adoption-duration-domain-mismatch\",\n });\n }\n if (input.source.milliseconds > input.target.milliseconds) {\n return Object.freeze({\n comparison: Object.freeze({\n attachment: \"niceeval.runner-activities\" as const,\n recordedClaim: \"execution-duration\" as const,\n sourceState: \"available\" as const,\n result: \"mismatch\" as const,\n reason: \"timeout-exceeded\",\n }),\n failure: \"adoption-timeout-exceeded\",\n });\n }\n return Object.freeze({\n comparison: Object.freeze({\n attachment: \"niceeval.runner-activities\" as const,\n recordedClaim: \"execution-duration\" as const,\n sourceState: \"available\" as const,\n result: \"match\" as const,\n reason: \"duration-within-timeout\",\n }),\n });\n}\n/**\n * Builds one accepted reference intent. The Core combined execution identity\n * is compared exactly, but an explicit operator decision may accept a mismatch.\n * The folded Verdict and complete Runner Activity timing remain hard gates.\n */\n// @concord-code ne-runner-prepare-adoption-member\n// @concord-implements docs/feature/experiments/cache.md\nexport function prepareExplicitAdoptionMember(input: {\n readonly reader: RecordReadSession;\n readonly target: CurrentAdoptionTarget;\n readonly source: ResolvedAdoptionAttempt;\n readonly evalId: string;\n readonly attempt: number;\n readonly operatorReason?: string;\n}): Effect.Effect<ExplicitAdoptionMember, ExplicitAdoptionReadError> {\n return Effect.gen(function* () {\n const target = input.target.slotFor(input.evalId, input.attempt);\n if (target === undefined) {\n const code = input.target.slots.some((slot) => slot.evalId === input.evalId)\n ? \"adoption-target-attempt-not-selected\"\n : \"adoption-target-eval-not-selected\";\n return yield* Effect.fail(adoptionError(code, `Current target ${input.target.experimentId}/${input.evalId} does not contain ordinal ${String(input.attempt)}.`));\n }\n const facts = yield* readAdoptionAttemptFacts(input.reader, input.source);\n const verdict = facts.verdict;\n if (facts.outcome !== \"completed\") {\n return yield* Effect.fail(adoptionError(\"adoption-source-verdict-ineligible\", `Source locator \"${input.source.locator.text}\" has Attempt outcome \"${facts.outcome}\" and cannot be explicitly adopted.`));\n }\n if (verdict !== \"passed\" && verdict !== \"failed\") {\n return yield* Effect.fail(adoptionError(\"adoption-source-verdict-ineligible\", `Source locator \"${input.source.locator.text}\" has Verdict \"${verdict}\" and cannot be explicitly adopted.`));\n }\n const executionDuration = yield* readAdoptionExecutionDuration(input.reader, input.source);\n const duration = durationComparison({\n source: executionDuration,\n target: target.timeout,\n });\n if (duration.failure !== undefined) {\n return yield* Effect.fail(adoptionError(duration.failure, duration.failure === \"adoption-timeout-exceeded\"\n ? `Source locator \"${input.source.locator.text}\" exceeds the current timeout.`\n : `Source locator \"${input.source.locator.text}\" uses an incomparable execution-duration domain.`));\n }\n const comparisons = Object.freeze([\n Object.freeze({\n attachment: \"core\" as const,\n recordedClaim: \"attempt-outcome\" as const,\n sourceState: \"available\" as const,\n result: \"match\" as const,\n reason: \"attempt-completed\",\n }),\n executionIdentityComparison({\n source: input.source.executionIdentityDigest,\n target: target.executionIdentityDigest,\n }),\n Object.freeze({\n attachment: \"niceeval.assertions\" as const,\n recordedClaim: \"assertion-verdict\" as const,\n sourceState: \"available\" as const,\n result: \"match\" as const,\n reason: \"verdict-eligible\",\n }),\n duration.comparison,\n ]);\n return Object.freeze({\n target,\n source: input.source,\n locator: input.source.locator.text,\n verdict,\n comparisons,\n ...(input.operatorReason === undefined\n ? {}\n : { operatorReason: input.operatorReason }),\n });\n });\n}\n/** Validates the exact Core Run denominator before the writer records Members. */\nfunction validateExplicitAdoptionMembers(input: {\n readonly target: CurrentAdoptionTarget;\n readonly members: readonly ExplicitAdoptionMember[];\n}): Effect.Effect<void, ExplicitAdoptionError> {\n return Effect.gen(function* () {\n const expected = new Set<string>();\n for (const slot of input.target.expectedSlots) {\n if (expected.has(slot.slotId)) {\n return yield* Effect.fail(adoptionError(\"adoption-target-slot-duplicate\", `Current target lists Slot \"${slot.slotId}\" more than once.`));\n }\n expected.add(slot.slotId);\n }\n const targetSlots = new Set(input.target.slots.map((slot) => String(slot.slotId)));\n if (targetSlots.size !== expected.size\n || [...expected].some((slotId) => !targetSlots.has(slotId))) {\n return yield* Effect.fail(adoptionError(\"adoption-target-invalid\", \"Current target Slot definitions do not exactly match its expected Slot denominator.\"));\n }\n const memberBySlot = new Set<string>();\n for (const member of input.members) {\n const slotId = String(member.target.slotId);\n if (!expected.has(slotId)) {\n return yield* Effect.fail(adoptionError(\"adoption-target-eval-not-selected\", `Explicit adoption selected Slot \"${slotId}\" outside the current target denominator.`));\n }\n if (memberBySlot.has(slotId)) {\n return yield* Effect.fail(adoptionError(\"adoption-target-member-duplicate\", `More than one source attempts to occupy target Slot \"${slotId}\".`));\n }\n memberBySlot.add(slotId);\n }\n return undefined;\n });\n}\n/**\n * Performs Core denominator and Member validation before a writer creates a\n * reference Run. This is the batch's no-business-write boundary.\n */\nexport function buildExplicitAdoptionRunPlan(input: {\n readonly intent: ExplicitAdoptionIntent;\n readonly target: CurrentAdoptionTarget;\n readonly members: readonly ExplicitAdoptionMember[];\n}): Effect.Effect<ExplicitAdoptionRunPlan, ExplicitAdoptionError> {\n return Effect.gen(function* () {\n if (input.members.length === 0) {\n return yield* Effect.fail(adoptionError(\"adoption-target-invalid\", \"Explicit adoption requires at least one reference Member.\"));\n }\n yield* validateExplicitAdoptionMembers(input);\n return Object.freeze({\n intent: input.intent,\n target: input.target,\n members: Object.freeze([...input.members]),\n });\n });\n}\n/** Writes detached plans; publication identity is rechecked by the binding transaction. */\nexport function commitExplicitAdoptionRunPlans(root: RecordRoot, invocationId: string, plans: readonly ExplicitAdoptionRunPlan[]) {\n const storageRoot = recordRootPaths(root)?.portableRoot;\n if (storageRoot === undefined) {\n return Effect.fail(asRunStorageError(new Error(\"Adoption Record root is unavailable to Run storage.\")));\n }\n return Effect.forEach(plans, (plan) => Effect.gen(function* () {\n const experimentId = yield* decodeBrandedId(ExperimentIdSchema, plan.target.experimentId, \"adoption-target-invalid\", \"Adoption target Experiment\");\n const accepted = new Set(plan.members.map((member) => String(member.target.slotId)));\n const writer = yield* recordHost.createReferenceRun({\n root,\n experimentId,\n context: plan.target.context,\n startedAt: plan.target.startedAt,\n expectedSlots: plan.target.expectedSlots,\n writerGeneration: createRunWriterGeneration(`${invocationId}:${plan.target.experimentId}`),\n });\n const writerGeneration = writerGenerationForRunSession(writer);\n if (writerGeneration === undefined) {\n return yield* Effect.fail(asRunStorageError(new Error(\"Run writer generation is unavailable\")));\n }\n yield* createRunResource(storageRoot, {\n runId: String(writer.runId),\n invocationId,\n experimentId: String(experimentId),\n writerGeneration,\n startedAt: new Date(Number(plan.target.startedAt)).toISOString(),\n expectedSlots: plan.target.expectedSlots.map((slot) => ({\n slotId: String(slot.slotId),\n evalId: String(slot.evalId),\n attemptOrdinal: slot.attemptOrdinal,\n executionIdentityDigest: String(slot.executionIdentityDigest),\n })),\n deadlineEpochMs: Date.now() + 30000,\n }).pipe(Effect.mapError(asRunStorageError));\n for (const member of plan.members) {\n yield* stagePlanningReference(writer, {\n slotId: member.target.slotId,\n action: \"accepted\",\n reference: member.source.reference,\n });\n yield* bindAttemptReference(storageRoot, {\n runId: String(writer.runId),\n writerGeneration,\n slotId: String(member.target.slotId),\n action: \"accepted\",\n publicationIdentity: member.source.reference.publicationIdentity,\n deadlineEpochMs: Date.now() + 30000,\n }).pipe(Effect.mapError(asRunStorageError));\n }\n for (const slot of plan.target.expectedSlots) {\n if (accepted.has(String(slot.slotId)))\n continue;\n yield* writer.recordTerminalMember({\n slotId: slot.slotId,\n action: \"not-dispatched\",\n absenceReason: \"early-exit-satisfied\",\n });\n }\n const sealed = yield* writer.seal({ completedAt: plan.target.startedAt });\n yield* closeRunResource(storageRoot, {\n runId: String(writer.runId),\n writerGeneration,\n state: \"completed\",\n completedAt: new Date(Number(plan.target.startedAt)).toISOString(),\n absences: plan.target.expectedSlots\n .filter((slot) => !accepted.has(String(slot.slotId)))\n .map((slot) => ({\n slotId: String(slot.slotId),\n reason: \"early-exit-satisfied\" as const,\n })),\n deadlineEpochMs: Date.now() + 30000,\n }).pipe(Effect.mapError(asRunStorageError));\n return receiptForPlan(plan, sealed.runId);\n }), { concurrency: 1 }).pipe(Effect.scoped, Effect.mapError((cause) => cause instanceof RunStorageError\n ? cause\n : new RunStorageError(\"run-storage-invalid\", safeMessage(cause))));\n}\nfunction receiptForPlan(plan: ExplicitAdoptionRunPlan, runId: RunId): ExplicitAdoptionRunReceipt {\n return Object.freeze({\n experimentId: plan.target.experimentId,\n runId,\n members: Object.freeze(plan.members.map((member) => Object.freeze({\n slotId: member.target.slotId,\n locator: member.locator,\n sourceRunId: member.source.origin.runId,\n attemptId: member.source.attempt.attemptId,\n }))),\n });\n}\n/** A fresh in-memory invocation identity never enters Record Core. */\nexport function createExplicitAdoptionInvocationId(mint: () => string = randomUUID): Effect.Effect<string> {\n return Effect.sync(() => `adoption-${mint()}`);\n}\nexport function adoptionStartedAt(input?: () => string | number): Effect.Effect<UtcMillis, ExplicitAdoptionError> {\n return Effect.sync(() => input?.() ?? Date.now()).pipe(Effect.flatMap((value) => {\n const millis = typeof value === \"number\" ? value : Date.parse(value);\n return utcMillis(millis);\n }));\n}\n/** Opens a Host read session only; dry callers must use this rather than a writer. */\nexport function withAdoptionReader<A, E, R>(input: {\n readonly root: RecordRoot;\n readonly use: (reader: RecordReadSession) => Effect.Effect<A, E, R>;\n}) {\n return Effect.scoped(Effect.gen(function* () {\n const reader = yield* recordHost.openRead({ root: input.root });\n return yield* input.use(reader);\n }));\n}\nexport interface RenameSourceRun {\n readonly runId: RunId;\n readonly experimentId: ExperimentId;\n readonly startedAt: UtcMillis;\n readonly expectedSlots: readonly RecordSlotIdentity[];\n}\nexport function resolveExactAdoptionSourceRun(input: {\n readonly reader: RecordReadSession;\n readonly sourceRunId: string;\n}): Effect.Effect<RenameSourceRun, ExplicitAdoptionReadError> {\n return Effect.gen(function* () {\n const runId = yield* decodeBrandedId(RunIdSchema, input.sourceRunId, \"adoption-source-run-not-found\", \"Adoption source Run\");\n const selected = yield* input.reader.selectRuns({ runIds: Object.freeze([runId]), includePublishedActive: true });\n if (selected.runRefs.length !== 1) {\n return yield* Effect.fail(adoptionError(\"adoption-source-run-not-found\", `Adoption source Run \"${input.sourceRunId}\" is not a published readable Run.`));\n }\n const run = yield* input.reader.readRun(selected.runRefs[0]!);\n if (run.state !== \"available\") {\n return yield* Effect.fail(adoptionError(\"adoption-source-run-not-found\", `Adoption source Run \"${input.sourceRunId}\" is not a published readable Run.`));\n }\n return Object.freeze({\n runId: run.value.document.runId,\n experimentId: run.value.document.experimentId,\n startedAt: run.value.document.startedAt,\n expectedSlots: run.value.document.expectedSlots,\n });\n });\n}\nexport interface RenameAdoptionMember {\n readonly evalId: string;\n readonly attempt: number;\n readonly member: ExplicitAdoptionMember;\n}\nexport interface RenameAdoptionPreflight {\n readonly sourceRun: RenameSourceRun;\n readonly members: readonly RenameAdoptionMember[];\n}\n/**\n * Validates a bijection between one exact source Run and the current target.\n * Every member must qualify before the caller may publish a target Run.\n */\nexport function prepareWholeRunAdoptionMembers(input: {\n readonly intent: ExplicitAdoptionIntent;\n readonly reader: RecordReadSession;\n readonly sourceRun: RenameSourceRun;\n readonly target: CurrentAdoptionTarget;\n readonly operatorReason: string;\n}): Effect.Effect<RenameAdoptionPreflight, ExplicitAdoptionReadError> {\n return Effect.gen(function* () {\n const selected = yield* input.reader.selectRuns({ runIds: [input.sourceRun.runId], includePublishedActive: true });\n const ref = selected.runRefs[0];\n if (ref === undefined || selected.runRefs.length !== 1)\n return yield* Effect.fail(sourceCoreInvalid(\"The exact rename source Run is unavailable.\"));\n const run = yield* input.reader.readRun(ref);\n if (run.state !== \"available\")\n return yield* Effect.fail(sourceCoreInvalid(\"The exact rename source Run is unreadable.\"));\n const sourceSlots = input.sourceRun.expectedSlots;\n const seen = new Set<string>();\n if (sourceSlots.length !== input.target.slots.length || sourceSlots.length === 0)\n return yield* Effect.fail(adoptionError(input.intent === \"rename\" ? \"rename-run-not-closed\" : \"accept-run-not-closed\", \"Source Run and current target must contain the same nonempty Eval/ordinal membership.\"));\n const members: RenameAdoptionMember[] = [];\n for (const sourceSlot of sourceSlots) {\n const key = slotKey(sourceSlot.evalId, sourceSlot.attemptOrdinal);\n const targetSlot = input.target.slotFor(sourceSlot.evalId, sourceSlot.attemptOrdinal);\n if (targetSlot === undefined || seen.has(key))\n return yield* Effect.fail(adoptionError(input.intent === \"rename\" ? \"rename-run-not-closed\" : \"accept-run-not-closed\", `Source position ${sourceSlot.evalId}/${sourceSlot.attemptOrdinal} does not have one exact target.`));\n seen.add(key);\n const sourceMembers = run.value.members.filter((member) => member.document.slotId === sourceSlot.slotId);\n const sourceMember = sourceMembers[0];\n if (sourceMembers.length !== 1 || sourceMember?.attempt == null)\n return yield* Effect.fail(adoptionError(input.intent === \"rename\" ? \"rename-run-not-closed\" : \"accept-run-not-closed\", `Source position ${sourceSlot.evalId}/${sourceSlot.attemptOrdinal} has no unique published Attempt.`));\n const source = yield* resolveAdoptionAttempt(input.reader, sourceMember.attempt);\n if (input.intent === \"rename\" && (!hasProvenNoExperimentHooks(run.value.document.context) ||\n !hasProvenNoExperimentHooks(source.originContext)))\n return yield* Effect.fail(adoptionError(\"rename-behavior-unproven\", `Source locator ${source.locator.text} has opaque or unknown Experiment hook declarations; pure rename cannot be proven.`));\n if (source.originEvalId !== sourceSlot.evalId || source.originAttempt !== sourceSlot.attemptOrdinal)\n return yield* Effect.fail(sourceCoreInvalid(\"Source Member does not retain its exact origin position.\"));\n if (input.intent === \"rename\" && (executionDigestForExperiment(targetSlot, input.sourceRun.experimentId) !== sourceSlot.executionIdentityDigest ||\n executionDigestForExperiment(targetSlot, source.originExperimentId) !== source.executionIdentityDigest))\n return yield* Effect.fail(adoptionError(\"rename-identity-mismatch\", `Source locator ${source.locator.text} has changed or unprovable execution identity; rename cannot adopt it.`));\n if (input.intent === \"rename\" && targetSlot.evaluationKind === \"score\") {\n const facts = yield* readAdoptionAttemptFacts(input.reader, source);\n if (!facts.scoreComplete)\n return yield* Effect.fail(adoptionError(\"adoption-source-verdict-ineligible\", `Source locator ${source.locator.text} has incomplete score.`));\n }\n const member = yield* prepareExplicitAdoptionMember({ reader: input.reader, target: input.target, source,\n evalId: sourceSlot.evalId, attempt: sourceSlot.attemptOrdinal, operatorReason: input.operatorReason });\n members.push(Object.freeze({ evalId: sourceSlot.evalId, attempt: sourceSlot.attemptOrdinal, member }));\n }\n return Object.freeze({ sourceRun: input.sourceRun, members: Object.freeze(members) });\n });\n}\n"]}
1
+ {"version":3,"file":"adoption.js","sourceRoot":"","sources":["adoption.ts"],"names":[],"mappings":";;;AA+KA,kEAMC;AAED,gDAKC;AAED,kDAgBC;AA4GD,oEAmIC;AAKD,sEAqBC;AAED,wDA8CC;AAOD,4DAgBC;AACD,kDAEC;AAKD,sEAiBC;AA2ED,sEAkEC;AAqCD,oEAgBC;AAED,wEA4EC;AAcD,gFAEC;AACD,8CAKC;AAED,gDAQC;AAOD,sEAqBC;AAcD,wEAkDC;AAn8BD,mCAAmC;AACnC,wDAAwD;AACxD,0DAA0D;AAC1D,sDAAmE;AACnE,6DAAgG;AAChG,oDAA4D;AAC5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AE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM;gBACpG,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,cAAc,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc,EAAE,CAAC,CAAC;YAC3G,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;QAC3G,CAAC;QACD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["// @concord-file ne-runner-adoption\n// @concord-implements docs/feature/experiments/cache.md\n// @concord-implements docs/feature/experiments/library.md\nimport { foldRecordedAttemptScore } from \"../eval/record/score.ts\";\nimport { executionDigestForExperiment, hasProvenNoExperimentHooks } from \"./rename-identity.ts\";\nimport { experimentHooksForRun } from \"./record/context.ts\";\nimport { randomUUID } from \"node:crypto\";\nimport { resolve } from \"node:path\";\nimport { Effect, Result, Schema } from \"effect\";\nimport { adapterIdentity } from \"../adapter.ts\";\nimport { encodeAttemptLocator, parseAttemptLocator, type AttemptLocator, } from \"../attempt-locator.ts\";\nimport { resolveAttemptLocator } from \"../attempt-locator-resolution.ts\";\nimport { EXECUTION_DURATION_DOMAIN, readAttemptExecutionDuration, type DurationLimit, type EqualityToken, } from \"../eval/record/eligibility.ts\";\nimport { type ComparisonProvenance, } from \"../eval/record/membership-provenance.ts\";\nimport { foldRecordedAttemptVerdict, type VerdictState } from \"../eval/record/verdict.ts\";\nimport { recordHost } from \"../record/host/runtime.ts\";\nimport { detachPlanningReference, selectPlanningLocator, stagePlanningReference, writerGenerationForRunSession, type PlanningExactReference } from \"../record/host/sqlite-host.ts\";\nimport { NiceEvalRecordAttachments } from \"../record/family/catalog.ts\";\nimport type { RecordReadSession, SelectedAttemptRef, } from \"../record/host/types.ts\";\nimport { EvalIdSchema, ExecutionIdentityDigestSchema, ExperimentIdSchema, RunIdSchema, SlotIdSchema, UtcMillisSchema, } from \"../record/codec/identifiers.ts\";\nimport type { AttemptOutcome, RecordSlotIdentity } from \"../record/model/core.ts\";\nimport { canonicalizeRunContext, type RunContext, } from \"../record/model/run-context.ts\";\nimport type { EvalId, ExperimentId, ExecutionIdentityDigest, RunId, SlotId, UtcMillis, } from \"../record/model/identifiers.ts\";\nimport { makeRecordRoot, recordRootPaths, type RecordRoot, type RecordRootConstructionError, } from \"../record/platform/root.ts\";\nimport type { RecordReaderOpenError, RecordReaderReadError } from \"../record/reader/errors.ts\";\nimport type { RecordWriteError } from \"../record/writer/types.ts\";\nimport { asRunStorageError, bindAttemptReference, closeRunResource, createRunResource, createRunWriterGeneration, RunStorageError, } from \"../run/storage/index.ts\";\nimport type { SandboxPlanningServices } from \"../sandbox/plan.ts\";\nimport { discoverEvals, discoverExperiments, } from \"./discover.ts\";\nimport { resolveExperimentEvals } from \"./eval-selection.ts\";\nimport { slotExecutionIdentityDigestHex } from \"./execution-identity.ts\";\nimport { planPreparedProjectTarget, } from \"./fingerprint.ts\";\nimport { prepareRunSandboxes, type PreparedRunPair } from \"./sandbox-selection.ts\";\nimport { resolveAttemptTimeout, resolveRunTimeout } from \"./timeout.ts\";\nimport { resolveSandboxSetupCache } from \"./types.ts\";\nimport type { AgentRun, Config, DiscoveredEval, DiscoveredExperiment, } from \"./types.ts\";\n/** Shared domains emitted by the current ProjectTarget producer. */\nexport const ADOPTION_INPUT_IDENTITY_DOMAIN = \"niceeval.input/fingerprint-v1\" as const;\nexport const ADOPTION_CONFIG_IDENTITY_DOMAIN = \"niceeval.config/identity-v1\" as const;\nconst ADOPTION_TARGET_SLOT_SEPARATOR = \"\\u0000\";\nexport type ExplicitAdoptionIntent = \"accept\" | \"rename\";\nexport type ExplicitAdoptionFailureCode = \"rename-run-not-closed\" | \"rename-identity-mismatch\" | \"rename-behavior-unproven\" | \"adoption-locator-malformed\" | \"adoption-locator-not-found\" | \"adoption-locator-ambiguous\" | \"adoption-batch-locator-duplicate\" | \"adoption-source-core-invalid\" | \"adoption-source-verdict-unavailable\" | \"adoption-source-observability-unavailable\" | \"adoption-source-verdict-ineligible\" | \"adoption-target-experiment-not-found\" | \"adoption-target-eval-not-selected\" | \"adoption-target-attempt-not-selected\" | \"adoption-target-planning-failed\" | \"adoption-target-invalid\" | \"adoption-target-slot-duplicate\" | \"adoption-target-member-duplicate\" | \"adoption-duration-domain-mismatch\" | \"adoption-timeout-exceeded\" | \"adoption-source-run-required\" | \"adoption-source-run-not-found\" | \"adoption-source-run-mismatch\" | \"accept-run-not-closed\" | \"run-not-found\" | \"adoption-provenance-invalid\" | \"adoption-evaluation-plan-invalid\";\n/** Expected product failures retain a stable code without collapsing Effect causes. */\nexport class ExplicitAdoptionError extends Error {\n readonly name = \"ExplicitAdoptionError\";\n constructor(readonly code: ExplicitAdoptionFailureCode, message: string) {\n super(message);\n }\n}\nexport type ExplicitAdoptionReadError = ExplicitAdoptionError | RecordReaderReadError;\nexport type ExplicitAdoptionOpenError = ExplicitAdoptionError | RecordRootConstructionError | RecordReaderOpenError | RecordReaderReadError | RecordWriteError;\nexport interface AdoptionProjectInput {\n readonly cwd: string;\n readonly config?: Config;\n readonly evals?: readonly DiscoveredEval[];\n readonly experiments?: readonly DiscoveredExperiment[];\n readonly planningServices?: SandboxPlanningServices;\n}\nexport interface AdoptionProject {\n readonly cwd: string;\n readonly config: Config;\n readonly evals: readonly DiscoveredEval[];\n readonly experiments: readonly DiscoveredExperiment[];\n readonly planningServices?: SandboxPlanningServices;\n}\nexport interface ExplicitAttemptLocator {\n readonly text: string;\n readonly locator: AttemptLocator;\n readonly attemptId: SelectedAttemptRef[\"attemptId\"];\n}\ninterface ParsedExplicitAttemptLocator {\n readonly text: string;\n readonly locator: AttemptLocator;\n}\nexport interface ResolvedAdoptionAttempt {\n readonly reference: PlanningExactReference;\n readonly originContext: RunContext;\n readonly locator: ExplicitAttemptLocator;\n readonly attempt: SelectedAttemptRef;\n readonly origin: {\n readonly runId: RunId;\n readonly slotId: SlotId;\n readonly startedAt: UtcMillis;\n };\n readonly originExperimentId: string;\n readonly originEvalId: string;\n readonly originAttempt: number;\n readonly executionIdentityDigest: ExecutionIdentityDigest;\n}\nexport interface CurrentAdoptionSlot {\n readonly evaluationKind: \"pass\" | \"score\";\n readonly renameFingerprint?: (experimentId: string) => string | undefined;\n readonly slotId: SlotId;\n readonly experimentId: string;\n readonly evalId: string;\n /** Durable Slot identity; `attempt` remains the caller-facing selector. */\n readonly attemptOrdinal: number;\n readonly attempt: number;\n readonly inputIdentity: EqualityToken;\n readonly configIdentity: EqualityToken;\n readonly executionIdentityDigest: ExecutionIdentityDigest;\n readonly timeout?: DurationLimit;\n}\nexport interface CurrentAdoptionTarget {\n readonly experimentId: string;\n readonly startedAt: UtcMillis;\n readonly expectedSlots: readonly RecordSlotIdentity[];\n readonly context: RunContext;\n readonly slots: readonly CurrentAdoptionSlot[];\n readonly slotFor: (evalId: string, attempt: number) => CurrentAdoptionSlot | undefined;\n}\nexport interface ExplicitAdoptionMember {\n readonly target: CurrentAdoptionSlot;\n readonly source: ResolvedAdoptionAttempt;\n readonly locator: string;\n readonly verdict: \"passed\" | \"failed\";\n readonly comparisons: readonly ComparisonProvenance[];\n readonly operatorReason?: string;\n}\nexport interface ExplicitAdoptionRunPlan {\n readonly intent: ExplicitAdoptionIntent;\n readonly target: CurrentAdoptionTarget;\n readonly members: readonly ExplicitAdoptionMember[];\n}\nexport interface ExplicitAdoptionMemberReceipt {\n readonly slotId: SlotId;\n readonly locator: string;\n readonly sourceRunId: RunId;\n readonly attemptId: SelectedAttemptRef[\"attemptId\"];\n}\nexport interface ExplicitAdoptionRunReceipt {\n /** Explicit target identity; receipt ordering is never provenance. */\n readonly experimentId: string;\n readonly runId: RunId;\n readonly members: readonly ExplicitAdoptionMemberReceipt[];\n}\n/** Real Host write/open failures after all domain preflight has already passed. */\nexport type ExplicitAdoptionCommitError = RecordWriteError | RecordReaderOpenError | RunStorageError;\nfunction adoptionError(code: ExplicitAdoptionFailureCode, message: string): ExplicitAdoptionError {\n return new ExplicitAdoptionError(code, message);\n}\nfunction safeMessage(cause: unknown): string {\n if (typeof cause === \"object\" && cause !== null) {\n const message = Reflect.get(cause, \"message\");\n if (typeof message === \"string\")\n return message;\n const code = Reflect.get(cause, \"code\");\n if (typeof code === \"string\")\n return code;\n const tag = Reflect.get(cause, \"_tag\");\n if (typeof tag === \"string\")\n return tag;\n }\n return String(cause);\n}\nfunction decodeBrandedId<Id>(schema: Schema.Codec<Id, string>, value: string, code: ExplicitAdoptionFailureCode, label: string): Effect.Effect<Id, ExplicitAdoptionError> {\n const decoded = Schema.decodeUnknownResult(schema)(value);\n return Result.isFailure(decoded)\n ? Effect.fail(adoptionError(code, `${label} is not a current Record identity.`))\n : Effect.succeed(decoded.success);\n}\nfunction utcMillis(value: number): Effect.Effect<UtcMillis, ExplicitAdoptionError> {\n const decoded = Schema.decodeUnknownResult(UtcMillisSchema)(value);\n return Result.isFailure(decoded)\n ? Effect.fail(adoptionError(\"adoption-target-invalid\", \"Adoption timestamp is invalid.\"))\n : Effect.succeed(decoded.success);\n}\nfunction slotKey(evalId: string, attempt: number): string {\n return `${evalId}${ADOPTION_TARGET_SLOT_SEPARATOR}${String(attempt)}`;\n}\nfunction attemptLocatorFor(attemptId: SelectedAttemptRef[\"attemptId\"]): ExplicitAttemptLocator {\n const locator = encodeAttemptLocator(attemptId);\n return Object.freeze({ text: locator, locator, attemptId });\n}\n/** Strict v1 parser accepts only the current canonical short locator. */\nexport function parseExplicitAttemptLocator(value: string): Effect.Effect<ParsedExplicitAttemptLocator, ExplicitAdoptionError> {\n const parsed = parseAttemptLocator(value);\n if (!parsed.valid) {\n return Effect.fail(adoptionError(\"adoption-locator-malformed\", \"An explicit adoption locator must match @1 followed by 12 canonical uppercase Crockford characters.\"));\n }\n return Effect.succeed(Object.freeze({ text: value, locator: parsed.locator }));\n}\n/** Adoption writes only to the discovered project's canonical Record. */\nexport function adoptionRecordRoot(input: {\n readonly cwd: string;\n}): Effect.Effect<RecordRoot, RecordRootConstructionError> {\n const root = makeRecordRoot(resolve(input.cwd, \".niceeval\"));\n return Result.isFailure(root) ? Effect.fail(root.failure) : Effect.succeed(root.success);\n}\n/** Discovery is rerun for both read preflight and the write-session frozen view. */\nexport function loadAdoptionProject(input: AdoptionProjectInput): Effect.Effect<AdoptionProject, ExplicitAdoptionError> {\n return Effect.gen(function* () {\n const cwd = resolve(input.cwd);\n const config = input.config ?? (yield* Effect.fail(adoptionError(\"adoption-target-invalid\", \"An adapter host must supply the resolved project configuration.\")));\n const evals = input.evals ?? (yield* discoverEvals(cwd).pipe(Effect.mapError((error) => adoptionError(\"adoption-target-invalid\", `Current Eval discovery failed: ${error.message}`))));\n const experiments = input.experiments ?? (yield* discoverExperiments(cwd).pipe(Effect.mapError((error) => adoptionError(\"adoption-target-invalid\", `Current Experiment discovery failed: ${error.message}`))));\n return Object.freeze({\n cwd,\n config,\n evals: Object.freeze([...evals]),\n experiments: Object.freeze([...experiments]),\n ...(input.planningServices === undefined\n ? {}\n : { planningServices: input.planningServices }),\n });\n });\n}\nfunction runForExperiment(experiment: DiscoveredExperiment, selectedEvalIds: readonly string[], config: Config): AgentRun {\n return Object.freeze({\n adapter: experiment.adapter,\n ...(experiment.agent === undefined ? {} : { agent: experiment.agent }),\n ...(experiment.models === undefined ? {} : { models: experiment.models }),\n ...(experiment.model === undefined ? {} : { model: experiment.model }),\n ...(experiment.reasoningEffort === undefined\n ? {}\n : { reasoningEffort: experiment.reasoningEffort }),\n flags: experiment.flags,\n plugins: experiment.plugins,\n attempts: experiment.attempts,\n earlyExit: experiment.earlyExit,\n sandboxSetupCache: resolveSandboxSetupCache(undefined, experiment.sandboxCache, config.sandboxCache),\n ...(experiment.sandbox === undefined ? {} : { sandbox: experiment.sandbox }),\n sandboxReuse: experiment.sandboxReuse,\n ...(experiment.sharedState === undefined ? {} : { sharedState: experiment.sharedState }),\n ...(experiment.judgeRuntime === undefined ? {} : { judgeRuntime: experiment.judgeRuntime }),\n ...resolveRunTimeout(undefined, experiment.timeoutMs),\n ...(experiment.budget === undefined ? {} : { budget: experiment.budget }),\n experimentId: experiment.id,\n experimentBaseDir: experiment.baseDir,\n experimentSourcePath: experiment.sourcePath,\n ...(experiment.description === undefined\n ? {}\n : { description: experiment.description }),\n ...(Object.keys(experiment.labels).length === 0\n ? {}\n : { labels: experiment.labels }),\n selectedEvalIds: Object.freeze([...selectedEvalIds]),\n ...(experiment.maxConcurrency === undefined\n ? {}\n : { maxConcurrency: experiment.maxConcurrency }),\n ...(experiment.setup === undefined ? {} : { setup: experiment.setup }),\n ...(experiment.teardown === undefined ? {} : { teardown: experiment.teardown }),\n ...(experiment.classifyFailure === undefined\n ? {}\n : { classifyFailure: experiment.classifyFailure }),\n });\n}\nfunction adoptionRunContext(run: AgentRun): Result.Result<RunContext, ExplicitAdoptionError> {\n const context = canonicalizeRunContext({\n experimentId: run.experimentId,\n execution: {\n adapter: adapterIdentity(run.adapter),\n ...(run.adapter.kind === \"custom\" ? { models: run.models ?? Object.freeze({}) } : {}),\n model: run.model ?? null,\n reasoningEffort: run.reasoningEffort ?? null,\n flags: run.flags,\n experimentHooks: experimentHooksForRun(run),\n },\n labels: run.labels ?? {},\n });\n return Result.isFailure(context)\n ? Result.fail(adoptionError(\"adoption-target-invalid\", `Run Context for \"${run.experimentId}\" is invalid.`))\n : Result.succeed(context.success);\n}\nfunction currentTargetSlotIdentity(input: {\n readonly experimentId: string;\n readonly evalId: string;\n readonly attempt: number;\n readonly inputIdentity: EqualityToken;\n readonly configIdentity: EqualityToken;\n readonly timeout?: DurationLimit;\n}): Effect.Effect<{\n readonly slotId: SlotId;\n readonly evalId: EvalId;\n readonly attemptOrdinal: number;\n readonly executionIdentityDigest: ExecutionIdentityDigest;\n}, ExplicitAdoptionError> {\n return Effect.gen(function* () {\n const digestValue = slotExecutionIdentityDigestHex({\n experimentId: input.experimentId,\n evalId: input.evalId,\n attempt: input.attempt,\n input: input.inputIdentity,\n config: input.configIdentity,\n timeout: input.timeout === undefined\n ? null\n : { domain: input.timeout.domain, milliseconds: input.timeout.milliseconds },\n });\n const digest = yield* decodeBrandedId(ExecutionIdentityDigestSchema, digestValue, \"adoption-target-invalid\", \"Adoption target execution identity\");\n const evalId = yield* decodeBrandedId(EvalIdSchema, input.evalId, \"adoption-target-invalid\", \"Adoption target Eval\");\n const slotId = yield* decodeBrandedId(SlotIdSchema, `slot-${digest}`, \"adoption-target-invalid\", \"Adoption target Slot\");\n return Object.freeze({\n slotId,\n evalId,\n attemptOrdinal: input.attempt,\n executionIdentityDigest: digest,\n });\n });\n}\ninterface CurrentTargetPair {\n readonly renameFingerprint?: (experimentId: string) => string | undefined;\n readonly pair: PreparedRunPair;\n readonly inputIdentity: EqualityToken;\n readonly configIdentity: EqualityToken;\n readonly timeout?: DurationLimit;\n}\n/**\n * Rebuilds current discovery, physical planning, config identity and timeout\n * before any adoption decision. It intentionally plans every selected Eval so\n * a produced Run has the complete current denominator rather than only the\n * manually adopted Members.\n */\n// @concord-code ne-runner-prepare-adoption-target\n// @concord-implements docs/feature/experiments/cache.md\nexport function prepareCurrentAdoptionTarget(input: {\n readonly project: AdoptionProject;\n readonly experimentId: string;\n readonly startedAt: UtcMillis;\n}): Effect.Effect<CurrentAdoptionTarget, ExplicitAdoptionError> {\n return Effect.gen(function* () {\n const experiment = input.project.experiments.find((candidate) => candidate.id === input.experimentId);\n if (experiment === undefined) {\n return yield* Effect.fail(adoptionError(\"adoption-target-experiment-not-found\", `Current discovery does not contain Experiment \"${input.experimentId}\".`));\n }\n const selection = yield* Effect.try({\n try: () => resolveExperimentEvals({\n experimentId: experiment.id,\n models: experiment.models,\n selector: experiment.evals,\n cliPatterns: [],\n evals: input.project.evals,\n }),\n catch: (cause) => adoptionError(\"adoption-target-invalid\", `Current Eval selection for \"${experiment.id}\" failed: ${safeMessage(cause)}`),\n });\n if (selection.selectedEvals.length === 0 || experiment.attempts < 1) {\n return yield* Effect.fail(adoptionError(\"adoption-target-invalid\", `Current Experiment \"${experiment.id}\" has no selectable target Slots.`));\n }\n const run = runForExperiment(experiment, selection.selectedEvalIds, input.project.config);\n const pairs = yield* prepareRunSandboxes(selection.selectedEvals, [run], input.project.planningServices, { configTimeoutMs: input.project.config.timeoutMs }).pipe(Effect.mapError((error) => adoptionError(\"adoption-target-planning-failed\", `Current planning for \"${experiment.id}\" failed: ${safeMessage(error)}`)));\n if (pairs.length !== selection.selectedEvals.length) {\n return yield* Effect.fail(adoptionError(\"adoption-target-planning-failed\", `Current planning for \"${experiment.id}\" did not return every selected Eval.`));\n }\n const contextResult = adoptionRunContext(pairs[0]!.run);\n const context = Result.isFailure(contextResult)\n ? yield* Effect.fail(contextResult.failure)\n : contextResult.success;\n const projectPlan = yield* planPreparedProjectTarget(pairs, {\n configJudge: input.project.config.judgeRuntime,\n }).pipe(Effect.mapError((cause) => adoptionError(\"adoption-target-planning-failed\", `Current identity planning for \"${experiment.id}\" failed: ${safeMessage(cause)}`)));\n const plannedPairs: CurrentTargetPair[] = [];\n for (const pair of pairs) {\n const fingerprint = projectPlan.plannedFingerprints.get(pair.key);\n const configHash = projectPlan.plannedConfigHashes.get(pair.key);\n if (fingerprint === undefined || configHash === undefined) {\n return yield* Effect.fail(adoptionError(\"adoption-target-planning-failed\", `Current identity planning omitted Eval \"${pair.evalDef.id}\".`));\n }\n const timeout = resolveAttemptTimeout(run, pair.evalDef, input.project.config);\n if (timeout !== undefined && !Number.isFinite(timeout.timeoutMs)) {\n return yield* Effect.fail(adoptionError(\"adoption-target-invalid\", `Current timeout for \"${pair.evalDef.id}\" is invalid.`));\n }\n const renameFingerprint = projectPlan.renameFingerprintsByKey.get(pair.key);\n plannedPairs.push(Object.freeze({\n ...(renameFingerprint === undefined ? {} : { renameFingerprint }),\n pair,\n inputIdentity: Object.freeze({\n domain: ADOPTION_INPUT_IDENTITY_DOMAIN,\n value: fingerprint,\n }),\n configIdentity: Object.freeze({\n domain: ADOPTION_CONFIG_IDENTITY_DOMAIN,\n value: configHash,\n }),\n ...(timeout === undefined\n ? {}\n : {\n timeout: Object.freeze({\n domain: EXECUTION_DURATION_DOMAIN,\n milliseconds: timeout.timeoutMs,\n }),\n }),\n }));\n }\n const pairByEval = new Map<string, CurrentTargetPair>();\n for (const planned of plannedPairs) {\n if (pairByEval.has(planned.pair.evalDef.id)) {\n return yield* Effect.fail(adoptionError(\"adoption-target-slot-duplicate\", `Current planning produced duplicate Eval \"${planned.pair.evalDef.id}\".`));\n }\n pairByEval.set(planned.pair.evalDef.id, planned);\n }\n const slots: CurrentAdoptionSlot[] = [];\n const seenSlots = new Set<string>();\n for (const evalDef of selection.selectedEvals) {\n const planned = pairByEval.get(evalDef.id);\n if (planned === undefined) {\n return yield* Effect.fail(adoptionError(\"adoption-target-planning-failed\", `Current planning omitted selected Eval \"${evalDef.id}\".`));\n }\n for (let attempt = 0; attempt < run.attempts; attempt += 1) {\n const identity = yield* currentTargetSlotIdentity({\n experimentId: experiment.id,\n evalId: evalDef.id,\n attempt,\n inputIdentity: planned.inputIdentity,\n configIdentity: planned.configIdentity,\n ...(planned.timeout === undefined ? {} : { timeout: planned.timeout }),\n });\n if (seenSlots.has(identity.slotId)) {\n return yield* Effect.fail(adoptionError(\"adoption-target-slot-duplicate\", `Current target produced duplicate Slot \"${identity.slotId}\".`));\n }\n seenSlots.add(identity.slotId);\n const targetSlot = Object.freeze({\n evaluationKind: planned.pair.evalDef.evaluationKind,\n ...(planned.renameFingerprint === undefined ? {} : { renameFingerprint: planned.renameFingerprint }),\n slotId: identity.slotId,\n experimentId: experiment.id,\n evalId: evalDef.id,\n attemptOrdinal: identity.attemptOrdinal,\n attempt,\n inputIdentity: planned.inputIdentity,\n configIdentity: planned.configIdentity,\n executionIdentityDigest: identity.executionIdentityDigest,\n ...(planned.timeout === undefined ? {} : { timeout: planned.timeout }),\n });\n slots.push(targetSlot);\n }\n }\n const byKey = new Map<string, CurrentAdoptionSlot>();\n for (const slot of slots)\n byKey.set(slotKey(slot.evalId, slot.attemptOrdinal), slot);\n const expectedSlots = Object.freeze([...slots]\n .map((slot) => Object.freeze({\n slotId: slot.slotId,\n evalId: Schema.decodeUnknownSync(EvalIdSchema)(slot.evalId),\n attemptOrdinal: slot.attemptOrdinal,\n executionIdentityDigest: slot.executionIdentityDigest,\n }))\n .sort((left, right) => left.slotId < right.slotId ? -1 : left.slotId > right.slotId ? 1 : 0));\n return Object.freeze({\n experimentId: experiment.id,\n startedAt: input.startedAt,\n context,\n expectedSlots,\n slots: Object.freeze([...slots]),\n slotFor: (evalId: string, attempt: number) => byKey.get(slotKey(evalId, attempt)),\n });\n });\n}\nfunction sourceCoreInvalid(message: string): ExplicitAdoptionError {\n return adoptionError(\"adoption-source-core-invalid\", message);\n}\n/** Locates one canonical short locator through the live Record Host session. */\nexport function resolveExplicitAttemptLocator(reader: RecordReadSession, text: string): Effect.Effect<ResolvedAdoptionAttempt, ExplicitAdoptionReadError> {\n return Effect.gen(function* () {\n const parsed = yield* parseExplicitAttemptLocator(text);\n const selected = yield* selectPlanningLocator(reader, parsed.locator);\n const resolved = yield* resolveAttemptLocator({\n reader,\n selection: selected,\n locator: parsed.locator,\n });\n if (resolved.kind === \"not-found\") {\n return yield* Effect.fail(adoptionError(\"adoption-locator-not-found\", `No published current-Record Attempt matches locator \"${parsed.text}\".`));\n }\n if (resolved.kind === \"ambiguous\") {\n return yield* Effect.fail(adoptionError(\"adoption-locator-ambiguous\", `Locator \"${parsed.text}\" resolves to more than one immutable Attempt.`));\n }\n return yield* resolveAdoptionAttempt(reader, resolved.attempt, Object.freeze({\n text: parsed.text,\n locator: parsed.locator,\n attemptId: resolved.attempt.attemptId,\n }));\n });\n}\n/** Validates the origin anchor and evaluates its source Run/Slot metadata. */\nexport function resolveAdoptionAttempt(reader: RecordReadSession, attempt: SelectedAttemptRef, locator?: ExplicitAttemptLocator): Effect.Effect<ResolvedAdoptionAttempt, ExplicitAdoptionReadError> {\n return Effect.gen(function* () {\n const sourceLocator = locator ?? attemptLocatorFor(attempt.attemptId);\n const selected = yield* reader.selectRuns({ runIds: Object.freeze([attempt.originRunId]) });\n if (selected.runRefs.length !== 1) {\n return yield* Effect.fail(sourceCoreInvalid(`Source locator \"${sourceLocator.text}\" has no readable origin Run.`));\n }\n const originRun = yield* reader.readRun(selected.runRefs[0]!);\n if (originRun.state !== \"available\") {\n return yield* Effect.fail(sourceCoreInvalid(`Source locator \"${sourceLocator.text}\" has no readable origin Run.`));\n }\n const attemptRead = yield* reader.readAttempt(attempt);\n if (attemptRead.state !== \"available\") {\n return yield* Effect.fail(sourceCoreInvalid(`Locator \"${sourceLocator.text}\" points at a missing or invalid source Attempt.`));\n }\n const originSlot = originRun.value.document.expectedSlots.find((slot) => slot.slotId === attemptRead.value.document.slotId);\n if (originSlot === undefined) {\n return yield* Effect.fail(sourceCoreInvalid(`Source locator \"${sourceLocator.text}\" has no origin Member.`));\n }\n const matchingMembers = originRun.value.members.filter((member) => member.attempt !== null\n && member.attempt.originRunId === attempt.originRunId\n && member.attempt.attemptId === attempt.attemptId);\n if (matchingMembers.length !== 1) {\n return yield* Effect.fail(sourceCoreInvalid(matchingMembers.length === 0\n ? `Source locator \"${sourceLocator.text}\" has no origin Member.`\n : `Source origin Run for \"${sourceLocator.text}\" has duplicate origin Members.`));\n }\n const reference = detachPlanningReference(reader, attempt);\n if (reference === undefined)\n return yield* Effect.fail(sourceCoreInvalid(`Source locator \"${sourceLocator.text}\" has no exact publication identity.`));\n return Object.freeze({\n reference,\n locator: sourceLocator,\n attempt,\n origin: Object.freeze({\n runId: originRun.value.document.runId,\n slotId: originSlot.slotId,\n startedAt: originRun.value.document.startedAt,\n }),\n originExperimentId: originRun.value.document.experimentId,\n originContext: originRun.value.document.context,\n originEvalId: originSlot.evalId,\n originAttempt: originSlot.attemptOrdinal,\n executionIdentityDigest: originSlot.executionIdentityDigest,\n });\n });\n}\nexport interface AdoptionAttemptFacts {\n readonly scoreComplete: boolean;\n readonly outcome: AttemptOutcome;\n readonly verdict: VerdictState;\n}\n/** Reads the exact Core outcome and its Assertion-derived terminal Verdict together. */\nexport function readAdoptionAttemptFacts(reader: RecordReadSession, source: ResolvedAdoptionAttempt): Effect.Effect<AdoptionAttemptFacts, ExplicitAdoptionReadError> {\n return Effect.gen(function* () {\n const attempt = yield* reader.readAttempt(source.attempt);\n if (attempt.state !== \"available\") {\n return yield* Effect.fail(adoptionError(\"adoption-source-verdict-unavailable\", \"Source Attempt/Core is unavailable.\"));\n }\n const assertions = yield* reader.read(attempt.value.owner, NiceEvalRecordAttachments.assertions);\n if (assertions.state !== \"available\") {\n const detail = assertions.state === \"invalid\" ? \"invalid\" : assertions.state;\n return yield* Effect.fail(adoptionError(\"adoption-source-verdict-unavailable\", `Source Assertions is ${detail}.`));\n }\n const outcome = attempt.value.document.outcome;\n const verdict = foldRecordedAttemptVerdict({ outcome, assertions: assertions.value });\n const score = foldRecordedAttemptScore({ outcome, assertions: assertions.value });\n return Object.freeze({ outcome, verdict, scoreComplete: Result.isSuccess(score) && score.success.state === \"complete\" });\n });\n}\nexport function readAdoptionVerdict(reader: RecordReadSession, source: ResolvedAdoptionAttempt): Effect.Effect<VerdictState, ExplicitAdoptionReadError> {\n return readAdoptionAttemptFacts(reader, source).pipe(Effect.map((facts) => facts.verdict));\n}\n/**\n * Timing is a fixed Runner Activity receipt. No missing, partial, or invalid\n * timing collection is eligible for adoption, including an unbounded target.\n */\nexport function readAdoptionExecutionDuration(reader: RecordReadSession, source: ResolvedAdoptionAttempt): Effect.Effect<DurationLimit, ExplicitAdoptionReadError> {\n return Effect.gen(function* () {\n const attempt = yield* reader.readAttempt(source.attempt);\n if (attempt.state !== \"available\") {\n return yield* Effect.fail(adoptionError(\"adoption-source-observability-unavailable\", `Source timing for locator \"${source.locator.text}\" has no readable Attempt.`));\n }\n const activities = yield* reader.read(attempt.value.owner, NiceEvalRecordAttachments.runnerActivities.attempt);\n if (activities.state !== \"available\") {\n const detail = activities.state === \"invalid\" ? \"invalid\" : activities.state;\n return yield* Effect.fail(adoptionError(\"adoption-source-observability-unavailable\", `Source timing for locator \"${source.locator.text}\" is ${detail}.`));\n }\n const duration = readAttemptExecutionDuration(activities.value);\n if (duration.state !== \"available\") {\n return yield* Effect.fail(adoptionError(\"adoption-source-observability-unavailable\", `Source timing for locator \"${source.locator.text}\" is ${duration.reason}.`));\n }\n return duration.duration;\n });\n}\nfunction executionIdentityComparison(input: {\n readonly source: ExecutionIdentityDigest;\n readonly target: ExecutionIdentityDigest;\n}): ComparisonProvenance {\n const reason = input.source === input.target\n ? \"execution-identity-match\"\n : \"execution-identity-mismatch\";\n return Object.freeze({\n attachment: \"core\" as const,\n recordedClaim: \"execution-identity\" as const,\n sourceState: \"available\" as const,\n result: reason.endsWith(\"-match\") ? \"match\" as const : \"mismatch\" as const,\n reason,\n });\n}\nfunction durationComparison(input: {\n readonly source: DurationLimit;\n readonly target?: DurationLimit;\n}): {\n readonly comparison: ComparisonProvenance;\n readonly failure?: \"adoption-duration-domain-mismatch\" | \"adoption-timeout-exceeded\";\n} {\n if (input.target === undefined) {\n return Object.freeze({\n comparison: Object.freeze({\n attachment: \"niceeval.runner-activities\" as const,\n recordedClaim: \"execution-duration\" as const,\n sourceState: \"available\" as const,\n result: \"match\" as const,\n reason: \"timeout-unbounded\",\n }),\n });\n }\n if (input.source.domain !== input.target.domain) {\n return Object.freeze({\n comparison: Object.freeze({\n attachment: \"niceeval.runner-activities\" as const,\n recordedClaim: \"execution-duration\" as const,\n sourceState: \"available\" as const,\n result: \"mismatch\" as const,\n reason: \"duration-domain-mismatch\",\n }),\n failure: \"adoption-duration-domain-mismatch\",\n });\n }\n if (input.source.milliseconds > input.target.milliseconds) {\n return Object.freeze({\n comparison: Object.freeze({\n attachment: \"niceeval.runner-activities\" as const,\n recordedClaim: \"execution-duration\" as const,\n sourceState: \"available\" as const,\n result: \"mismatch\" as const,\n reason: \"timeout-exceeded\",\n }),\n failure: \"adoption-timeout-exceeded\",\n });\n }\n return Object.freeze({\n comparison: Object.freeze({\n attachment: \"niceeval.runner-activities\" as const,\n recordedClaim: \"execution-duration\" as const,\n sourceState: \"available\" as const,\n result: \"match\" as const,\n reason: \"duration-within-timeout\",\n }),\n });\n}\n/**\n * Builds one accepted reference intent. The Core combined execution identity\n * is compared exactly, but an explicit operator decision may accept a mismatch.\n * The folded Verdict and complete Runner Activity timing remain hard gates.\n */\n// @concord-code ne-runner-prepare-adoption-member\n// @concord-implements docs/feature/experiments/cache.md\nexport function prepareExplicitAdoptionMember(input: {\n readonly reader: RecordReadSession;\n readonly target: CurrentAdoptionTarget;\n readonly source: ResolvedAdoptionAttempt;\n readonly evalId: string;\n readonly attempt: number;\n readonly operatorReason?: string;\n}): Effect.Effect<ExplicitAdoptionMember, ExplicitAdoptionReadError> {\n return Effect.gen(function* () {\n const target = input.target.slotFor(input.evalId, input.attempt);\n if (target === undefined) {\n const code = input.target.slots.some((slot) => slot.evalId === input.evalId)\n ? \"adoption-target-attempt-not-selected\"\n : \"adoption-target-eval-not-selected\";\n return yield* Effect.fail(adoptionError(code, `Current target ${input.target.experimentId}/${input.evalId} does not contain ordinal ${String(input.attempt)}.`));\n }\n const facts = yield* readAdoptionAttemptFacts(input.reader, input.source);\n const verdict = facts.verdict;\n if (facts.outcome !== \"completed\") {\n return yield* Effect.fail(adoptionError(\"adoption-source-verdict-ineligible\", `Source locator \"${input.source.locator.text}\" has Attempt outcome \"${facts.outcome}\" and cannot be explicitly adopted.`));\n }\n if (verdict !== \"passed\" && verdict !== \"failed\") {\n return yield* Effect.fail(adoptionError(\"adoption-source-verdict-ineligible\", `Source locator \"${input.source.locator.text}\" has Verdict \"${verdict}\" and cannot be explicitly adopted.`));\n }\n const executionDuration = yield* readAdoptionExecutionDuration(input.reader, input.source);\n const duration = durationComparison({\n source: executionDuration,\n target: target.timeout,\n });\n if (duration.failure !== undefined) {\n return yield* Effect.fail(adoptionError(duration.failure, duration.failure === \"adoption-timeout-exceeded\"\n ? `Source locator \"${input.source.locator.text}\" exceeds the current timeout.`\n : `Source locator \"${input.source.locator.text}\" uses an incomparable execution-duration domain.`));\n }\n const comparisons = Object.freeze([\n Object.freeze({\n attachment: \"core\" as const,\n recordedClaim: \"attempt-outcome\" as const,\n sourceState: \"available\" as const,\n result: \"match\" as const,\n reason: \"attempt-completed\",\n }),\n executionIdentityComparison({\n source: input.source.executionIdentityDigest,\n target: target.executionIdentityDigest,\n }),\n Object.freeze({\n attachment: \"niceeval.assertions\" as const,\n recordedClaim: \"assertion-verdict\" as const,\n sourceState: \"available\" as const,\n result: \"match\" as const,\n reason: \"verdict-eligible\",\n }),\n duration.comparison,\n ]);\n return Object.freeze({\n target,\n source: input.source,\n locator: input.source.locator.text,\n verdict,\n comparisons,\n ...(input.operatorReason === undefined\n ? {}\n : { operatorReason: input.operatorReason }),\n });\n });\n}\n/** Validates the exact Core Run denominator before the writer records Members. */\nfunction validateExplicitAdoptionMembers(input: {\n readonly target: CurrentAdoptionTarget;\n readonly members: readonly ExplicitAdoptionMember[];\n}): Effect.Effect<void, ExplicitAdoptionError> {\n return Effect.gen(function* () {\n const expected = new Set<string>();\n for (const slot of input.target.expectedSlots) {\n if (expected.has(slot.slotId)) {\n return yield* Effect.fail(adoptionError(\"adoption-target-slot-duplicate\", `Current target lists Slot \"${slot.slotId}\" more than once.`));\n }\n expected.add(slot.slotId);\n }\n const targetSlots = new Set(input.target.slots.map((slot) => String(slot.slotId)));\n if (targetSlots.size !== expected.size\n || [...expected].some((slotId) => !targetSlots.has(slotId))) {\n return yield* Effect.fail(adoptionError(\"adoption-target-invalid\", \"Current target Slot definitions do not exactly match its expected Slot denominator.\"));\n }\n const memberBySlot = new Set<string>();\n for (const member of input.members) {\n const slotId = String(member.target.slotId);\n if (!expected.has(slotId)) {\n return yield* Effect.fail(adoptionError(\"adoption-target-eval-not-selected\", `Explicit adoption selected Slot \"${slotId}\" outside the current target denominator.`));\n }\n if (memberBySlot.has(slotId)) {\n return yield* Effect.fail(adoptionError(\"adoption-target-member-duplicate\", `More than one source attempts to occupy target Slot \"${slotId}\".`));\n }\n memberBySlot.add(slotId);\n }\n return undefined;\n });\n}\n/**\n * Performs Core denominator and Member validation before a writer creates a\n * reference Run. This is the batch's no-business-write boundary.\n */\nexport function buildExplicitAdoptionRunPlan(input: {\n readonly intent: ExplicitAdoptionIntent;\n readonly target: CurrentAdoptionTarget;\n readonly members: readonly ExplicitAdoptionMember[];\n}): Effect.Effect<ExplicitAdoptionRunPlan, ExplicitAdoptionError> {\n return Effect.gen(function* () {\n if (input.members.length === 0) {\n return yield* Effect.fail(adoptionError(\"adoption-target-invalid\", \"Explicit adoption requires at least one reference Member.\"));\n }\n yield* validateExplicitAdoptionMembers(input);\n return Object.freeze({\n intent: input.intent,\n target: input.target,\n members: Object.freeze([...input.members]),\n });\n });\n}\n/** Writes detached plans; publication identity is rechecked by the binding transaction. */\nexport function commitExplicitAdoptionRunPlans(root: RecordRoot, invocationId: string, plans: readonly ExplicitAdoptionRunPlan[]) {\n const storageRoot = recordRootPaths(root)?.portableRoot;\n if (storageRoot === undefined) {\n return Effect.fail(asRunStorageError(new Error(\"Adoption Record root is unavailable to Run storage.\")));\n }\n return Effect.forEach(plans, (plan) => Effect.gen(function* () {\n const experimentId = yield* decodeBrandedId(ExperimentIdSchema, plan.target.experimentId, \"adoption-target-invalid\", \"Adoption target Experiment\");\n const accepted = new Set(plan.members.map((member) => String(member.target.slotId)));\n const writer = yield* recordHost.createReferenceRun({\n root,\n experimentId,\n context: plan.target.context,\n startedAt: plan.target.startedAt,\n expectedSlots: plan.target.expectedSlots,\n writerGeneration: createRunWriterGeneration(`${invocationId}:${plan.target.experimentId}`),\n });\n const writerGeneration = writerGenerationForRunSession(writer);\n if (writerGeneration === undefined) {\n return yield* Effect.fail(asRunStorageError(new Error(\"Run writer generation is unavailable\")));\n }\n yield* createRunResource(storageRoot, {\n runId: String(writer.runId),\n invocationId,\n experimentId: String(experimentId),\n writerGeneration,\n startedAt: new Date(Number(plan.target.startedAt)).toISOString(),\n expectedSlots: plan.target.expectedSlots.map((slot) => ({\n slotId: String(slot.slotId),\n evalId: String(slot.evalId),\n attemptOrdinal: slot.attemptOrdinal,\n executionIdentityDigest: String(slot.executionIdentityDigest),\n })),\n deadlineEpochMs: Date.now() + 30000,\n }).pipe(Effect.mapError(asRunStorageError));\n for (const member of plan.members) {\n yield* stagePlanningReference(writer, {\n slotId: member.target.slotId,\n action: \"accepted\",\n reference: member.source.reference,\n });\n yield* bindAttemptReference(storageRoot, {\n runId: String(writer.runId),\n writerGeneration,\n slotId: String(member.target.slotId),\n action: \"accepted\",\n publicationIdentity: member.source.reference.publicationIdentity,\n deadlineEpochMs: Date.now() + 30000,\n }).pipe(Effect.mapError(asRunStorageError));\n }\n for (const slot of plan.target.expectedSlots) {\n if (accepted.has(String(slot.slotId)))\n continue;\n yield* writer.recordTerminalMember({\n slotId: slot.slotId,\n action: \"not-dispatched\",\n absenceReason: \"early-exit-satisfied\",\n });\n }\n const sealed = yield* writer.seal({ completedAt: plan.target.startedAt });\n yield* closeRunResource(storageRoot, {\n runId: String(writer.runId),\n writerGeneration,\n state: \"completed\",\n completedAt: new Date(Number(plan.target.startedAt)).toISOString(),\n absences: plan.target.expectedSlots\n .filter((slot) => !accepted.has(String(slot.slotId)))\n .map((slot) => ({\n slotId: String(slot.slotId),\n reason: \"early-exit-satisfied\" as const,\n })),\n deadlineEpochMs: Date.now() + 30000,\n }).pipe(Effect.mapError(asRunStorageError));\n return receiptForPlan(plan, sealed.runId);\n }), { concurrency: 1 }).pipe(Effect.scoped, Effect.mapError((cause) => cause instanceof RunStorageError\n ? cause\n : new RunStorageError(\"run-storage-invalid\", safeMessage(cause))));\n}\nfunction receiptForPlan(plan: ExplicitAdoptionRunPlan, runId: RunId): ExplicitAdoptionRunReceipt {\n return Object.freeze({\n experimentId: plan.target.experimentId,\n runId,\n members: Object.freeze(plan.members.map((member) => Object.freeze({\n slotId: member.target.slotId,\n locator: member.locator,\n sourceRunId: member.source.origin.runId,\n attemptId: member.source.attempt.attemptId,\n }))),\n });\n}\n/** A fresh in-memory invocation identity never enters Record Core. */\nexport function createExplicitAdoptionInvocationId(mint: () => string = randomUUID): Effect.Effect<string> {\n return Effect.sync(() => `adoption-${mint()}`);\n}\nexport function adoptionStartedAt(input?: () => string | number): Effect.Effect<UtcMillis, ExplicitAdoptionError> {\n return Effect.sync(() => input?.() ?? Date.now()).pipe(Effect.flatMap((value) => {\n const millis = typeof value === \"number\" ? value : Date.parse(value);\n return utcMillis(millis);\n }));\n}\n/** Opens a Host read session only; dry callers must use this rather than a writer. */\nexport function withAdoptionReader<A, E, R>(input: {\n readonly root: RecordRoot;\n readonly use: (reader: RecordReadSession) => Effect.Effect<A, E, R>;\n}) {\n return Effect.scoped(Effect.gen(function* () {\n const reader = yield* recordHost.openRead({ root: input.root });\n return yield* input.use(reader);\n }));\n}\nexport interface RenameSourceRun {\n readonly runId: RunId;\n readonly experimentId: ExperimentId;\n readonly startedAt: UtcMillis;\n readonly expectedSlots: readonly RecordSlotIdentity[];\n}\nexport function resolveExactAdoptionSourceRun(input: {\n readonly reader: RecordReadSession;\n readonly sourceRunId: string;\n}): Effect.Effect<RenameSourceRun, ExplicitAdoptionReadError> {\n return Effect.gen(function* () {\n const runId = yield* decodeBrandedId(RunIdSchema, input.sourceRunId, \"adoption-source-run-not-found\", \"Adoption source Run\");\n const selected = yield* input.reader.selectRuns({ runIds: Object.freeze([runId]), includePublishedActive: true });\n if (selected.runRefs.length !== 1) {\n return yield* Effect.fail(adoptionError(\"adoption-source-run-not-found\", `Adoption source Run \"${input.sourceRunId}\" is not a published readable Run.`));\n }\n const run = yield* input.reader.readRun(selected.runRefs[0]!);\n if (run.state !== \"available\") {\n return yield* Effect.fail(adoptionError(\"adoption-source-run-not-found\", `Adoption source Run \"${input.sourceRunId}\" is not a published readable Run.`));\n }\n return Object.freeze({\n runId: run.value.document.runId,\n experimentId: run.value.document.experimentId,\n startedAt: run.value.document.startedAt,\n expectedSlots: run.value.document.expectedSlots,\n });\n });\n}\nexport interface RenameAdoptionMember {\n readonly evalId: string;\n readonly attempt: number;\n readonly member: ExplicitAdoptionMember;\n}\nexport interface RenameAdoptionPreflight {\n readonly sourceRun: RenameSourceRun;\n readonly members: readonly RenameAdoptionMember[];\n}\n/**\n * Validates a bijection between one exact source Run and the current target.\n * Every member must qualify before the caller may publish a target Run.\n */\nexport function prepareWholeRunAdoptionMembers(input: {\n readonly intent: ExplicitAdoptionIntent;\n readonly reader: RecordReadSession;\n readonly sourceRun: RenameSourceRun;\n readonly target: CurrentAdoptionTarget;\n readonly operatorReason: string;\n}): Effect.Effect<RenameAdoptionPreflight, ExplicitAdoptionReadError> {\n return Effect.gen(function* () {\n const selected = yield* input.reader.selectRuns({ runIds: [input.sourceRun.runId], includePublishedActive: true });\n const ref = selected.runRefs[0];\n if (ref === undefined || selected.runRefs.length !== 1)\n return yield* Effect.fail(sourceCoreInvalid(\"The exact rename source Run is unavailable.\"));\n const run = yield* input.reader.readRun(ref);\n if (run.state !== \"available\")\n return yield* Effect.fail(sourceCoreInvalid(\"The exact rename source Run is unreadable.\"));\n const sourceSlots = input.sourceRun.expectedSlots;\n const seen = new Set<string>();\n if (sourceSlots.length !== input.target.slots.length || sourceSlots.length === 0)\n return yield* Effect.fail(adoptionError(input.intent === \"rename\" ? \"rename-run-not-closed\" : \"accept-run-not-closed\", \"Source Run and current target must contain the same nonempty Eval/ordinal membership.\"));\n const members: RenameAdoptionMember[] = [];\n for (const sourceSlot of sourceSlots) {\n const key = slotKey(sourceSlot.evalId, sourceSlot.attemptOrdinal);\n const targetSlot = input.target.slotFor(sourceSlot.evalId, sourceSlot.attemptOrdinal);\n if (targetSlot === undefined || seen.has(key))\n return yield* Effect.fail(adoptionError(input.intent === \"rename\" ? \"rename-run-not-closed\" : \"accept-run-not-closed\", `Source position ${sourceSlot.evalId}/${sourceSlot.attemptOrdinal} does not have one exact target.`));\n seen.add(key);\n const sourceMembers = run.value.members.filter((member) => member.document.slotId === sourceSlot.slotId);\n const sourceMember = sourceMembers[0];\n if (sourceMembers.length !== 1 || sourceMember?.attempt == null)\n return yield* Effect.fail(adoptionError(input.intent === \"rename\" ? \"rename-run-not-closed\" : \"accept-run-not-closed\", `Source position ${sourceSlot.evalId}/${sourceSlot.attemptOrdinal} has no unique published Attempt.`));\n const source = yield* resolveAdoptionAttempt(input.reader, sourceMember.attempt);\n if (input.intent === \"rename\" && (!hasProvenNoExperimentHooks(run.value.document.context) ||\n !hasProvenNoExperimentHooks(source.originContext)))\n return yield* Effect.fail(adoptionError(\"rename-behavior-unproven\", `Source locator ${source.locator.text} has opaque or unknown Experiment hook declarations; pure rename cannot be proven.`));\n if (source.originEvalId !== sourceSlot.evalId || source.originAttempt !== sourceSlot.attemptOrdinal)\n return yield* Effect.fail(sourceCoreInvalid(\"Source Member does not retain its exact origin position.\"));\n if (input.intent === \"rename\" && (executionDigestForExperiment(targetSlot, input.sourceRun.experimentId) !== sourceSlot.executionIdentityDigest ||\n executionDigestForExperiment(targetSlot, source.originExperimentId) !== source.executionIdentityDigest))\n return yield* Effect.fail(adoptionError(\"rename-identity-mismatch\", `Source locator ${source.locator.text} has changed or unprovable execution identity; rename cannot adopt it.`));\n if (input.intent === \"rename\" && targetSlot.evaluationKind === \"score\") {\n const facts = yield* readAdoptionAttemptFacts(input.reader, source);\n if (!facts.scoreComplete)\n return yield* Effect.fail(adoptionError(\"adoption-source-verdict-ineligible\", `Source locator ${source.locator.text} has incomplete score.`));\n }\n const member = yield* prepareExplicitAdoptionMember({ reader: input.reader, target: input.target, source,\n evalId: sourceSlot.evalId, attempt: sourceSlot.attemptOrdinal, operatorReason: input.operatorReason });\n members.push(Object.freeze({ evalId: sourceSlot.evalId, attempt: sourceSlot.attemptOrdinal, member }));\n }\n return Object.freeze({ sourceRun: input.sourceRun, members: Object.freeze(members) });\n });\n}\n"]}
@@ -69,11 +69,25 @@ function resolveExperimentEvals(input) {
69
69
  continue;
70
70
  seen.add(evalDef.id);
71
71
  selectorEvals.push(evalDef);
72
+ if (input.tag !== undefined && !evalDef.tags.includes(input.tag))
73
+ continue;
72
74
  if (!patternFilter(evalDef.id))
73
75
  continue;
74
76
  selectedEvals.push(evalDef);
75
77
  }
76
- return { selectedEvals, selectedEvalIds: selectedEvals.map((e) => e.id), selectorEvals };
78
+ if (input.validateModelRequirements !== false) {
79
+ const errors = selectorEvals.flatMap((evalDef) => {
80
+ const missing = evalDef.requiredModelSlots?.filter((key) => !Object.hasOwn(input.models ?? {}, key)) ?? [];
81
+ return missing.length === 0 ? [] : [`Eval "${evalDef.id}" requires undeclared model slots: ${missing.join(", ")}`];
82
+ });
83
+ if (errors.length > 0)
84
+ throw new TypeError(`Experiment "${experimentId}": ${errors.join("; ")}.`);
85
+ }
86
+ return {
87
+ selectedEvals,
88
+ selectedEvalIds: selectedEvals.map((e) => e.id),
89
+ selectorEvals: input.tag === undefined ? selectorEvals : selectorEvals.filter((evalDef) => evalDef.tags.includes(input.tag)),
90
+ };
77
91
  }
78
92
  /**
79
93
  * 按题型(`EvalDescriptor.evaluationKind`)把选中的 eval 分桶。Experiment admission 与 Eval Group
@@ -1 +1 @@
1
- {"version":3,"file":"eval-selection.js","sourceRoot":"","sources":["eval-selection.ts"],"names":[],"mappings":";;AAOA,4CAUC;AAsBD,wDAgDC;AAUD,sDAOC;AAED,kDAGC;AA7GD,6DAA6D;AAC7D,2DAA2D;AAC3D,6DAA6D;AAC7D,2EAA2E;AAC3E,yDAA6D;AAE7D,sDAAsD;AACtD,SAAgB,gBAAgB,CAAC,OAAuB;IACpD,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,GAAG,CAAC,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CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrB,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;YAC1B,SAAS;QACb,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC;AAC7F,CAAC;AAMD;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,aAAwC;IAC1E,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,OAAO,IAAI,aAAa,EAAE,CAAC;QAClC,CAAC,OAAO,CAAC,cAAc,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC;AACD,uDAAuD;AACvD,SAAgB,mBAAmB,CAAC,GAA8B,EAAE,GAAsC;IACtG,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACzC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["// 纯选题边界:发现结果 → EvalDescriptor 投影 → 用户谓词求值 → selectedEvalIds。\n// CLI 在构造每个 AgentRun 前对候选 eval 各调用一次谓词并把结果落进这里;下游(dry-run、\n// sandbox 查表、fingerprint/carry、attempt 展开、hook ctx、快照)只消费返回的\n// selectedEvalIds,不重新调用用户谓词(见 docs/feature/experiments/library.md「evals」)。\nimport { evalPrefixPredicate } from \"../shared/aggregate.ts\";\nimport type { AgentRun, DiscoveredEval, EvalDescriptor, ExperimentAuthorFields } from \"./types.ts\";\n/** `DiscoveredEval` → 用户谓词可见的显式白名单投影;不透传内部路径/执行字段。 */\nexport function evalDescriptorOf(evalDef: DiscoveredEval): EvalDescriptor {\n return Object.freeze({\n id: evalDef.id,\n ...(evalDef.description !== undefined ? { description: evalDef.description } : {}),\n tags: Object.freeze([...(evalDef.tags ?? [])]),\n evaluationKind: evalDef.evaluationKind ?? \"pass\",\n ...(Object.keys(evalDef.metadata ?? {}).length > 0\n ? { metadata: Object.freeze({ ...evalDef.metadata }) }\n : {}),\n });\n}\nexport interface ResolveExperimentEvalsInput {\n experimentId: string;\n selector: ExperimentAuthorFields[\"evals\"];\n cliPatterns: readonly string[];\n evals: readonly DiscoveredEval[];\n}\nexport interface ResolveExperimentEvalsResult {\n selectedEvals: readonly DiscoveredEval[];\n selectedEvalIds: readonly string[];\n /**\n * 只过了实验自身 `evals` 选择器、还没被 CLI 尾随前缀收窄的那一集——即这个实验的**发现集**。\n * CLI 拿它判定「某个尾随前缀在选中实验里匹配 0 条」:交集为空时两种原因(前缀写错 / 实验本来\n * 就没选中任何 eval)要报不同的错,只看交集分辨不出来。谓词仍然只求值一次。\n */\n selectorEvals: readonly DiscoveredEval[];\n}\n/**\n * 对某个 experiment 的候选 eval 集合各求值谓词一次,与 CLI 追加的位置参数前缀取交集。\n * 返回顺序 = discovery 稳定顺序,id 去重——这是 dry-run、attempt 派发顺序与落盘\n * `selectedEvalIds` 的共同来源(见 docs/feature/eval/README.md「路径即身份」)。\n */\nexport function resolveExperimentEvals(input: ResolveExperimentEvalsInput): ResolveExperimentEvalsResult {\n const { experimentId, selector, cliPatterns, evals } = input;\n const patternFilter = evalPrefixPredicate(cliPatterns.length > 0 ? [...cliPatterns] : undefined);\n let selectorFilter: (evalDef: DiscoveredEval) => boolean;\n if (selector === undefined || selector === \"*\") {\n selectorFilter = () => true;\n }\n else if (typeof selector === \"function\") {\n const predicate = selector;\n selectorFilter = (evalDef) => {\n let result: unknown;\n try {\n result = predicate(evalDescriptorOf(evalDef));\n }\n catch (e) {\n throw new Error(`experiment \"${experimentId}\" evals predicate threw for eval \"${evalDef.id}\": ` +\n `${e instanceof Error ? e.message : String(e)}`, { cause: e });\n }\n if (result instanceof Promise) {\n throw new Error(`experiment \"${experimentId}\" evals predicate returned a Promise for eval \"${evalDef.id}\"; ` +\n \"the predicate must be synchronous — do not await inside evals().\");\n }\n if (typeof result !== \"boolean\") {\n throw new Error(`experiment \"${experimentId}\" evals predicate returned ${JSON.stringify(result)} (not a boolean) ` +\n `for eval \"${evalDef.id}\".`);\n }\n return result;\n };\n }\n else {\n const arrayFilter = evalPrefixPredicate([...selector]);\n selectorFilter = (evalDef) => arrayFilter(evalDef.id);\n }\n const seen = new Set<string>();\n const selectedEvals: DiscoveredEval[] = [];\n const selectorEvals: DiscoveredEval[] = [];\n for (const evalDef of evals) {\n if (seen.has(evalDef.id))\n continue;\n if (!selectorFilter(evalDef))\n continue;\n seen.add(evalDef.id);\n selectorEvals.push(evalDef);\n if (!patternFilter(evalDef.id))\n continue;\n selectedEvals.push(evalDef);\n }\n return { selectedEvals, selectedEvalIds: selectedEvals.map((e) => e.id), selectorEvals };\n}\n/** `resolveExperimentEvals` 选中的 eval 按题型分桶后的 id 列表(见 splitByEvaluationKind)。 */\nexport interface EvaluationKindSplit {\n pass: string[];\n score: string[];\n}\n/**\n * 按题型(`EvalDescriptor.evaluationKind`)把选中的 eval 分桶。Experiment admission 与 Eval Group\n * discovery 用它拒绝混型;Report 仍用同一投影读取 admission 生效前留下的历史 mixed Record。\n */\nexport function splitByEvaluationKind(selectedEvals: readonly DiscoveredEval[]): EvaluationKindSplit {\n const pass: string[] = [];\n const score: string[] = [];\n for (const evalDef of selectedEvals) {\n (evalDef.evaluationKind === \"score\" ? score : pass).push(evalDef.id);\n }\n return { pass, score };\n}\n/** 所有消费者按已解析的 `selectedEvalIds` 取 eval;不持有、不调用用户谓词。 */\nexport function selectedEvalsForRun(all: readonly DiscoveredEval[], run: Pick<AgentRun, \"selectedEvalIds\">): DiscoveredEval[] {\n const ids = new Set(run.selectedEvalIds);\n return all.filter((e) => ids.has(e.id));\n}\n"]}
1
+ {"version":3,"file":"eval-selection.js","sourceRoot":"","sources":["eval-selection.ts"],"names":[],"mappings":";;AAQA,4CAUC;AAyBD,wDA8DC;AAUD,sDAOC;AAED,kDAGC;AA9HD,6DAA6D;AAC7D,2DAA2D;AAC3D,6DAA6D;AAC7D,2EAA2E;AAC3E,yDAA6D;AAE7D,sDAAsD;AACtD,SAAgB,gBAAgB,CAAC,OAAuB;IACpD,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,GAAG,CAAC,OAAO,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClF,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;QAC9C,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,MAAM;QAChD,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC;YAC9C,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,EAAE;YACtD,CAAC,CAAC,EAAE,CAAC;KACZ,CAAC,CAAC;AACP,CAAC;AAoBD;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,KAAkC;IACrE,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC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M,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC","sourcesContent":["import type { ResolvedModelSlots } from \"../model-slots.ts\";\n// 纯选题边界:发现结果 → EvalDescriptor 投影 → 用户谓词求值 → selectedEvalIds。\n// CLI 在构造每个 AgentRun 前对候选 eval 各调用一次谓词并把结果落进这里;下游(dry-run、\n// sandbox 查表、fingerprint/carry、attempt 展开、hook ctx、快照)只消费返回的\n// selectedEvalIds,不重新调用用户谓词(见 docs/feature/experiments/library.md「evals」)。\nimport { evalPrefixPredicate } from \"../shared/aggregate.ts\";\nimport type { AgentRun, DiscoveredEval, EvalDescriptor, ExperimentAuthorFields } from \"./types.ts\";\n/** `DiscoveredEval` → 用户谓词可见的显式白名单投影;不透传内部路径/执行字段。 */\nexport function evalDescriptorOf(evalDef: DiscoveredEval): EvalDescriptor {\n return Object.freeze({\n id: evalDef.id,\n ...(evalDef.description !== undefined ? { description: evalDef.description } : {}),\n tags: Object.freeze([...(evalDef.tags ?? [])]),\n evaluationKind: evalDef.evaluationKind ?? \"pass\",\n ...(Object.keys(evalDef.metadata ?? {}).length > 0\n ? { metadata: Object.freeze({ ...evalDef.metadata }) }\n : {}),\n });\n}\nexport interface ResolveExperimentEvalsInput {\n experimentId: string;\n models?: ResolvedModelSlots;\n tag?: string;\n validateModelRequirements?: boolean;\n selector: ExperimentAuthorFields[\"evals\"];\n cliPatterns: readonly string[];\n evals: readonly DiscoveredEval[];\n}\nexport interface ResolveExperimentEvalsResult {\n selectedEvals: readonly DiscoveredEval[];\n selectedEvalIds: readonly string[];\n /**\n * 只过了实验自身 `evals` 选择器、还没被 CLI 尾随前缀收窄的那一集——即这个实验的**发现集**。\n * CLI 拿它判定「某个尾随前缀在选中实验里匹配 0 条」:交集为空时两种原因(前缀写错 / 实验本来\n * 就没选中任何 eval)要报不同的错,只看交集分辨不出来。谓词仍然只求值一次。\n */\n selectorEvals: readonly DiscoveredEval[];\n}\n/**\n * 对某个 experiment 的候选 eval 集合各求值谓词一次,与 CLI 追加的位置参数前缀取交集。\n * 返回顺序 = discovery 稳定顺序,id 去重——这是 dry-run、attempt 派发顺序与落盘\n * `selectedEvalIds` 的共同来源(见 docs/feature/eval/README.md「路径即身份」)。\n */\nexport function resolveExperimentEvals(input: ResolveExperimentEvalsInput): ResolveExperimentEvalsResult {\n const { experimentId, selector, cliPatterns, evals } = input;\n const patternFilter = evalPrefixPredicate(cliPatterns.length > 0 ? [...cliPatterns] : undefined);\n let selectorFilter: (evalDef: DiscoveredEval) => boolean;\n if (selector === undefined || selector === \"*\") {\n selectorFilter = () => true;\n }\n else if (typeof selector === \"function\") {\n const predicate = selector;\n selectorFilter = (evalDef) => {\n let result: unknown;\n try {\n result = predicate(evalDescriptorOf(evalDef));\n }\n catch (e) {\n throw new Error(`experiment \"${experimentId}\" evals predicate threw for eval \"${evalDef.id}\": ` +\n `${e instanceof Error ? e.message : String(e)}`, { cause: e });\n }\n if (result instanceof Promise) {\n throw new Error(`experiment \"${experimentId}\" evals predicate returned a Promise for eval \"${evalDef.id}\"; ` +\n \"the predicate must be synchronous — do not await inside evals().\");\n }\n if (typeof result !== \"boolean\") {\n throw new Error(`experiment \"${experimentId}\" evals predicate returned ${JSON.stringify(result)} (not a boolean) ` +\n `for eval \"${evalDef.id}\".`);\n }\n return result;\n };\n }\n else {\n const arrayFilter = evalPrefixPredicate([...selector]);\n selectorFilter = (evalDef) => arrayFilter(evalDef.id);\n }\n const seen = new Set<string>();\n const selectedEvals: DiscoveredEval[] = [];\n const selectorEvals: DiscoveredEval[] = [];\n for (const evalDef of evals) {\n if (seen.has(evalDef.id))\n continue;\n if (!selectorFilter(evalDef))\n continue;\n seen.add(evalDef.id);\n selectorEvals.push(evalDef);\n if (input.tag !== undefined && !evalDef.tags.includes(input.tag))\n continue;\n if (!patternFilter(evalDef.id))\n continue;\n selectedEvals.push(evalDef);\n }\n if (input.validateModelRequirements !== false) {\n const errors = selectorEvals.flatMap((evalDef) => {\n const missing = evalDef.requiredModelSlots?.filter((key) => !Object.hasOwn(input.models ?? {}, key)) ?? [];\n return missing.length === 0 ? [] : [`Eval \"${evalDef.id}\" requires undeclared model slots: ${missing.join(\", \")}`];\n });\n if (errors.length > 0)\n throw new TypeError(`Experiment \"${experimentId}\": ${errors.join(\"; \")}.`);\n }\n return {\n selectedEvals,\n selectedEvalIds: selectedEvals.map((e) => e.id),\n selectorEvals: input.tag === undefined ? selectorEvals : selectorEvals.filter((evalDef) => evalDef.tags.includes(input.tag!)),\n };\n}\n/** `resolveExperimentEvals` 选中的 eval 按题型分桶后的 id 列表(见 splitByEvaluationKind)。 */\nexport interface EvaluationKindSplit {\n pass: string[];\n score: string[];\n}\n/**\n * 按题型(`EvalDescriptor.evaluationKind`)把选中的 eval 分桶。Experiment admission 与 Eval Group\n * discovery 用它拒绝混型;Report 仍用同一投影读取 admission 生效前留下的历史 mixed Record。\n */\nexport function splitByEvaluationKind(selectedEvals: readonly DiscoveredEval[]): EvaluationKindSplit {\n const pass: string[] = [];\n const score: string[] = [];\n for (const evalDef of selectedEvals) {\n (evalDef.evaluationKind === \"score\" ? score : pass).push(evalDef.id);\n }\n return { pass, score };\n}\n/** 所有消费者按已解析的 `selectedEvalIds` 取 eval;不持有、不调用用户谓词。 */\nexport function selectedEvalsForRun(all: readonly DiscoveredEval[], run: Pick<AgentRun, \"selectedEvalIds\">): DiscoveredEval[] {\n const ids = new Set(run.selectedEvalIds);\n return all.filter((e) => ids.has(e.id));\n}\n"]}
@@ -1,8 +1,12 @@
1
+ import type { ResolvedModelSlots } from "../model-slots.cjs";
1
2
  import type { AgentRun, DiscoveredEval, EvalDescriptor, ExperimentAuthorFields } from "./types.cjs";
2
3
  /** `DiscoveredEval` → 用户谓词可见的显式白名单投影;不透传内部路径/执行字段。 */
3
4
  export declare function evalDescriptorOf(evalDef: DiscoveredEval): EvalDescriptor;
4
5
  export interface ResolveExperimentEvalsInput {
5
6
  experimentId: string;
7
+ models?: ResolvedModelSlots;
8
+ tag?: string;
9
+ validateModelRequirements?: boolean;
6
10
  selector: ExperimentAuthorFields["evals"];
7
11
  cliPatterns: readonly string[];
8
12
  evals: readonly DiscoveredEval[];
@@ -1,8 +1,12 @@
1
+ import type { ResolvedModelSlots } from "../model-slots.mjs";
1
2
  import type { AgentRun, DiscoveredEval, EvalDescriptor, ExperimentAuthorFields } from "./types.mjs";
2
3
  /** `DiscoveredEval` → 用户谓词可见的显式白名单投影;不透传内部路径/执行字段。 */
3
4
  export declare function evalDescriptorOf(evalDef: DiscoveredEval): EvalDescriptor;
4
5
  export interface ResolveExperimentEvalsInput {
5
6
  experimentId: string;
7
+ models?: ResolvedModelSlots;
8
+ tag?: string;
9
+ validateModelRequirements?: boolean;
6
10
  selector: ExperimentAuthorFields["evals"];
7
11
  cliPatterns: readonly string[];
8
12
  evals: readonly DiscoveredEval[];
@@ -1,8 +1,12 @@
1
+ import type { ResolvedModelSlots } from "../model-slots.js";
1
2
  import type { AgentRun, DiscoveredEval, EvalDescriptor, ExperimentAuthorFields } from "./types.js";
2
3
  /** `DiscoveredEval` → 用户谓词可见的显式白名单投影;不透传内部路径/执行字段。 */
3
4
  export declare function evalDescriptorOf(evalDef: DiscoveredEval): EvalDescriptor;
4
5
  export interface ResolveExperimentEvalsInput {
5
6
  experimentId: string;
7
+ models?: ResolvedModelSlots;
8
+ tag?: string;
9
+ validateModelRequirements?: boolean;
6
10
  selector: ExperimentAuthorFields["evals"];
7
11
  cliPatterns: readonly string[];
8
12
  evals: readonly DiscoveredEval[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CASE_LOCK_EXPIRY_MS = exports.CASE_LOCK_HEARTBEAT_INTERVAL_MS = void 0;
3
+ exports.CASE_LOCK_HEARTBEAT_INTERVAL_MS = void 0;
4
4
  exports.readCaseLockEffect = readCaseLockEffect;
5
5
  exports.isCaseLockExpired = isCaseLockExpired;
6
6
  exports.tryAcquireCaseLockOnceEffect = tryAcquireCaseLockOnceEffect;
@@ -11,8 +11,6 @@ const effect_1 = require("effect");
11
11
  const project_state_database_ts_1 = require("../record/sqlite/project-state-database.cjs");
12
12
  const node_process_identity_ts_1 = require("./node-process-identity.cjs");
13
13
  exports.CASE_LOCK_HEARTBEAT_INTERVAL_MS = 10000;
14
- /** Retained for source compatibility; elapsed time never authorizes takeover. */
15
- exports.CASE_LOCK_EXPIRY_MS = 30000;
16
14
  function caseId(experimentId, evalId) {
17
15
  return JSON.stringify([experimentId, evalId]);
18
16
  }