import type { EvalCandidateTrialPublicRecipe } from "@velum-labs/routekit-eval-service/effect"; import { type RepositoryBenchmarkCaseV1, type RepositoryCandidateVisibleTaskV1, type RepositoryCommandRecipeV1, type RepositoryHiddenFixtureSuiteV1, type RepositoryTaskSeedV1 } from "@velum-labs/routekit-eval-setup"; import { RouteKitFailure } from "@velum-labs/routekit-runtime/effect"; import { Effect, FileSystem, Path } from "effect"; type EvalCandidateTrialSourceBase = { readonly repositoryRoot: string; readonly benchmarkArtifactPath: string; readonly benchmarkArtifactDigest: string; readonly foundryPlanDigest: string; readonly benchmarkCase: RepositoryBenchmarkCaseV1; }; /** Private host inputs. Only visibleTask and reviewed publicRecipes reach a candidate. */ export type EvalCandidateTrialSources = (EvalCandidateTrialSourceBase & { readonly lane: "repository-agent"; readonly visibleTask: Extract; readonly repositorySnapshotDigest: string; readonly publicRecipes: readonly EvalCandidateTrialPublicRecipe[]; readonly seed: RepositoryTaskSeedV1; readonly hiddenFixtureSuite: RepositoryHiddenFixtureSuiteV1; readonly allowedRecipes: readonly RepositoryCommandRecipeV1[]; }) | (EvalCandidateTrialSourceBase & { readonly lane: "request"; readonly visibleTask: Extract; }); /** * Derive candidate-visible and private harness inputs from the same exact * bounded artifact. This proves input identity, not independent admission, * semantic adequacy, solver correctness, or routing qualification. */ export declare const loadEvalCandidateTrialSources: (input: { readonly repositoryRoot: string; readonly benchmarkArtifactPath: string; }) => Effect.Effect<{ lane: "request"; visibleTask: { 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; }; }; repositoryRoot: string; benchmarkArtifactPath: string; benchmarkArtifactDigest: string; foundryPlanDigest: string; benchmarkCase: { readonly status: "rejected" | "valid-library" | "routing-eligible" | "routing-active"; readonly id: string; readonly version: 1; readonly lane: "request" | "repository-agent"; readonly capabilityId: string; readonly familyId: string; readonly seedId: string; 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 hidden: { readonly version: 1; readonly caseId: string; readonly fixtures: readonly ({ readonly kind: "historical-regression"; readonly expectationMode: "changes"; readonly id: string; readonly description: string; readonly expectedBehavior: string; readonly source: "historical" | "generated" | "reviewed"; readonly testPath: string; } | { readonly kind: "boundary"; readonly expectationMode: "changes" | "preserved"; readonly id: string; readonly description: string; readonly expectedBehavior: string; readonly source: "historical" | "generated" | "reviewed"; readonly testPath: string; } | { readonly kind: "counterfactual"; readonly expectationMode: "changes"; readonly id: string; readonly description: string; readonly expectedBehavior: string; readonly source: "historical" | "generated" | "reviewed"; readonly testPath: string; } | { readonly kind: "metamorphic"; readonly expectationMode: "preserved"; readonly id: string; readonly description: string; readonly expectedBehavior: string; readonly source: "historical" | "generated" | "reviewed"; readonly testPath: string; })[]; readonly hardFailurePolicy: "any-critical-hard-clause-fails"; readonly clauses: readonly ({ readonly kind: "candidate-policy"; readonly policyId: string; readonly forbiddenPaths: readonly string[]; readonly id: string; readonly critical: boolean; readonly description: string; } | { readonly kind: "test-command"; readonly recipeId: string; readonly expectedExitCode: number; readonly fixtureIds: readonly string[]; readonly id: string; readonly critical: boolean; readonly description: string; } | { readonly id: string; readonly description: string; readonly kind: "json-field"; readonly critical: boolean; readonly pointer: string; readonly operator: "present" | "equals" | "absent"; readonly expectedJson?: string | undefined; } | { readonly id: string; readonly description: string; readonly kind: "ordered-events"; readonly critical: boolean; readonly eventTypes: readonly string[]; readonly terminalEvent?: string | undefined; } | { readonly kind: "property"; readonly propertyId: string; readonly fixtureIds: readonly string[]; readonly id: string; readonly critical: boolean; readonly description: string; } | { readonly kind: "differential"; readonly implementationIds: readonly string[]; readonly fixtureIds: readonly string[]; readonly id: string; readonly critical: boolean; readonly description: string; } | { readonly kind: "architecture"; readonly ruleId: string; readonly expectedPaths: readonly string[]; readonly id: string; readonly critical: boolean; readonly description: string; } | { readonly kind: "transformation-completeness"; readonly ruleId: string; readonly forbiddenLegacyPaths: readonly string[]; readonly requiredNewPaths: readonly string[]; readonly id: string; readonly critical: boolean; readonly description: string; } | { readonly kind: "semantic-residual"; readonly criterion: string; readonly id: string; readonly critical: boolean; readonly description: string; })[]; readonly solutions: readonly { readonly id: string; readonly kind: "mutation" | "historical-reference" | "independent-valid" | "simplified-valid" | "behavior-preserving-valid" | "historical-defect" | "model-near-miss" | "reward-hacking"; readonly family: string; readonly expectedClass: "valid" | "wrong"; readonly commit?: string | undefined; }[]; readonly observations: readonly { readonly detail: string; readonly outcome: "unknown" | "fail" | "pass"; readonly solutionId: string; readonly clauseId: string; readonly repetition: number; readonly inconclusiveReason?: "unattributed-test-failure" | undefined; }[]; readonly knownLimitations: readonly string[]; readonly executionBindingDigest?: string | undefined; readonly executionRepetitions?: number | undefined; }; readonly adequacy: { readonly version: 1; readonly caseId: string; readonly admitted: boolean; readonly validSolutionCount: number; readonly wrongSolutionCount: number; readonly falseRejectedSolutionIds: readonly string[]; readonly falseAcceptedSolutionIds: readonly string[]; readonly unstableSolutionIds: readonly string[]; readonly unobservedClauseIds: readonly string[]; readonly insufficientObservationPairs: readonly string[]; readonly mutationFamilyKills: readonly { readonly family: string; readonly killed: number; readonly total: number; }[]; readonly rejectionReasons: readonly string[]; }; readonly qualityFindings: readonly { readonly axis: "stability" | "authenticity" | "specification-sufficiency" | "oracle-adequacy" | "distinctness" | "realism" | "leakage" | "triviality" | "coverage"; readonly outcome: "fail" | "review-required" | "pass"; readonly detail: string; 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 evidenceIds: readonly string[]; }[]; readonly behavioralFingerprint: string; readonly rejectionReasons: readonly string[]; readonly trajectoryPolicy?: { readonly version: 1; readonly caseId: string; readonly purpose: "routing-signal"; readonly validationRecipeIds: readonly string[]; readonly protectedPaths: readonly string[]; readonly thresholds: { readonly maximumToolCalls: number; readonly maximumFailedToolCalls: number; readonly maximumRepeatedFailedActions: number; }; readonly requirements: { readonly passingValidationAfterLastMutation: boolean; readonly noProtectedPathMutations: boolean; }; readonly rationale: string; } | undefined; }; } | { lane: "repository-agent"; visibleTask: { 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[]; }; repositorySnapshotDigest: string; publicRecipes: EvalCandidateTrialPublicRecipe[]; seed: { readonly status: "rejected" | "candidate" | "qualified"; readonly id: string; readonly version: 1; readonly source: { readonly kind: "historical-fix"; readonly changeEpisodeId: string; } | { readonly kind: "historical-feature"; readonly changeEpisodeId: string; } | { readonly kind: "historical-refactor"; readonly changeEpisodeId: string; } | { readonly kind: "existing-test"; readonly testIds: readonly string[]; } | { readonly kind: "public-api"; readonly surfaceIds: readonly string[]; } | { readonly kind: "schema-contract"; readonly protocolIds: readonly string[]; } | { readonly kind: "production-request"; readonly requestId: string; } | { readonly kind: "reviewed-synthetic-gap"; readonly reviewId: string; }; readonly rejectionReasons: readonly string[]; readonly summary: string; readonly capabilityEvidence: readonly { readonly id: string; readonly kind: "symbol" | "command" | "protocol" | "test" | "schema" | "package" | "public-surface" | "history-episode" | "workload-signal" | "documentation"; readonly path?: string | undefined; }[]; readonly initialState: { readonly commit: string; readonly parentCommit?: string | undefined; }; 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 baselineObservations: readonly { readonly id: string; readonly kind: "schema" | "test-command" | "property" | "event-trace" | "structural"; readonly subjectId: string; readonly outcome: "unknown" | "fail" | "pass"; readonly detail: string; }[]; readonly preChangeObservations: readonly { readonly id: string; readonly kind: "schema" | "test-command" | "property" | "event-trace" | "structural"; readonly subjectId: string; readonly outcome: "unknown" | "fail" | "pass"; readonly detail: string; }[]; readonly postChangeObservations: readonly { readonly id: string; readonly kind: "schema" | "test-command" | "property" | "event-trace" | "structural"; readonly subjectId: string; readonly outcome: "unknown" | "fail" | "pass"; readonly detail: string; }[]; readonly candidateTestIds: readonly string[]; readonly environment: { readonly protectedControlPaths: readonly string[]; readonly trustedPreparationRecipes: readonly { readonly id: string; readonly kind: "custom" | "check" | "test" | "build" | "schema"; readonly cwd: string; readonly executable: string; readonly args: readonly string[]; readonly timeoutMs: number; }[]; readonly candidateValidationRecipes: readonly { readonly id: string; readonly kind: "custom" | "check" | "test" | "build" | "schema"; readonly cwd: string; readonly executable: string; readonly args: readonly string[]; readonly timeoutMs: number; }[]; readonly baselineGradeRecipes: readonly { readonly id: string; readonly kind: "custom" | "check" | "test" | "build" | "schema"; readonly cwd: string; readonly executable: string; readonly args: readonly string[]; readonly timeoutMs: number; }[]; readonly gradeRecipes: readonly { readonly id: string; readonly kind: "custom" | "check" | "test" | "build" | "schema"; readonly cwd: string; readonly executable: string; readonly args: readonly string[]; readonly timeoutMs: number; }[]; readonly packageManager?: { readonly name: "pnpm"; readonly version: string; } | undefined; readonly lockfilePath?: string | undefined; }; readonly confidence: "medium" | "high" | "review-required"; readonly risks: readonly ("review-required" | "ambiguous-intent" | "bundled-change" | "external-service" | "flaky-baseline" | "reference-only-oracle" | "weak-test-delta" | "unrealistic-mutation" | "private-context" | "cross-batch-instability")[]; readonly referenceCommit?: string | undefined; }; hiddenFixtureSuite: { readonly version: 1; readonly caseId: string; readonly fixtures: readonly ({ readonly kind: "historical-regression"; readonly expectationMode: "changes"; readonly id: string; readonly description: string; readonly expectedBehavior: string; readonly source: "historical" | "generated" | "reviewed"; readonly testPath: string; } | { readonly kind: "boundary"; readonly expectationMode: "changes" | "preserved"; readonly id: string; readonly description: string; readonly expectedBehavior: string; readonly source: "historical" | "generated" | "reviewed"; readonly testPath: string; } | { readonly kind: "counterfactual"; readonly expectationMode: "changes"; readonly id: string; readonly description: string; readonly expectedBehavior: string; readonly source: "historical" | "generated" | "reviewed"; readonly testPath: string; } | { readonly kind: "metamorphic"; readonly expectationMode: "preserved"; readonly id: string; readonly description: string; readonly expectedBehavior: string; readonly source: "historical" | "generated" | "reviewed"; readonly testPath: string; })[]; readonly overlays: readonly { readonly path: string; readonly content: string; readonly fixtureIds: readonly string[]; }[]; }; allowedRecipes: { readonly id: string; readonly kind: "custom" | "check" | "test" | "build" | "schema"; readonly cwd: string; readonly executable: string; readonly args: readonly string[]; readonly timeoutMs: number; }[]; repositoryRoot: string; benchmarkArtifactPath: string; benchmarkArtifactDigest: string; foundryPlanDigest: string; benchmarkCase: { readonly status: "rejected" | "valid-library" | "routing-eligible" | "routing-active"; readonly id: string; readonly version: 1; readonly lane: "request" | "repository-agent"; readonly capabilityId: string; readonly familyId: string; readonly seedId: string; 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 hidden: { readonly version: 1; readonly caseId: string; readonly fixtures: readonly ({ readonly kind: "historical-regression"; readonly expectationMode: "changes"; readonly id: string; readonly description: string; readonly expectedBehavior: string; readonly source: "historical" | "generated" | "reviewed"; readonly testPath: string; } | { readonly kind: "boundary"; readonly expectationMode: "changes" | "preserved"; readonly id: string; readonly description: string; readonly expectedBehavior: string; readonly source: "historical" | "generated" | "reviewed"; readonly testPath: string; } | { readonly kind: "counterfactual"; readonly expectationMode: "changes"; readonly id: string; readonly description: string; readonly expectedBehavior: string; readonly source: "historical" | "generated" | "reviewed"; readonly testPath: string; } | { readonly kind: "metamorphic"; readonly expectationMode: "preserved"; readonly id: string; readonly description: string; readonly expectedBehavior: string; readonly source: "historical" | "generated" | "reviewed"; readonly testPath: string; })[]; readonly hardFailurePolicy: "any-critical-hard-clause-fails"; readonly clauses: readonly ({ readonly kind: "candidate-policy"; readonly policyId: string; readonly forbiddenPaths: readonly string[]; readonly id: string; readonly critical: boolean; readonly description: string; } | { readonly kind: "test-command"; readonly recipeId: string; readonly expectedExitCode: number; readonly fixtureIds: readonly string[]; readonly id: string; readonly critical: boolean; readonly description: string; } | { readonly id: string; readonly description: string; readonly kind: "json-field"; readonly critical: boolean; readonly pointer: string; readonly operator: "present" | "equals" | "absent"; readonly expectedJson?: string | undefined; } | { readonly id: string; readonly description: string; readonly kind: "ordered-events"; readonly critical: boolean; readonly eventTypes: readonly string[]; readonly terminalEvent?: string | undefined; } | { readonly kind: "property"; readonly propertyId: string; readonly fixtureIds: readonly string[]; readonly id: string; readonly critical: boolean; readonly description: string; } | { readonly kind: "differential"; readonly implementationIds: readonly string[]; readonly fixtureIds: readonly string[]; readonly id: string; readonly critical: boolean; readonly description: string; } | { readonly kind: "architecture"; readonly ruleId: string; readonly expectedPaths: readonly string[]; readonly id: string; readonly critical: boolean; readonly description: string; } | { readonly kind: "transformation-completeness"; readonly ruleId: string; readonly forbiddenLegacyPaths: readonly string[]; readonly requiredNewPaths: readonly string[]; readonly id: string; readonly critical: boolean; readonly description: string; } | { readonly kind: "semantic-residual"; readonly criterion: string; readonly id: string; readonly critical: boolean; readonly description: string; })[]; readonly solutions: readonly { readonly id: string; readonly kind: "mutation" | "historical-reference" | "independent-valid" | "simplified-valid" | "behavior-preserving-valid" | "historical-defect" | "model-near-miss" | "reward-hacking"; readonly family: string; readonly expectedClass: "valid" | "wrong"; readonly commit?: string | undefined; }[]; readonly observations: readonly { readonly detail: string; readonly outcome: "unknown" | "fail" | "pass"; readonly solutionId: string; readonly clauseId: string; readonly repetition: number; readonly inconclusiveReason?: "unattributed-test-failure" | undefined; }[]; readonly knownLimitations: readonly string[]; readonly executionBindingDigest?: string | undefined; readonly executionRepetitions?: number | undefined; }; readonly adequacy: { readonly version: 1; readonly caseId: string; readonly admitted: boolean; readonly validSolutionCount: number; readonly wrongSolutionCount: number; readonly falseRejectedSolutionIds: readonly string[]; readonly falseAcceptedSolutionIds: readonly string[]; readonly unstableSolutionIds: readonly string[]; readonly unobservedClauseIds: readonly string[]; readonly insufficientObservationPairs: readonly string[]; readonly mutationFamilyKills: readonly { readonly family: string; readonly killed: number; readonly total: number; }[]; readonly rejectionReasons: readonly string[]; }; readonly qualityFindings: readonly { readonly axis: "stability" | "authenticity" | "specification-sufficiency" | "oracle-adequacy" | "distinctness" | "realism" | "leakage" | "triviality" | "coverage"; readonly outcome: "fail" | "review-required" | "pass"; readonly detail: string; 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 evidenceIds: readonly string[]; }[]; readonly behavioralFingerprint: string; readonly rejectionReasons: readonly string[]; readonly trajectoryPolicy?: { readonly version: 1; readonly caseId: string; readonly purpose: "routing-signal"; readonly validationRecipeIds: readonly string[]; readonly protectedPaths: readonly string[]; readonly thresholds: { readonly maximumToolCalls: number; readonly maximumFailedToolCalls: number; readonly maximumRepeatedFailedActions: number; }; readonly requirements: { readonly passingValidationAfterLastMutation: boolean; readonly noProtectedPathMutations: boolean; }; readonly rationale: string; } | undefined; }; }, RouteKitFailure | import("effect/PlatformError").PlatformError | import("@velum-labs/routekit-eval-setup").RepositoryFoundryError, FileSystem.FileSystem | Path.Path>; export {};