import { EvalAuthoringTransport, type RepositoryFoundryModelPlanV1 } from "@velum-labs/routekit-eval-setup"; import { RouteKitFailure } from "@velum-labs/routekit-runtime/effect"; import { Effect, FileSystem, Layer, Path, Schema } from "effect"; import type { FoundryExecutionEvidenceIdentity } from "../../protocols/foundry-execution-evidence.js"; import { type FoundryExecutionEvidenceError } from "../../stores/foundry-execution-evidence.js"; declare const PreparedCalibration: Schema.Struct<{ readonly version: Schema.Literal<1>; readonly kind: Schema.Literal<"development-semantic-calibration-execution">; readonly admissionCredit: Schema.Literal; readonly repositoryRoot: Schema.String; readonly calibrationId: Schema.String; readonly plan: Schema.Struct<{ readonly version: Schema.Literal<1>; readonly policyVersion: Schema.Literal<1>; readonly purpose: Schema.Literal<"development-semantic-calibration">; readonly admissionCredit: Schema.Literal; readonly manifest: Schema.Struct<{ readonly version: Schema.Literal<1>; readonly purpose: Schema.Literal<"development-semantic-calibration">; readonly thresholds: Schema.Struct<{ readonly minimumScenarios: Schema.Finite; readonly minimumValidControls: Schema.Finite; readonly minimumWrongControls: Schema.Finite; readonly maximumFalseValidRate: Schema.Finite; readonly maximumFalseWrongRate: Schema.Finite; readonly maximumUncertaintyRate: Schema.Finite; readonly maximumInstabilityRate: Schema.Finite; readonly requireCompleteExecution: Schema.Literal; }>; readonly examples: Schema.$Array; readonly repository: Schema.Struct<{ readonly id: Schema.String; readonly commit: Schema.String; readonly sourceDigests: Schema.$Array>; }>; readonly input: Schema.Struct<{ readonly requestedDimension: Schema.optionalKey; readonly repositoryEnvironment: Schema.Struct<{ readonly commit: Schema.String; readonly sources: Schema.$Array>; readonly localImports: Schema.Struct<{ readonly commit: Schema.String; readonly sources: Schema.$Array>; readonly omitted: Schema.$Array; }>>; readonly unresolved: Schema.$Array>; readonly dependencyContextVersion: Schema.optionalKey>; readonly dependencies: Schema.optionalKey, Schema.Null]>; readonly resolution: Schema.Literals; readonly paths: Schema.$Array; }>>>; }>; }>; readonly behavioralScope: Schema.optionalKey; readonly behaviorIds: Schema.$Array; readonly description: Schema.String; }>>>; readonly visible: Schema.Union; readonly id: Schema.String; readonly request: Schema.Struct<{ readonly endpoint: Schema.Literals; readonly method: Schema.Literal<"POST">; readonly path: Schema.String; readonly headers: Schema.$Array>; readonly bodyJson: Schema.String; }>; }>, Schema.Struct<{ readonly lane: Schema.Literal<"repository-agent">; readonly id: Schema.String; readonly requestText: Schema.String; readonly checkoutCommit: Schema.String; readonly allowedTools: Schema.$Array>; readonly constraints: Schema.$Array; }>]>; readonly targetBehavior: Schema.$Array; readonly id: Schema.String; readonly path: Schema.optionalKey; }>>; }>>; readonly preChangeSources: Schema.$Array>; readonly solutions: Schema.$Array>; }>>; readonly comparisonSolutionIds: Schema.$Array; }>; readonly adjudication: Schema.Struct<{ readonly kind: Schema.Literals; readonly reservation: Schema.Literal<"not-reserved-holdout">; readonly adjudicatorIds: Schema.$Array; readonly generatorIdentities: Schema.$Array; readonly completedAt: Schema.String; readonly inputDigest: Schema.String; readonly evidence: Schema.$Array; readonly content: Schema.String; readonly sha256: Schema.String; }>, Schema.Struct<{ readonly id: Schema.String; readonly kind: Schema.Literal<"executable-development-check">; readonly checkerSource: Schema.String; readonly checkerSourceSha256: Schema.String; readonly content: Schema.String; readonly sha256: Schema.String; }>]>>; readonly labels: Schema.$Array; readonly rationale: Schema.String; readonly violatedBehaviorIds: Schema.$Array; readonly evidenceIds: Schema.$Array; }>>; }>; readonly exampleDigest: Schema.String; }>>; }>; readonly manifestDigest: Schema.String; readonly modelPlan: Schema.Struct<{ readonly version: Schema.Literal<1>; readonly assignments: Schema.$Array; readonly model: Schema.String; readonly reasoningEffort: Schema.Literals; }>>; }>; readonly validControlReviewVersion: Schema.Union]>; readonly repetitions: Schema.Finite; readonly callCount: Schema.Finite; readonly maximumInputBytesPerCall: Schema.Finite; readonly requiredTotalInputTokens: Schema.Finite; readonly requiredTotalOutputTokens: Schema.Finite; readonly maximumOutputTokensPerCall: Schema.Finite; readonly preparedCritics: Schema.$Array; readonly model: Schema.String; readonly reasoningEffort: Schema.Literals; readonly inputDigest: Schema.String; readonly instructionsDigest: Schema.String; readonly schemaName: Schema.String; readonly schemaDigest: Schema.String; readonly maximumOutputTokens: Schema.Finite; }>>; readonly planDigest: Schema.String; }>; readonly wallTimeMs: Schema.Finite; readonly calibrationDigest: Schema.String; }>; export type FoundrySemanticCalibrationPlan = typeof PreparedCalibration.Type; /** Share the existing repository lifecycle lock; this is not another runner. */ export declare const withFoundrySemanticCalibrationLock: (repositoryRoot: string, operation: Effect.Effect) => Effect.Effect; export declare const foundrySemanticCalibrationExecutionIdentity: (prepared: FoundrySemanticCalibrationPlan) => FoundryExecutionEvidenceIdentity; export declare const summarizeFoundrySemanticCalibrationPlan: (prepared: FoundrySemanticCalibrationPlan) => { calibrationId: string; calibrationDigest: string; planDigest: string; manifestDigest: string; admissionCredit: false; scope: "development-only"; models: string[]; repetitions: number; scenarios: number; maximumModelCalls: number; maximumTotalInputTokens: number; maximumTotalOutputTokens: number; maximumOutputTokensPerCall: number; maximumWallTimeMs: number; thresholds: { readonly minimumScenarios: number; readonly minimumValidControls: number; readonly minimumWrongControls: number; readonly maximumFalseValidRate: number; readonly maximumFalseWrongRate: number; readonly maximumUncertaintyRate: number; readonly maximumInstabilityRate: number; readonly requireCompleteExecution: true; }; pricedExposure: "unknown"; }; /** No transport is available during preparation. Labels are never emitted to stdout. */ export declare const prepareFoundrySemanticCalibration: (input: { readonly repositoryRoot: string; readonly calibrationId: string; readonly manifestPath: string; readonly modelPlan: RepositoryFoundryModelPlanV1; readonly validControlReviewVersion: null | 1 | 2; readonly repetitions: number; readonly wallTimeMs: number; }) => Effect.Effect<{ planPath: string; calibrationId: string; calibrationDigest: string; planDigest: string; manifestDigest: string; admissionCredit: false; scope: "development-only"; models: string[]; repetitions: number; scenarios: number; maximumModelCalls: number; maximumTotalInputTokens: number; maximumTotalOutputTokens: number; maximumOutputTokensPerCall: number; maximumWallTimeMs: number; thresholds: { readonly minimumScenarios: number; readonly minimumValidControls: number; readonly minimumWrongControls: number; readonly maximumFalseValidRate: number; readonly maximumFalseWrongRate: number; readonly maximumUncertaintyRate: number; readonly maximumInstabilityRate: number; readonly requireCompleteExecution: true; }; pricedExposure: "unknown"; operation: "repository-foundry-semantic-calibration-prepare"; }, RouteKitFailure | import("effect/PlatformError").PlatformError, FileSystem.FileSystem | Path.Path>; export declare const loadFoundrySemanticCalibration: (input: { readonly repositoryRoot: string; readonly calibrationDigest: string; }) => Effect.Effect<{ prepared: { readonly version: 1; readonly kind: "development-semantic-calibration-execution"; readonly admissionCredit: false; readonly repositoryRoot: string; readonly calibrationId: string; readonly plan: { readonly version: 1; readonly policyVersion: 1; readonly purpose: "development-semantic-calibration"; readonly admissionCredit: false; readonly manifest: { readonly version: 1; readonly purpose: "development-semantic-calibration"; readonly thresholds: { readonly minimumScenarios: number; readonly minimumValidControls: number; readonly minimumWrongControls: number; readonly maximumFalseValidRate: number; readonly maximumFalseWrongRate: number; readonly maximumUncertaintyRate: number; readonly maximumInstabilityRate: number; readonly requireCompleteExecution: true; }; readonly examples: readonly { readonly id: string; readonly split: "development"; readonly repository: { readonly id: string; readonly commit: string; readonly sourceDigests: readonly { readonly path: string; readonly sha256: string; }[]; }; readonly input: { readonly visible: { readonly lane: "request"; readonly id: string; readonly request: { readonly endpoint: "responses" | "chat" | "anthropic"; readonly method: "POST"; readonly path: string; readonly headers: readonly { readonly name: string; readonly value: string; }[]; readonly bodyJson: string; }; } | { readonly lane: "repository-agent"; readonly id: string; readonly requestText: string; readonly checkoutCommit: string; readonly allowedTools: readonly ("search" | "shell" | "edit" | "read" | "test")[]; readonly constraints: readonly string[]; }; readonly targetBehavior: readonly { readonly id: string; readonly description: string; readonly critical: boolean; readonly evidence: readonly { readonly id: string; readonly kind: "symbol" | "command" | "protocol" | "test" | "schema" | "package" | "public-surface" | "history-episode" | "workload-signal" | "documentation"; readonly path?: string | undefined; }[]; }[]; readonly solutions: readonly { readonly id: string; readonly family: string; readonly fileOverrides: readonly { readonly path: string; readonly content: string; }[]; }[]; readonly repositoryEnvironment: { readonly commit: string; readonly sources: readonly { readonly path: string; readonly content: string; }[]; readonly localImports: { readonly sources: readonly { readonly path: string; readonly content: string; }[]; readonly commit: string; readonly unresolved: readonly { readonly from: string; readonly specifier: string; }[]; readonly omitted: readonly { readonly path: string; readonly reason: "depth" | "file-size" | "total-size" | "file-count"; }[]; readonly dependencyContextVersion?: 1 | 2 | undefined; readonly dependencies?: readonly { readonly from: string; readonly specifier: string; readonly symbols: readonly string[] | null; readonly resolution: "unsupported" | "external" | "unresolved" | "resolved"; readonly paths: readonly string[]; }[] | undefined; }; }; readonly preChangeSources: readonly { readonly path: string; readonly content: string; }[]; readonly comparisonSolutionIds: readonly string[]; readonly requestedDimension?: string | undefined; readonly behavioralScope?: readonly { readonly id: string; readonly kind: "changed" | "preserved"; readonly behaviorIds: readonly string[]; readonly description: string; }[] | undefined; }; readonly adjudication: { readonly kind: "independent-human-development-adjudication" | "independent-executable-development-adjudication"; readonly reservation: "not-reserved-holdout"; readonly adjudicatorIds: readonly string[]; readonly generatorIdentities: readonly string[]; readonly completedAt: string; readonly inputDigest: string; readonly evidence: readonly ({ readonly id: string; readonly kind: "human-review"; readonly content: string; readonly sha256: string; } | { readonly id: string; readonly kind: "executable-development-check"; readonly checkerSource: string; readonly checkerSourceSha256: string; readonly content: string; readonly sha256: string; })[]; readonly labels: readonly { readonly solutionId: string; readonly expectedClass: "valid" | "wrong"; readonly rationale: string; readonly violatedBehaviorIds: readonly string[]; readonly evidenceIds: readonly string[]; }[]; }; readonly exampleDigest: string; }[]; }; readonly manifestDigest: string; readonly modelPlan: { readonly version: 1; readonly assignments: readonly { readonly role: "specification-writer" | "hill-climb-planner" | "oracle-designer" | "repository-analyst" | "specification-critic-a" | "specification-critic-b" | "trajectory-designer" | "trajectory-critic" | "valid-solution-generator-a" | "valid-solution-generator-b" | "adversary" | "solution-critic-a" | "solution-critic-b" | "held-out-adversary" | "held-out-solution-critic-a" | "held-out-solution-critic-b" | "quality-reviewer" | "oracle-critic"; readonly model: string; readonly reasoningEffort: "low" | "medium" | "high" | "xhigh" | "max" | "ultra"; }[]; }; readonly validControlReviewVersion: 1 | 2 | null; readonly repetitions: number; readonly callCount: number; readonly maximumInputBytesPerCall: number; readonly requiredTotalInputTokens: number; readonly requiredTotalOutputTokens: number; readonly maximumOutputTokensPerCall: number; readonly preparedCritics: readonly { readonly exampleId: string; readonly role: "solution-critic-a" | "solution-critic-b"; readonly model: string; readonly reasoningEffort: "low" | "medium" | "high" | "xhigh" | "max" | "ultra"; readonly inputDigest: string; readonly instructionsDigest: string; readonly schemaName: string; readonly schemaDigest: string; readonly maximumOutputTokens: number; }[]; readonly planDigest: string; }; readonly wallTimeMs: number; readonly calibrationDigest: string; }; reportPath: string; observationsPath: string; }, RouteKitFailure | import("effect/PlatformError").PlatformError | FoundryExecutionEvidenceError, FileSystem.FileSystem | Path.Path>; /** * The caller owns the strict session and immutable execution claim. Write each * validated prediction before scheduling more work; partial observations are * evidence, never permission to repeat or admission credit. */ export declare const executeFoundrySemanticCalibration: (input: { readonly loaded: Effect.Success>; readonly transport: Layer.Layer; }) => Effect.Effect<{ reportPath: string; observationsPath: string; reportDigest: string; denominators: { readonly scenarios: number; readonly models: number; readonly critics: number; readonly repetitions: number; readonly distinctControls: number; readonly distinctValidControls: number; readonly distinctWrongControls: number; readonly scheduledCalls: number; readonly scheduledControlClassifications: number; readonly scheduledValidClassifications: number; readonly scheduledWrongClassifications: number; }; counts: { readonly scheduledCalls: number; readonly classifiedCalls: number; readonly malformedCalls: number; readonly executionFailureCalls: number; readonly notRunCalls: number; readonly scheduledControls: number; readonly unscoredControls: number; readonly validAsValid: number; readonly validAsWrong: number; readonly validAsUncertain: number; readonly wrongAsValid: number; readonly wrongAsWrong: number; readonly wrongAsUncertain: number; readonly independenceIndependent: number; readonly independenceCorrelated: number; readonly independenceUncertain: number; readonly repeatabilityGroups: number; readonly stableClassificationGroups: number; readonly changedClassificationGroups: number; readonly incompleteClassificationGroups: number; }; limitations: readonly string[]; calibrationId: string; calibrationDigest: string; planDigest: string; manifestDigest: string; admissionCredit: false; scope: "development-only"; models: string[]; repetitions: number; scenarios: number; maximumModelCalls: number; maximumTotalInputTokens: number; maximumTotalOutputTokens: number; maximumOutputTokensPerCall: number; maximumWallTimeMs: number; thresholds: { readonly minimumScenarios: number; readonly minimumValidControls: number; readonly minimumWrongControls: number; readonly maximumFalseValidRate: number; readonly maximumFalseWrongRate: number; readonly maximumUncertaintyRate: number; readonly maximumInstabilityRate: number; readonly requireCompleteExecution: true; }; pricedExposure: "unknown"; operation: "repository-foundry-semantic-calibration-execute"; }, RouteKitFailure | import("effect/PlatformError").PlatformError | import("@velum-labs/routekit-eval-setup").RepositoryFoundryError | FoundryExecutionEvidenceError, FileSystem.FileSystem | Path.Path>; export {};