@velum-labs/routekit-eval-setup 1.4.0 → 1.5.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.
- package/dist/adapters/authoring-responses-request.d.ts +5 -0
- package/dist/adapters/authoring-responses-request.js +38 -0
- package/dist/adapters/evaluation-evidence-freshness.d.ts +7 -0
- package/dist/adapters/evaluation-evidence-freshness.js +76 -0
- package/dist/adapters/git-task-history.d.ts +67 -0
- package/dist/adapters/git-task-history.js +171 -0
- package/dist/adapters/integrated-repository-history.d.ts +21 -0
- package/dist/adapters/integrated-repository-history.js +175 -0
- package/dist/adapters/repository-command-diagnostic.d.ts +8 -0
- package/dist/adapters/repository-command-diagnostic.js +46 -0
- package/dist/adapters/repository-command-evidence.d.ts +13 -0
- package/dist/adapters/repository-command-evidence.js +102 -0
- package/dist/adapters/repository-command-runner.d.ts +238 -0
- package/dist/adapters/repository-command-runner.js +1483 -0
- package/dist/adapters/repository-import-context.d.ts +47 -0
- package/dist/adapters/repository-import-context.js +469 -0
- package/dist/adapters/repository-node-test-reporter.d.ts +3 -0
- package/dist/adapters/repository-node-test-reporter.js +27 -0
- package/dist/adapters/repository-review-evidence.d.ts +39 -0
- package/dist/adapters/repository-review-evidence.js +632 -0
- package/dist/adapters/repository-seed-selection.d.ts +7 -0
- package/dist/adapters/repository-seed-selection.js +79 -0
- package/dist/adapters/repository-solution-edits.d.ts +49 -0
- package/dist/adapters/repository-solution-edits.js +136 -0
- package/dist/adapters/repository-vitest-phase-adapter.d.ts +8 -0
- package/dist/adapters/repository-vitest-phase-adapter.js +310 -0
- package/dist/adapters/repository-vitest-reporter.d.ts +24 -0
- package/dist/adapters/repository-vitest-reporter.js +314 -0
- package/dist/adapters/strict-authoring-schema.d.ts +5 -0
- package/dist/adapters/strict-authoring-schema.js +158 -0
- package/dist/adapters/test-discovery.d.ts +30 -0
- package/dist/adapters/test-discovery.js +124 -0
- package/dist/adapters/typescript-repository-index.d.ts +51 -0
- package/dist/adapters/typescript-repository-index.js +226 -0
- package/dist/agentic-capabilities-protocol.d.ts +1373 -0
- package/dist/agentic-capabilities-protocol.js +786 -0
- package/dist/case-checkpoint-store.d.ts +29 -0
- package/dist/case-checkpoint-store.js +133 -0
- package/dist/case-pipeline-protocol-v2.d.ts +184 -0
- package/dist/case-pipeline-protocol-v2.js +193 -0
- package/dist/case-pipeline-protocol.d.ts +2626 -0
- package/dist/case-pipeline-protocol.js +371 -0
- package/dist/effect-api.d.ts +74 -12
- package/dist/effect-api.js +56 -7
- package/dist/errors.d.ts +31 -0
- package/dist/errors.js +10 -0
- package/dist/eval-capability-execution-envelope.d.ts +64 -0
- package/dist/eval-capability-execution-envelope.js +98 -0
- package/dist/eval-capability-policy.d.ts +90 -0
- package/dist/eval-capability-policy.js +107 -0
- package/dist/eval-event-log.d.ts +51 -0
- package/dist/eval-event-log.js +69 -10
- package/dist/evaluation-authoring-policy.d.ts +18 -0
- package/dist/evaluation-authoring-policy.js +19 -0
- package/dist/evaluation-authoring-validation.d.ts +22 -0
- package/dist/evaluation-authoring-validation.js +72 -0
- package/dist/evaluation-evidence.d.ts +20 -0
- package/dist/evaluation-evidence.js +319 -0
- package/dist/evaluation-grader-calibration-protocol.d.ts +108 -0
- package/dist/evaluation-grader-calibration-protocol.js +80 -0
- package/dist/evaluation-grader-calibration.d.ts +18 -0
- package/dist/evaluation-grader-calibration.js +334 -0
- package/dist/evaluation-grading-policy.d.ts +24 -0
- package/dist/evaluation-grading-policy.js +54 -0
- package/dist/evaluation-proposal-policy.d.ts +4 -0
- package/dist/evaluation-proposal-policy.js +91 -0
- package/dist/evaluation-source-retrieval.d.ts +68 -0
- package/dist/evaluation-source-retrieval.js +513 -0
- package/dist/evaluation-structure-policy.d.ts +29 -0
- package/dist/evaluation-structure-policy.js +138 -0
- package/dist/index.d.ts +124 -19
- package/dist/index.js +69 -12
- package/dist/inspection.js +2 -3
- package/dist/project-artifacts.d.ts +2 -2
- package/dist/project-artifacts.js +26 -121
- package/dist/project-authoring.d.ts +66 -5
- package/dist/project-authoring.js +783 -109
- package/dist/project-contracts.d.ts +292 -82
- package/dist/project-contracts.js +65 -7
- package/dist/project-store.js +2 -1
- package/dist/project-workflow.d.ts +3 -3
- package/dist/project-workflow.js +116 -18
- package/dist/repository-adversary-protocol.d.ts +64 -0
- package/dist/repository-adversary-protocol.js +105 -0
- package/dist/repository-behavior-protocol.d.ts +188 -0
- package/dist/repository-behavior-protocol.js +202 -0
- package/dist/repository-benchmark-protocol.d.ts +487 -0
- package/dist/repository-benchmark-protocol.js +96 -0
- package/dist/repository-execution-protocol.d.ts +150 -0
- package/dist/repository-execution-protocol.js +38 -0
- package/dist/repository-fixture-instructions.d.ts +3 -0
- package/dist/repository-fixture-instructions.js +91 -0
- package/dist/repository-fixture-protocol.d.ts +79 -0
- package/dist/repository-fixture-protocol.js +79 -0
- package/dist/repository-foundry-plan-protocol.d.ts +118 -0
- package/dist/repository-foundry-plan-protocol.js +296 -0
- package/dist/repository-foundry-progress-protocol.d.ts +52 -0
- package/dist/repository-foundry-progress-protocol.js +52 -0
- package/dist/repository-improvement-protocol.d.ts +100 -0
- package/dist/repository-improvement-protocol.js +106 -0
- package/dist/repository-language-model-protocol.d.ts +43 -0
- package/dist/repository-language-model-protocol.js +146 -0
- package/dist/repository-oracle-coverage-protocol.d.ts +18 -0
- package/dist/repository-oracle-coverage-protocol.js +39 -0
- package/dist/repository-oracle-execution-binding.d.ts +27 -0
- package/dist/repository-oracle-execution-binding.js +59 -0
- package/dist/repository-oracle-protocol.d.ts +230 -0
- package/dist/repository-oracle-protocol.js +156 -0
- package/dist/repository-oracle-scope-policy.d.ts +22 -0
- package/dist/repository-oracle-scope-policy.js +92 -0
- package/dist/repository-quality-policy.d.ts +15 -0
- package/dist/repository-quality-policy.js +357 -0
- package/dist/repository-routing-benchmark-protocol.d.ts +176 -0
- package/dist/repository-routing-benchmark-protocol.js +103 -0
- package/dist/repository-routing-model-protocol.d.ts +36 -0
- package/dist/repository-routing-model-protocol.js +89 -0
- package/dist/repository-routing-plan-protocol.d.ts +112 -0
- package/dist/repository-routing-plan-protocol.js +58 -0
- package/dist/repository-routing-quality-policy.d.ts +9 -0
- package/dist/repository-routing-quality-policy.js +191 -0
- package/dist/repository-seed-qualification-progress-protocol.d.ts +205 -0
- package/dist/repository-seed-qualification-progress-protocol.js +28 -0
- package/dist/repository-semantic-calibration-protocol.d.ts +768 -0
- package/dist/repository-semantic-calibration-protocol.js +276 -0
- package/dist/repository-semantic-calibration.d.ts +163 -0
- package/dist/repository-semantic-calibration.js +581 -0
- package/dist/repository-specification-contract-facts-protocol.d.ts +224 -0
- package/dist/repository-specification-contract-facts-protocol.js +276 -0
- package/dist/repository-specification-critique-protocol.d.ts +189 -0
- package/dist/repository-specification-critique-protocol.js +103 -0
- package/dist/repository-task-family-protocol.d.ts +24 -0
- package/dist/repository-task-family-protocol.js +37 -0
- package/dist/repository-task-seed-protocol.d.ts +384 -0
- package/dist/repository-task-seed-protocol.js +236 -0
- package/dist/repository-trajectory-protocol.d.ts +20 -0
- package/dist/repository-trajectory-protocol.js +42 -0
- package/dist/service.js +1 -1
- package/dist/services/adversary/service.d.ts +64 -0
- package/dist/services/adversary/service.js +330 -0
- package/dist/services/benchmark-compiler/service.d.ts +450 -0
- package/dist/services/benchmark-compiler/service.js +9 -0
- package/dist/services/budgeted-model/service.d.ts +118 -0
- package/dist/services/budgeted-model/service.js +460 -0
- package/dist/services/case-authoring/service.d.ts +163 -0
- package/dist/services/case-authoring/service.js +1456 -0
- package/dist/services/case-finalization/service.d.ts +283 -0
- package/dist/services/case-finalization/service.js +370 -0
- package/dist/services/case-generation/service.d.ts +619 -0
- package/dist/services/case-generation/service.js +2628 -0
- package/dist/services/case-pipeline/service.d.ts +31 -0
- package/dist/services/case-pipeline/service.js +485 -0
- package/dist/services/case-pipeline-v2/service.d.ts +70 -0
- package/dist/services/case-pipeline-v2/service.js +477 -0
- package/dist/services/command-observability/service.d.ts +13 -0
- package/dist/services/command-observability/service.js +3 -0
- package/dist/services/dimension-labeling/service.d.ts +77 -0
- package/dist/services/dimension-labeling/service.js +188 -0
- package/dist/services/eval-candidate/service.d.ts +208 -0
- package/dist/services/eval-candidate/service.js +64 -0
- package/dist/services/eval-capabilities/service.d.ts +183 -0
- package/dist/services/eval-capabilities/service.js +1433 -0
- package/dist/services/eval-environment/service.d.ts +173 -0
- package/dist/services/eval-environment/service.js +127 -0
- package/dist/services/evidence-reconstruction/service.d.ts +36 -0
- package/dist/services/evidence-reconstruction/service.js +145 -0
- package/dist/services/fixture-builder/service.d.ts +62 -0
- package/dist/services/fixture-builder/service.js +36 -0
- package/dist/services/fixture-validation/service.d.ts +75 -0
- package/dist/services/fixture-validation/service.js +295 -0
- package/dist/services/foundry/service.d.ts +831 -0
- package/dist/services/foundry/service.js +442 -0
- package/dist/services/foundry-progress/service.d.ts +62 -0
- package/dist/services/foundry-progress/service.js +149 -0
- package/dist/services/foundry-v2/service.d.ts +54 -0
- package/dist/services/foundry-v2/service.js +28 -0
- package/dist/services/grounded-authoring/service.d.ts +126 -0
- package/dist/services/grounded-authoring/service.js +822 -0
- package/dist/services/historical-case/service.d.ts +722 -0
- package/dist/services/historical-case/service.js +177 -0
- package/dist/services/improvement-loop/service.d.ts +59 -0
- package/dist/services/improvement-loop/service.js +176 -0
- package/dist/services/language-model/service.d.ts +52 -0
- package/dist/services/language-model/service.js +194 -0
- package/dist/services/oracle-builder/service.d.ts +146 -0
- package/dist/services/oracle-builder/service.js +513 -0
- package/dist/services/oracle-coverage/service.d.ts +28 -0
- package/dist/services/oracle-coverage/service.js +50 -0
- package/dist/services/oracle-coverage-witness/service.d.ts +130 -0
- package/dist/services/oracle-coverage-witness/service.js +538 -0
- package/dist/services/pipeline-challenge/service.d.ts +551 -0
- package/dist/services/pipeline-challenge/service.js +427 -0
- package/dist/services/pipeline-controls/service.d.ts +130 -0
- package/dist/services/pipeline-controls/service.js +483 -0
- package/dist/services/pipeline-oracle/service.d.ts +8 -0
- package/dist/services/pipeline-oracle/service.js +256 -0
- package/dist/services/pipeline-seed/service.d.ts +298 -0
- package/dist/services/pipeline-seed/service.js +428 -0
- package/dist/services/pipeline-spec/service.d.ts +103 -0
- package/dist/services/pipeline-spec/service.js +619 -0
- package/dist/services/pipeline-tournament/service.d.ts +258 -0
- package/dist/services/pipeline-tournament/service.js +476 -0
- package/dist/services/quality-gate/service.d.ts +233 -0
- package/dist/services/quality-gate/service.js +136 -0
- package/dist/services/repository-bundle/service.d.ts +33 -0
- package/dist/services/repository-bundle/service.js +114 -0
- package/dist/services/repository-model/service.d.ts +105 -0
- package/dist/services/repository-model/service.js +250 -0
- package/dist/services/repository-public-artifact/service.d.ts +133 -0
- package/dist/services/repository-public-artifact/service.js +330 -0
- package/dist/services/routing-benchmark/service.d.ts +362 -0
- package/dist/services/routing-benchmark/service.js +96 -0
- package/dist/services/specification-critic/service.d.ts +92 -0
- package/dist/services/specification-critic/service.js +172 -0
- package/dist/services/task-family/service.d.ts +40 -0
- package/dist/services/task-family/service.js +55 -0
- package/dist/services/task-seed/service.d.ts +906 -0
- package/dist/services/task-seed/service.js +1406 -0
- package/dist/services/task-specification/service.d.ts +27 -0
- package/dist/services/task-specification/service.js +40 -0
- package/dist/services/trajectory-policy/service.d.ts +110 -0
- package/dist/services/trajectory-policy/service.js +216 -0
- package/dist/test/agentic-capabilities-protocol.test.d.ts +1 -0
- package/dist/test/agentic-capabilities-protocol.test.js +570 -0
- package/dist/test/agentic-capabilities.test.d.ts +1 -0
- package/dist/test/agentic-capabilities.test.js +1461 -0
- package/dist/test/agentic-environment.test.d.ts +1 -0
- package/dist/test/agentic-environment.test.js +213 -0
- package/dist/test/case-pipeline-foundation.test.d.ts +1 -0
- package/dist/test/case-pipeline-foundation.test.js +535 -0
- package/dist/test/case-pipeline-protocol-v2.test.d.ts +1 -0
- package/dist/test/case-pipeline-protocol-v2.test.js +124 -0
- package/dist/test/case-pipeline-v2.test.d.ts +1 -0
- package/dist/test/case-pipeline-v2.test.js +286 -0
- package/dist/test/case-pipeline.test.d.ts +1 -0
- package/dist/test/case-pipeline.test.js +851 -0
- package/dist/test/eval-capability-policy.test.d.ts +1 -0
- package/dist/test/eval-capability-policy.test.js +50 -0
- package/dist/test/eval-event-log.test.js +34 -1
- package/dist/test/evaluation-evidence-freshness.test.d.ts +1 -0
- package/dist/test/evaluation-evidence-freshness.test.js +44 -0
- package/dist/test/evaluation-evidence.test.d.ts +1 -0
- package/dist/test/evaluation-evidence.test.js +230 -0
- package/dist/test/evaluation-grader-calibration.test.d.ts +1 -0
- package/dist/test/evaluation-grader-calibration.test.js +373 -0
- package/dist/test/evaluation-proposal-digest.test.d.ts +1 -0
- package/dist/test/evaluation-proposal-digest.test.js +187 -0
- package/dist/test/evaluation-source-retrieval.test.d.ts +1 -0
- package/dist/test/evaluation-source-retrieval.test.js +237 -0
- package/dist/test/evaluation-structure-policy.test.d.ts +1 -0
- package/dist/test/evaluation-structure-policy.test.js +196 -0
- package/dist/test/fixtures/repository-resource-panel.d.ts +39 -0
- package/dist/test/fixtures/repository-resource-panel.js +111 -0
- package/dist/test/fixtures/vitest-boundary-panel.d.ts +84 -0
- package/dist/test/fixtures/vitest-boundary-panel.js +120 -0
- package/dist/test/fixtures/vitest-phase-panel.d.ts +135 -0
- package/dist/test/fixtures/vitest-phase-panel.js +213 -0
- package/dist/test/fixtures/vitest-reporter-results.d.ts +76 -0
- package/dist/test/fixtures/vitest-reporter-results.js +94 -0
- package/dist/test/grounded-authoring.test.d.ts +1 -0
- package/dist/test/grounded-authoring.test.js +565 -0
- package/dist/test/integrated-repository-history.test.d.ts +1 -0
- package/dist/test/integrated-repository-history.test.js +227 -0
- package/dist/test/project-authoring.test.js +593 -43
- package/dist/test/project-workflow.test.js +395 -32
- package/dist/test/repository-authoring-artifacts.test.d.ts +1 -0
- package/dist/test/repository-authoring-artifacts.test.js +185 -0
- package/dist/test/repository-bundle.test.d.ts +1 -0
- package/dist/test/repository-bundle.test.js +52 -0
- package/dist/test/repository-case-generation.test.d.ts +1 -0
- package/dist/test/repository-case-generation.test.js +3465 -0
- package/dist/test/repository-command-diagnostic.test.d.ts +1 -0
- package/dist/test/repository-command-diagnostic.test.js +55 -0
- package/dist/test/repository-command-signals.test.d.ts +1 -0
- package/dist/test/repository-command-signals.test.js +124 -0
- package/dist/test/repository-fixture-scope-coverage.test.d.ts +1 -0
- package/dist/test/repository-fixture-scope-coverage.test.js +127 -0
- package/dist/test/repository-fixture-validation.test.d.ts +1 -0
- package/dist/test/repository-fixture-validation.test.js +362 -0
- package/dist/test/repository-foundry-progress.test.d.ts +1 -0
- package/dist/test/repository-foundry-progress.test.js +110 -0
- package/dist/test/repository-foundry-quality.test.d.ts +1 -0
- package/dist/test/repository-foundry-quality.test.js +1138 -0
- package/dist/test/repository-import-context.test.d.ts +1 -0
- package/dist/test/repository-import-context.test.js +354 -0
- package/dist/test/repository-model-authoring.test.d.ts +1 -0
- package/dist/test/repository-model-authoring.test.js +544 -0
- package/dist/test/repository-model.test.d.ts +1 -0
- package/dist/test/repository-model.test.js +2195 -0
- package/dist/test/repository-node-test-reporter.test.d.ts +1 -0
- package/dist/test/repository-node-test-reporter.test.js +104 -0
- package/dist/test/repository-oracle-concurrency.test.d.ts +1 -0
- package/dist/test/repository-oracle-concurrency.test.js +542 -0
- package/dist/test/repository-oracle-coverage-witness.test.d.ts +1 -0
- package/dist/test/repository-oracle-coverage-witness.test.js +511 -0
- package/dist/test/repository-oracle-coverage.test.d.ts +1 -0
- package/dist/test/repository-oracle-coverage.test.js +168 -0
- package/dist/test/repository-oracle-evidence.test.d.ts +1 -0
- package/dist/test/repository-oracle-evidence.test.js +185 -0
- package/dist/test/repository-oracle-plan.test.d.ts +1 -0
- package/dist/test/repository-oracle-plan.test.js +176 -0
- package/dist/test/repository-overlay-isolation.test.d.ts +1 -0
- package/dist/test/repository-overlay-isolation.test.js +85 -0
- package/dist/test/repository-preparation-cache.test.d.ts +1 -0
- package/dist/test/repository-preparation-cache.test.js +414 -0
- package/dist/test/repository-public-artifact.test.d.ts +1 -0
- package/dist/test/repository-public-artifact.test.js +273 -0
- package/dist/test/repository-qualification-diagnostics.test.d.ts +1 -0
- package/dist/test/repository-qualification-diagnostics.test.js +524 -0
- package/dist/test/repository-reference-authoring.test.d.ts +1 -0
- package/dist/test/repository-reference-authoring.test.js +1633 -0
- package/dist/test/repository-review-evidence-v2.test.d.ts +1 -0
- package/dist/test/repository-review-evidence-v2.test.js +183 -0
- package/dist/test/repository-review-evidence.test.d.ts +1 -0
- package/dist/test/repository-review-evidence.test.js +124 -0
- package/dist/test/repository-seed-exclusions.test.d.ts +1 -0
- package/dist/test/repository-seed-exclusions.test.js +96 -0
- package/dist/test/repository-seed-selection.test.d.ts +1 -0
- package/dist/test/repository-seed-selection.test.js +504 -0
- package/dist/test/repository-semantic-calibration.test.d.ts +1 -0
- package/dist/test/repository-semantic-calibration.test.js +688 -0
- package/dist/test/repository-solution-edits.test.d.ts +1 -0
- package/dist/test/repository-solution-edits.test.js +377 -0
- package/dist/test/repository-specification-budget.test.d.ts +1 -0
- package/dist/test/repository-specification-budget.test.js +171 -0
- package/dist/test/repository-specification-contract-checkpoint.test.d.ts +1 -0
- package/dist/test/repository-specification-contract-checkpoint.test.js +228 -0
- package/dist/test/repository-specification-contract-facts.test.d.ts +1 -0
- package/dist/test/repository-specification-contract-facts.test.js +177 -0
- package/dist/test/repository-trajectory-authoring.test.d.ts +1 -0
- package/dist/test/repository-trajectory-authoring.test.js +176 -0
- package/dist/test/repository-valid-control-plan.test.d.ts +1 -0
- package/dist/test/repository-valid-control-plan.test.js +45 -0
- package/dist/test/repository-vitest-phase.test.d.ts +1 -0
- package/dist/test/repository-vitest-phase.test.js +848 -0
- package/dist/test/repository-vitest-reporter.test.d.ts +1 -0
- package/dist/test/repository-vitest-reporter.test.js +158 -0
- package/dist/test/repository-workspace-build.test.d.ts +1 -0
- package/dist/test/repository-workspace-build.test.js +160 -0
- package/dist/test/strict-authoring-schema.test.d.ts +1 -0
- package/dist/test/strict-authoring-schema.test.js +169 -0
- package/package.json +48 -7
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { type AgenticEnvironmentPlanV1 } from "../../agentic-capabilities-protocol.js";
|
|
3
|
+
import { RepositoryFoundryError } from "../../errors.js";
|
|
4
|
+
import type { RepositorySeedEnvironmentV1, RepositoryTaskSeedV1 } from "../../repository-task-seed-protocol.js";
|
|
5
|
+
export type EvalEnvironmentV1 = {
|
|
6
|
+
readonly plan: AgenticEnvironmentPlanV1;
|
|
7
|
+
readonly environment: RepositorySeedEnvironmentV1;
|
|
8
|
+
};
|
|
9
|
+
/** Read-only planning. Execution is explicit and happens only when probing or qualifying. */
|
|
10
|
+
export declare const planEvalEnvironmentV1: (input: {
|
|
11
|
+
readonly repositoryRoot: string;
|
|
12
|
+
readonly candidate: string;
|
|
13
|
+
readonly revision: string;
|
|
14
|
+
readonly sourceDigest: string;
|
|
15
|
+
readonly seed: RepositoryTaskSeedV1;
|
|
16
|
+
readonly recipeIds: readonly string[];
|
|
17
|
+
readonly executionMode: AgenticEnvironmentPlanV1["executionMode"];
|
|
18
|
+
readonly requiredArtifacts?: readonly string[];
|
|
19
|
+
readonly runtime: AgenticEnvironmentPlanV1["runtime"];
|
|
20
|
+
readonly justification: string;
|
|
21
|
+
}) => Effect.Effect<{
|
|
22
|
+
plan: {
|
|
23
|
+
readonly version: 1;
|
|
24
|
+
readonly planId: string;
|
|
25
|
+
readonly candidate: string;
|
|
26
|
+
readonly revision: string;
|
|
27
|
+
readonly sourceDigest: string;
|
|
28
|
+
readonly commitSha: string;
|
|
29
|
+
readonly recipeIds: readonly string[];
|
|
30
|
+
readonly executionMode: "source" | "emitted" | "repository-default";
|
|
31
|
+
readonly targetRoots: readonly string[];
|
|
32
|
+
readonly dependencyClosure: readonly string[];
|
|
33
|
+
readonly requiredArtifacts: readonly string[];
|
|
34
|
+
readonly lockfileDigest: string | null;
|
|
35
|
+
readonly packageManager: {
|
|
36
|
+
readonly name: string;
|
|
37
|
+
readonly version: string;
|
|
38
|
+
} | null;
|
|
39
|
+
readonly runtime: {
|
|
40
|
+
readonly name: string;
|
|
41
|
+
readonly version: string;
|
|
42
|
+
readonly platform: string;
|
|
43
|
+
readonly architecture: string;
|
|
44
|
+
};
|
|
45
|
+
readonly commands: readonly {
|
|
46
|
+
readonly id: string;
|
|
47
|
+
readonly purpose: "generate" | "build" | "grade" | "install" | "probe";
|
|
48
|
+
readonly executable: string;
|
|
49
|
+
readonly args: readonly string[];
|
|
50
|
+
readonly cwd: string | null;
|
|
51
|
+
readonly timeoutMs: number;
|
|
52
|
+
}[];
|
|
53
|
+
readonly expectedCost: {
|
|
54
|
+
readonly wallTimeMs: number;
|
|
55
|
+
readonly spendUsd: string | null;
|
|
56
|
+
};
|
|
57
|
+
readonly justification: string;
|
|
58
|
+
readonly justificationEvidence: readonly string[];
|
|
59
|
+
};
|
|
60
|
+
environment: {
|
|
61
|
+
readonly protectedControlPaths: readonly string[];
|
|
62
|
+
readonly trustedPreparationRecipes: readonly {
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly kind: "schema" | "test" | "build" | "check" | "custom";
|
|
65
|
+
readonly cwd: string;
|
|
66
|
+
readonly executable: string;
|
|
67
|
+
readonly args: readonly string[];
|
|
68
|
+
readonly timeoutMs: number;
|
|
69
|
+
}[];
|
|
70
|
+
readonly candidateValidationRecipes: readonly {
|
|
71
|
+
readonly id: string;
|
|
72
|
+
readonly kind: "schema" | "test" | "build" | "check" | "custom";
|
|
73
|
+
readonly cwd: string;
|
|
74
|
+
readonly executable: string;
|
|
75
|
+
readonly args: readonly string[];
|
|
76
|
+
readonly timeoutMs: number;
|
|
77
|
+
}[];
|
|
78
|
+
readonly baselineGradeRecipes: readonly {
|
|
79
|
+
readonly id: string;
|
|
80
|
+
readonly kind: "schema" | "test" | "build" | "check" | "custom";
|
|
81
|
+
readonly cwd: string;
|
|
82
|
+
readonly executable: string;
|
|
83
|
+
readonly args: readonly string[];
|
|
84
|
+
readonly timeoutMs: number;
|
|
85
|
+
}[];
|
|
86
|
+
readonly gradeRecipes: readonly {
|
|
87
|
+
readonly id: string;
|
|
88
|
+
readonly kind: "schema" | "test" | "build" | "check" | "custom";
|
|
89
|
+
readonly cwd: string;
|
|
90
|
+
readonly executable: string;
|
|
91
|
+
readonly args: readonly string[];
|
|
92
|
+
readonly timeoutMs: number;
|
|
93
|
+
}[];
|
|
94
|
+
readonly packageManager?: {
|
|
95
|
+
readonly name: "pnpm";
|
|
96
|
+
readonly version: string;
|
|
97
|
+
} | undefined;
|
|
98
|
+
readonly lockfilePath?: string | undefined;
|
|
99
|
+
};
|
|
100
|
+
}, RepositoryFoundryError, never>;
|
|
101
|
+
/** Preparation failures are not failing grades; this runs the same isolated runner used by qualification. */
|
|
102
|
+
export declare const probeEvalEnvironmentV1: (input: {
|
|
103
|
+
readonly repositoryRoot: string;
|
|
104
|
+
readonly prepared: EvalEnvironmentV1;
|
|
105
|
+
readonly commit?: string;
|
|
106
|
+
}) => Effect.Effect<{
|
|
107
|
+
outcome: "completed" | "environment_blocked" | "scientific_rejection";
|
|
108
|
+
gradeExecuted: boolean;
|
|
109
|
+
results: readonly {
|
|
110
|
+
readonly recipeId: string;
|
|
111
|
+
readonly commit: string;
|
|
112
|
+
readonly repetition: number;
|
|
113
|
+
readonly stdout: string;
|
|
114
|
+
readonly stderr: string;
|
|
115
|
+
readonly exitCode: number | null;
|
|
116
|
+
readonly stage: "trusted-preparation" | "candidate-validation" | "grade";
|
|
117
|
+
readonly timedOut: boolean;
|
|
118
|
+
readonly outputTruncated: boolean;
|
|
119
|
+
readonly durationMs: number;
|
|
120
|
+
readonly trustedPreparationResults: readonly {
|
|
121
|
+
readonly recipeId: string;
|
|
122
|
+
readonly commit: string;
|
|
123
|
+
readonly repetition: number;
|
|
124
|
+
readonly stdout: string;
|
|
125
|
+
readonly stderr: string;
|
|
126
|
+
readonly exitCode: number | null;
|
|
127
|
+
readonly stage: "trusted-preparation" | "candidate-validation" | "grade";
|
|
128
|
+
readonly timedOut: boolean;
|
|
129
|
+
readonly outputTruncated: boolean;
|
|
130
|
+
readonly durationMs: number;
|
|
131
|
+
readonly testReporter?: "vitest-v1" | undefined;
|
|
132
|
+
}[];
|
|
133
|
+
readonly candidateValidationResults: readonly {
|
|
134
|
+
readonly recipeId: string;
|
|
135
|
+
readonly commit: string;
|
|
136
|
+
readonly repetition: number;
|
|
137
|
+
readonly stdout: string;
|
|
138
|
+
readonly stderr: string;
|
|
139
|
+
readonly exitCode: number | null;
|
|
140
|
+
readonly stage: "trusted-preparation" | "candidate-validation" | "grade";
|
|
141
|
+
readonly timedOut: boolean;
|
|
142
|
+
readonly outputTruncated: boolean;
|
|
143
|
+
readonly durationMs: number;
|
|
144
|
+
readonly testReporter?: "vitest-v1" | undefined;
|
|
145
|
+
}[];
|
|
146
|
+
readonly gradeExecuted: boolean;
|
|
147
|
+
readonly testReporter?: "vitest-v1" | undefined;
|
|
148
|
+
readonly isolationTimings?: {
|
|
149
|
+
readonly checkoutDurationMs: number;
|
|
150
|
+
readonly overlayDurationMs: number;
|
|
151
|
+
readonly cleanupDurationMs: number;
|
|
152
|
+
} | undefined;
|
|
153
|
+
readonly preparation?: {
|
|
154
|
+
readonly kind: "pristine-install-template";
|
|
155
|
+
readonly templateKey: string;
|
|
156
|
+
readonly sourceCommit: string;
|
|
157
|
+
readonly cloneDurationMs: number;
|
|
158
|
+
readonly sharedResults: readonly {
|
|
159
|
+
readonly recipeId: string;
|
|
160
|
+
readonly commit: string;
|
|
161
|
+
readonly repetition: number;
|
|
162
|
+
readonly stdout: string;
|
|
163
|
+
readonly stderr: string;
|
|
164
|
+
readonly exitCode: number | null;
|
|
165
|
+
readonly stage: "trusted-preparation" | "candidate-validation" | "grade";
|
|
166
|
+
readonly timedOut: boolean;
|
|
167
|
+
readonly outputTruncated: boolean;
|
|
168
|
+
readonly durationMs: number;
|
|
169
|
+
readonly testReporter?: "vitest-v1" | undefined;
|
|
170
|
+
}[];
|
|
171
|
+
} | undefined;
|
|
172
|
+
}[];
|
|
173
|
+
}, RepositoryFoundryError, never>;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { agenticDigestV1, decodeAgenticEnvironmentPlanV1 } from "../../agentic-capabilities-protocol.js";
|
|
3
|
+
import { captureGitTreeSnapshotV1, readGitChangeEpisodeV1, readGitTreeFileV1 } from "../../adapters/git-task-history.js";
|
|
4
|
+
import { replayRepositoryCommandsV1 } from "../../adapters/repository-command-runner.js";
|
|
5
|
+
import { repositoryCommandProbeOutcomeV1 } from "../../adapters/repository-command-evidence.js";
|
|
6
|
+
import { RepositoryFoundryError } from "../../errors.js";
|
|
7
|
+
import { deriveHistoricalSeedEnvironmentV1 } from "../task-seed/service.js";
|
|
8
|
+
/** Read-only planning. Execution is explicit and happens only when probing or qualifying. */
|
|
9
|
+
export const planEvalEnvironmentV1 = Effect.fn("EvalEnvironment.plan")(function* (input) {
|
|
10
|
+
const recipes = input.seed.environment.gradeRecipes.filter((recipe) => input.recipeIds.includes(recipe.id));
|
|
11
|
+
if (recipes.length === 0 || recipes.length !== new Set(input.recipeIds).size) {
|
|
12
|
+
return yield* new RepositoryFoundryError({
|
|
13
|
+
operation: "run-command",
|
|
14
|
+
detail: "environment plan must select known repository-owned grade recipes"
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
const testPaths = input.seed.capabilityEvidence
|
|
18
|
+
.filter((entry) => entry.kind === "test")
|
|
19
|
+
.flatMap((entry) => entry.path === undefined ? [] : [entry.path]);
|
|
20
|
+
if (testPaths.some((testPath) => !recipes.some((recipe) => recipe.cwd === "." || testPath.startsWith(`${recipe.cwd}/`)))) {
|
|
21
|
+
return yield* new RepositoryFoundryError({
|
|
22
|
+
operation: "run-command",
|
|
23
|
+
detail: "environment plan must cover every reviewed test path; select the remaining repository-owned recipes or create a separately scoped candidate"
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
if (input.seed.referenceCommit === undefined) {
|
|
27
|
+
return yield* new RepositoryFoundryError({
|
|
28
|
+
operation: "run-command",
|
|
29
|
+
detail: "historical environment planning requires a pinned reference change"
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
const episode = yield* readGitChangeEpisodeV1({
|
|
33
|
+
repositoryRoot: input.repositoryRoot,
|
|
34
|
+
commit: input.seed.referenceCommit
|
|
35
|
+
});
|
|
36
|
+
if (episode.parentCommit !== input.seed.initialState.commit ||
|
|
37
|
+
("changeEpisodeId" in input.seed.source && episode.id !== input.seed.source.changeEpisodeId)) {
|
|
38
|
+
return yield* new RepositoryFoundryError({
|
|
39
|
+
operation: "run-command",
|
|
40
|
+
detail: "environment plan must bind the same historical change and initial tree as the candidate"
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
const environment = yield* deriveHistoricalSeedEnvironmentV1({
|
|
44
|
+
repositoryRoot: input.repositoryRoot,
|
|
45
|
+
commit: input.seed.initialState.commit,
|
|
46
|
+
gradeRecipes: recipes,
|
|
47
|
+
executionMode: input.executionMode,
|
|
48
|
+
testPaths,
|
|
49
|
+
// Capability citations are not the complete Git delta. In particular they
|
|
50
|
+
// omit changed manifests/config, which must remain implementation inputs
|
|
51
|
+
// rather than being overwritten as supposedly unchanged protected controls.
|
|
52
|
+
changedPaths: episode.changedPaths.flatMap(({ path, previousPath }) => previousPath === undefined ? [path] : [previousPath, path])
|
|
53
|
+
});
|
|
54
|
+
const snapshot = yield* captureGitTreeSnapshotV1({
|
|
55
|
+
repositoryRoot: input.repositoryRoot,
|
|
56
|
+
requestedRef: input.seed.initialState.commit
|
|
57
|
+
});
|
|
58
|
+
const lockfile = environment.lockfilePath === undefined
|
|
59
|
+
? undefined
|
|
60
|
+
: yield* readGitTreeFileV1({ snapshot, path: environment.lockfilePath });
|
|
61
|
+
const command = (purpose, recipe) => ({
|
|
62
|
+
id: recipe.id,
|
|
63
|
+
purpose,
|
|
64
|
+
executable: recipe.executable,
|
|
65
|
+
args: recipe.args,
|
|
66
|
+
cwd: recipe.cwd === "." ? null : recipe.cwd,
|
|
67
|
+
timeoutMs: recipe.timeoutMs
|
|
68
|
+
});
|
|
69
|
+
const commands = [
|
|
70
|
+
...environment.trustedPreparationRecipes.map((recipe) => command("install", recipe)),
|
|
71
|
+
...environment.candidateValidationRecipes.map((recipe) => command("build", recipe)),
|
|
72
|
+
...environment.gradeRecipes.map((recipe) => command("grade", recipe))
|
|
73
|
+
];
|
|
74
|
+
const planBody = {
|
|
75
|
+
version: 1,
|
|
76
|
+
candidate: input.candidate,
|
|
77
|
+
revision: input.revision,
|
|
78
|
+
sourceDigest: input.sourceDigest,
|
|
79
|
+
commitSha: input.seed.initialState.commit,
|
|
80
|
+
recipeIds: recipes.map((recipe) => recipe.id),
|
|
81
|
+
executionMode: input.executionMode,
|
|
82
|
+
targetRoots: [...new Set(recipes.map((recipe) => recipe.cwd))],
|
|
83
|
+
dependencyClosure: [
|
|
84
|
+
...new Set(environment.candidateValidationRecipes.map((recipe) => recipe.cwd))
|
|
85
|
+
],
|
|
86
|
+
requiredArtifacts: input.requiredArtifacts ?? [],
|
|
87
|
+
lockfileDigest: lockfile === undefined ? null : agenticDigestV1(lockfile),
|
|
88
|
+
packageManager: environment.packageManager ?? null,
|
|
89
|
+
runtime: input.runtime,
|
|
90
|
+
commands,
|
|
91
|
+
expectedCost: {
|
|
92
|
+
wallTimeMs: commands.reduce((sum, entry) => sum + entry.timeoutMs, 0),
|
|
93
|
+
spendUsd: null
|
|
94
|
+
},
|
|
95
|
+
justification: input.justification,
|
|
96
|
+
justificationEvidence: [input.candidate]
|
|
97
|
+
};
|
|
98
|
+
const plan = yield* Effect.try({
|
|
99
|
+
try: () => decodeAgenticEnvironmentPlanV1({
|
|
100
|
+
...planBody,
|
|
101
|
+
planId: `environment-${agenticDigestV1(planBody)}`
|
|
102
|
+
}),
|
|
103
|
+
catch: (cause) => new RepositoryFoundryError({
|
|
104
|
+
operation: "run-command",
|
|
105
|
+
detail: "environment plan exceeds the supported bounded protocol",
|
|
106
|
+
cause
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
return { plan, environment };
|
|
110
|
+
});
|
|
111
|
+
/** Preparation failures are not failing grades; this runs the same isolated runner used by qualification. */
|
|
112
|
+
export const probeEvalEnvironmentV1 = Effect.fn("EvalEnvironment.probe")(function* (input) {
|
|
113
|
+
const results = yield* replayRepositoryCommandsV1({
|
|
114
|
+
repositoryRoot: input.repositoryRoot,
|
|
115
|
+
commit: input.commit ?? input.prepared.plan.commitSha,
|
|
116
|
+
recipes: input.prepared.environment.gradeRecipes,
|
|
117
|
+
trustedPreparationRecipes: input.prepared.environment.trustedPreparationRecipes,
|
|
118
|
+
candidateValidationRecipes: input.prepared.environment.candidateValidationRecipes,
|
|
119
|
+
repetitions: 1
|
|
120
|
+
});
|
|
121
|
+
const outcome = repositoryCommandProbeOutcomeV1(results);
|
|
122
|
+
return {
|
|
123
|
+
outcome,
|
|
124
|
+
gradeExecuted: outcome !== "environment_blocked",
|
|
125
|
+
results
|
|
126
|
+
};
|
|
127
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Context, Effect } from "effect";
|
|
2
|
+
import type { RepositoryCommandResultV1, RepositoryHistoricalOracleInputV1 } from "../../repository-execution-protocol.js";
|
|
3
|
+
import { RepositoryFoundryError } from "../../errors.js";
|
|
4
|
+
import type { RepositoryFoundryGenerationPlanV1 } from "../../repository-foundry-plan-protocol.js";
|
|
5
|
+
import type { RepositoryFoundryAuthoringArtifactV1 } from "../../repository-foundry-progress-protocol.js";
|
|
6
|
+
import type { RepositoryHiddenOracleV1 } from "../../repository-oracle-protocol.js";
|
|
7
|
+
import type { EvalAuthoringTransportShape } from "../../project-authoring.js";
|
|
8
|
+
type StoredArtifact = RepositoryFoundryAuthoringArtifactV1 & {
|
|
9
|
+
readonly planDigest: string;
|
|
10
|
+
readonly caseId: string;
|
|
11
|
+
readonly updatedAt: string;
|
|
12
|
+
};
|
|
13
|
+
declare const RepositoryFoundryEvidenceReconstruction_base: Context.ServiceClass<RepositoryFoundryEvidenceReconstruction, "@velum-labs/routekit-eval-setup/RepositoryFoundryEvidenceReconstruction", {
|
|
14
|
+
readonly commands: (input: unknown) => Effect.Effect<readonly RepositoryCommandResultV1[], RepositoryFoundryError>;
|
|
15
|
+
readonly oracle: (input: RepositoryHistoricalOracleInputV1) => Effect.Effect<RepositoryHiddenOracleV1, RepositoryFoundryError>;
|
|
16
|
+
readonly assertConsumed: Effect.Effect<void, RepositoryFoundryError>;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Read-only reconstruction of interrupted, pre-review work. This capability
|
|
20
|
+
* never supplies admission authority. Finalization must revalidate the frozen
|
|
21
|
+
* suite in real isolated checkouts before any new review is issued.
|
|
22
|
+
*/
|
|
23
|
+
export declare class RepositoryFoundryEvidenceReconstruction extends RepositoryFoundryEvidenceReconstruction_base {
|
|
24
|
+
}
|
|
25
|
+
export declare const makeRepositoryFoundryEvidenceReconstructionV1: (input: {
|
|
26
|
+
readonly plan: RepositoryFoundryGenerationPlanV1;
|
|
27
|
+
readonly artifacts: readonly StoredArtifact[];
|
|
28
|
+
}) => Effect.Effect<{
|
|
29
|
+
service: {
|
|
30
|
+
readonly commands: (input: unknown) => Effect.Effect<readonly RepositoryCommandResultV1[], RepositoryFoundryError>;
|
|
31
|
+
readonly oracle: (input: RepositoryHistoricalOracleInputV1) => Effect.Effect<RepositoryHiddenOracleV1, RepositoryFoundryError>;
|
|
32
|
+
readonly assertConsumed: Effect.Effect<void, RepositoryFoundryError>;
|
|
33
|
+
};
|
|
34
|
+
transport: EvalAuthoringTransportShape;
|
|
35
|
+
}, RepositoryFoundryError, never>;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { Context, Effect } from "effect";
|
|
2
|
+
import { EvalProjectAuthoringError, RepositoryFoundryError } from "../../errors.js";
|
|
3
|
+
import { assertRepositoryHiddenOracleV1 } from "../../repository-oracle-protocol.js";
|
|
4
|
+
import { repositoryOracleExecutionBindingV1 } from "../../repository-oracle-execution-binding.js";
|
|
5
|
+
/**
|
|
6
|
+
* Read-only reconstruction of interrupted, pre-review work. This capability
|
|
7
|
+
* never supplies admission authority. Finalization must revalidate the frozen
|
|
8
|
+
* suite in real isolated checkouts before any new review is issued.
|
|
9
|
+
*/
|
|
10
|
+
export class RepositoryFoundryEvidenceReconstruction extends Context.Service()("@velum-labs/routekit-eval-setup/RepositoryFoundryEvidenceReconstruction") {
|
|
11
|
+
}
|
|
12
|
+
const fail = (detail, cause) => new RepositoryFoundryError({
|
|
13
|
+
operation: "compile-reviewed-case",
|
|
14
|
+
detail: `saved evidence reconstruction: ${detail}`,
|
|
15
|
+
...(cause === undefined ? {} : { cause })
|
|
16
|
+
});
|
|
17
|
+
const record = (value) => value !== null && typeof value === "object" && !Array.isArray(value)
|
|
18
|
+
? value
|
|
19
|
+
: {};
|
|
20
|
+
const normalize = (value) => Array.isArray(value)
|
|
21
|
+
? value.map(normalize)
|
|
22
|
+
: value !== null && typeof value === "object"
|
|
23
|
+
? Object.fromEntries(Object.entries(value)
|
|
24
|
+
.filter(([, entry]) => entry !== undefined)
|
|
25
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
26
|
+
.map(([key, entry]) => [key, normalize(entry)]))
|
|
27
|
+
: value;
|
|
28
|
+
const same = (left, right) => JSON.stringify(normalize(left)) === JSON.stringify(normalize(right));
|
|
29
|
+
const replayIdentity = (value) => {
|
|
30
|
+
const { preparationCache: _runtimeOnlyCache, ...identity } = record(value);
|
|
31
|
+
return identity;
|
|
32
|
+
};
|
|
33
|
+
export const makeRepositoryFoundryEvidenceReconstructionV1 = Effect.fn("EvidenceReconstruction.make")(function* (input) {
|
|
34
|
+
const sorted = [...input.artifacts].sort((left, right) => left.updatedAt.localeCompare(right.updatedAt));
|
|
35
|
+
if (sorted.length === 0 ||
|
|
36
|
+
sorted.some((artifact) => artifact.planDigest !== input.plan.planDigest ||
|
|
37
|
+
artifact.caseId !== input.plan.caseId ||
|
|
38
|
+
!Number.isFinite(Date.parse(artifact.updatedAt))))
|
|
39
|
+
return yield* fail("every artifact must belong to the exact parent plan and case");
|
|
40
|
+
const modelRecords = sorted.filter((artifact) => artifact.response.callId !== undefined);
|
|
41
|
+
if (modelRecords.length === 0 ||
|
|
42
|
+
modelRecords.some((artifact) => artifact.validation !== "validated" ||
|
|
43
|
+
artifact.role === "quality-reviewer" ||
|
|
44
|
+
!input.plan.modelPlan.assignments.some((assignment) => assignment.role === artifact.role &&
|
|
45
|
+
assignment.model === artifact.model &&
|
|
46
|
+
assignment.reasoningEffort === artifact.reasoningEffort)))
|
|
47
|
+
return yield* fail("saved model calls are incomplete, unbound, or already include final review");
|
|
48
|
+
const replayRecords = sorted.filter((artifact) => [
|
|
49
|
+
"routekit_repository_seed_qualification_phase_v1",
|
|
50
|
+
"routekit_repository_fixture_preflight_v1",
|
|
51
|
+
...(input.plan.oracleCoverageWitnessVersion !== undefined
|
|
52
|
+
? ["routekit_repository_coverage_witness_replay_v1"]
|
|
53
|
+
: [])
|
|
54
|
+
].includes(artifact.schemaName));
|
|
55
|
+
const oracleRecords = sorted.filter((artifact) => artifact.schemaName === "routekit_repository_oracle_execution_v1" &&
|
|
56
|
+
record(artifact.value).complete === true);
|
|
57
|
+
const usedCalls = new Set();
|
|
58
|
+
const usedReplays = new Set();
|
|
59
|
+
let oracleIndex = 0;
|
|
60
|
+
const check = (body, detail) => Effect.try({
|
|
61
|
+
try: body,
|
|
62
|
+
catch: (cause) => fail(detail, cause)
|
|
63
|
+
});
|
|
64
|
+
const service = RepositoryFoundryEvidenceReconstruction.of({
|
|
65
|
+
commands: (untyped) => check(() => {
|
|
66
|
+
const request = replayIdentity(untyped);
|
|
67
|
+
const saved = replayRecords.find((artifact) => {
|
|
68
|
+
if (usedReplays.has(artifact.operationId))
|
|
69
|
+
return false;
|
|
70
|
+
const recordedInput = record(artifact.request.input);
|
|
71
|
+
return same(replayIdentity(artifact.schemaName === "routekit_repository_seed_qualification_phase_v1"
|
|
72
|
+
? recordedInput
|
|
73
|
+
: recordedInput.replayInput), request);
|
|
74
|
+
});
|
|
75
|
+
if (saved === undefined)
|
|
76
|
+
throw new Error("no exact saved replay request");
|
|
77
|
+
const results = record(saved.value).results;
|
|
78
|
+
if (!Array.isArray(results) || results.length === 0)
|
|
79
|
+
throw new Error("saved replay has no completed results");
|
|
80
|
+
usedReplays.add(saved.operationId);
|
|
81
|
+
return structuredClone(results);
|
|
82
|
+
}, "command reconstruction requires an unused exact request and complete recorded output"),
|
|
83
|
+
oracle: (request) => check(() => {
|
|
84
|
+
const saved = oracleRecords[oracleIndex];
|
|
85
|
+
if (saved === undefined)
|
|
86
|
+
throw new Error("no complete tournament at this ordinal");
|
|
87
|
+
const savedRequest = record(saved.request.input);
|
|
88
|
+
const oracle = record(saved.value).oracle;
|
|
89
|
+
assertRepositoryHiddenOracleV1(oracle);
|
|
90
|
+
const binding = repositoryOracleExecutionBindingV1(request);
|
|
91
|
+
const bound = oracle.executionBindingDigest !== undefined;
|
|
92
|
+
if (bound &&
|
|
93
|
+
(oracle.executionBindingDigest !== binding.executionBindingDigest ||
|
|
94
|
+
(oracle.executionRepetitions !== undefined &&
|
|
95
|
+
oracle.executionRepetitions !== binding.repetitions)))
|
|
96
|
+
throw new Error("saved tournament executable input binding differs");
|
|
97
|
+
if (request.repositoryRoot !== input.plan.repository.root ||
|
|
98
|
+
request.caseId !== input.plan.caseId ||
|
|
99
|
+
request.caseId !== oracle.caseId ||
|
|
100
|
+
request.seed.initialState.commit !== savedRequest.initialCommit ||
|
|
101
|
+
request.seed.referenceCommit !== savedRequest.referenceCommit ||
|
|
102
|
+
!same(request.hiddenFixtureSuite?.fixtures ?? [], oracle.fixtures) ||
|
|
103
|
+
request.additionalSolutions.length + 2 !== oracle.solutions.length ||
|
|
104
|
+
(bound
|
|
105
|
+
? !same(binding.solutionMetadata, oracle.solutions)
|
|
106
|
+
// Legacy artifacts had no full executable binding. Preserve their
|
|
107
|
+
// stricter full-solution comparison, not a metadata-only fallback.
|
|
108
|
+
// Reconstructed checkpoints still require fresh replay validation.
|
|
109
|
+
: !same(binding.solutions, oracle.solutions)))
|
|
110
|
+
throw new Error("saved tournament population or frozen fixture identity differs");
|
|
111
|
+
oracleIndex += 1;
|
|
112
|
+
return structuredClone(oracle);
|
|
113
|
+
}, "tournament reconstruction requires the same ordered population and frozen fixtures"),
|
|
114
|
+
assertConsumed: Effect.suspend(() => usedCalls.size === modelRecords.length &&
|
|
115
|
+
usedReplays.size === replayRecords.length &&
|
|
116
|
+
oracleIndex === oracleRecords.length
|
|
117
|
+
? Effect.void
|
|
118
|
+
: Effect.fail(fail("reconstruction left model calls, replays or complete tournaments unused")))
|
|
119
|
+
});
|
|
120
|
+
const transport = {
|
|
121
|
+
complete: () => Effect.fail(new EvalProjectAuthoringError({
|
|
122
|
+
operation: "authoring-evaluations",
|
|
123
|
+
detail: "saved evidence reconstruction cannot make a model call"
|
|
124
|
+
})),
|
|
125
|
+
completeDetailed: (request) => check(() => {
|
|
126
|
+
const saved = modelRecords.find((artifact) => artifact.operationId === request.operationId && !usedCalls.has(artifact.operationId));
|
|
127
|
+
if (saved === undefined ||
|
|
128
|
+
request.model !== saved.model ||
|
|
129
|
+
request.reasoningEffort !== saved.reasoningEffort ||
|
|
130
|
+
request.schemaName !== saved.schemaName ||
|
|
131
|
+
request.instructions !== saved.request.instructions ||
|
|
132
|
+
request.maximumOutputTokens !== saved.request.maximumOutputTokens ||
|
|
133
|
+
!same(request.jsonSchema, saved.request.jsonSchema) ||
|
|
134
|
+
!same(JSON.parse(request.input), saved.request.input))
|
|
135
|
+
throw new Error("saved model request envelope differs or was already used");
|
|
136
|
+
usedCalls.add(saved.operationId);
|
|
137
|
+
return structuredClone(saved.response);
|
|
138
|
+
}, "model reconstruction requires an unused exact model, instructions, input, schema and limit").pipe(Effect.mapError((cause) => new EvalProjectAuthoringError({
|
|
139
|
+
operation: "authoring-evaluations",
|
|
140
|
+
detail: cause.detail,
|
|
141
|
+
cause
|
|
142
|
+
})))
|
|
143
|
+
};
|
|
144
|
+
return { service, transport };
|
|
145
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Context, Effect, Layer } from "effect";
|
|
2
|
+
import { type RepositoryHiddenFixtureSuiteV1 } from "../../repository-fixture-protocol.js";
|
|
3
|
+
import type { RepositoryTaskSeedV1 } from "../../repository-task-seed-protocol.js";
|
|
4
|
+
export type FixtureBuilderShape = {
|
|
5
|
+
readonly compileReviewed: (input: {
|
|
6
|
+
readonly caseId: string;
|
|
7
|
+
readonly seed: RepositoryTaskSeedV1;
|
|
8
|
+
readonly suite: RepositoryHiddenFixtureSuiteV1;
|
|
9
|
+
}) => Effect.Effect<RepositoryHiddenFixtureSuiteV1>;
|
|
10
|
+
};
|
|
11
|
+
declare const FixtureBuilder_base: Context.ServiceClass<FixtureBuilder, "@velum-labs/routekit-eval-setup/FixtureBuilder", FixtureBuilderShape>;
|
|
12
|
+
export declare class FixtureBuilder extends FixtureBuilder_base {
|
|
13
|
+
}
|
|
14
|
+
export declare const compileReviewedHiddenFixtureSuiteV1: (input: {
|
|
15
|
+
readonly caseId: string;
|
|
16
|
+
readonly seed: RepositoryTaskSeedV1;
|
|
17
|
+
readonly suite: RepositoryHiddenFixtureSuiteV1;
|
|
18
|
+
}) => Effect.Effect<{
|
|
19
|
+
readonly version: 1;
|
|
20
|
+
readonly caseId: string;
|
|
21
|
+
readonly fixtures: readonly ({
|
|
22
|
+
readonly kind: "historical-regression";
|
|
23
|
+
readonly expectationMode: "changes";
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly description: string;
|
|
26
|
+
readonly expectedBehavior: string;
|
|
27
|
+
readonly source: "historical" | "generated" | "reviewed";
|
|
28
|
+
readonly testPath: string;
|
|
29
|
+
} | {
|
|
30
|
+
readonly kind: "boundary";
|
|
31
|
+
readonly expectationMode: "changes" | "preserved";
|
|
32
|
+
readonly id: string;
|
|
33
|
+
readonly description: string;
|
|
34
|
+
readonly expectedBehavior: string;
|
|
35
|
+
readonly source: "historical" | "generated" | "reviewed";
|
|
36
|
+
readonly testPath: string;
|
|
37
|
+
} | {
|
|
38
|
+
readonly kind: "counterfactual";
|
|
39
|
+
readonly expectationMode: "changes";
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly description: string;
|
|
42
|
+
readonly expectedBehavior: string;
|
|
43
|
+
readonly source: "historical" | "generated" | "reviewed";
|
|
44
|
+
readonly testPath: string;
|
|
45
|
+
} | {
|
|
46
|
+
readonly kind: "metamorphic";
|
|
47
|
+
readonly expectationMode: "preserved";
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly description: string;
|
|
50
|
+
readonly expectedBehavior: string;
|
|
51
|
+
readonly source: "historical" | "generated" | "reviewed";
|
|
52
|
+
readonly testPath: string;
|
|
53
|
+
})[];
|
|
54
|
+
readonly overlays: readonly {
|
|
55
|
+
readonly path: string;
|
|
56
|
+
readonly content: string;
|
|
57
|
+
readonly fixtureIds: readonly string[];
|
|
58
|
+
}[];
|
|
59
|
+
}, never, never>;
|
|
60
|
+
export declare const makeFixtureBuilder: Effect.Effect<FixtureBuilderShape, never, never>;
|
|
61
|
+
export declare const FixtureBuilderLive: Layer.Layer<FixtureBuilder, never, never>;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Context, Effect, Layer } from "effect";
|
|
2
|
+
import { assertRepositoryHiddenFixtureSuiteV1 } from "../../repository-fixture-protocol.js";
|
|
3
|
+
export class FixtureBuilder extends Context.Service()("@velum-labs/routekit-eval-setup/FixtureBuilder") {
|
|
4
|
+
}
|
|
5
|
+
export const compileReviewedHiddenFixtureSuiteV1 = Effect.fn("FixtureBuilder.compileReviewed")(function* (input) {
|
|
6
|
+
assertRepositoryHiddenFixtureSuiteV1(input.suite);
|
|
7
|
+
if (input.suite.caseId !== input.caseId) {
|
|
8
|
+
throw new Error("hidden fixture suite case id does not match its task");
|
|
9
|
+
}
|
|
10
|
+
const candidateTestPaths = new Set(input.seed.capabilityEvidence
|
|
11
|
+
.filter((evidence) => evidence.kind === "test" && evidence.path !== undefined)
|
|
12
|
+
.map((evidence) => evidence.path));
|
|
13
|
+
const overlayByFixtureId = new Map(input.suite.overlays.map((overlay) => [overlay.fixtureIds[0], overlay]));
|
|
14
|
+
for (const fixture of input.suite.fixtures) {
|
|
15
|
+
if (!candidateTestPaths.has(fixture.testPath)) {
|
|
16
|
+
throw new Error(`hidden fixture targets a path outside the seed's reviewed test scope: ${JSON.stringify(fixture.testPath)}`);
|
|
17
|
+
}
|
|
18
|
+
if (fixture.kind === "counterfactual" &&
|
|
19
|
+
fixture.expectationMode !== "changes") {
|
|
20
|
+
throw new Error("counterfactual fixtures must identify an expected behavior change");
|
|
21
|
+
}
|
|
22
|
+
if (fixture.kind === "metamorphic" &&
|
|
23
|
+
fixture.expectationMode !== "preserved") {
|
|
24
|
+
throw new Error("metamorphic fixtures must identify a preserved invariant");
|
|
25
|
+
}
|
|
26
|
+
const overlay = overlayByFixtureId.get(fixture.id);
|
|
27
|
+
if (overlay === undefined || overlay.path !== fixture.testPath) {
|
|
28
|
+
throw new Error(`hidden fixture ${JSON.stringify(fixture.id)} must own one independently executable overlay at its declared test path`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return input.suite;
|
|
32
|
+
});
|
|
33
|
+
export const makeFixtureBuilder = Effect.succeed(FixtureBuilder.of({
|
|
34
|
+
compileReviewed: compileReviewedHiddenFixtureSuiteV1
|
|
35
|
+
}));
|
|
36
|
+
export const FixtureBuilderLive = Layer.effect(FixtureBuilder, makeFixtureBuilder);
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { type PipelineWorkCheckpointStoreV1 } from "../../case-pipeline-protocol.js";
|
|
3
|
+
import { RepositoryFoundryError } from "../../errors.js";
|
|
4
|
+
import { RepositoryHiddenFixtureSuiteV1 } from "../../repository-fixture-protocol.js";
|
|
5
|
+
import type { RepositoryFoundryModelCallV1, RepositoryFoundryModelPlanV1 } from "../../repository-language-model-protocol.js";
|
|
6
|
+
import { type RepositoryTaskSeedV1 } from "../../repository-task-seed-protocol.js";
|
|
7
|
+
import { RepositoryFoundryLanguageModel } from "../language-model/service.js";
|
|
8
|
+
/** Private, bounded author feedback; never stringify a structured cause as [object Object]. */
|
|
9
|
+
export declare const repositoryFixturePreflightFeedbackV1: (error: RepositoryFoundryError) => string;
|
|
10
|
+
/** Reference executability preflight only; never replaces independent oracle admission evidence. */
|
|
11
|
+
export declare const validateRepositoryFixturesV1: (input: {
|
|
12
|
+
readonly repositoryRoot: string;
|
|
13
|
+
readonly operationId: string;
|
|
14
|
+
readonly seed: RepositoryTaskSeedV1;
|
|
15
|
+
readonly suite: RepositoryHiddenFixtureSuiteV1;
|
|
16
|
+
readonly allowedTestPaths: ReadonlySet<string>;
|
|
17
|
+
readonly context: unknown;
|
|
18
|
+
readonly modelPlan: RepositoryFoundryModelPlanV1;
|
|
19
|
+
readonly maximumRepairAttempts: number;
|
|
20
|
+
readonly checkpointStore?: PipelineWorkCheckpointStoreV1;
|
|
21
|
+
readonly oracleCoverageWitnessVersion?: 1 | 2;
|
|
22
|
+
readonly oracleRepairFeedbackVersion?: 1;
|
|
23
|
+
readonly onRepairAttempt?: () => Effect.Effect<void>;
|
|
24
|
+
readonly onRepairCall?: (call: RepositoryFoundryModelCallV1) => Effect.Effect<void>;
|
|
25
|
+
}) => Effect.Effect<{
|
|
26
|
+
suite: {
|
|
27
|
+
readonly version: 1;
|
|
28
|
+
readonly caseId: string;
|
|
29
|
+
readonly fixtures: readonly ({
|
|
30
|
+
readonly kind: "historical-regression";
|
|
31
|
+
readonly expectationMode: "changes";
|
|
32
|
+
readonly id: string;
|
|
33
|
+
readonly description: string;
|
|
34
|
+
readonly expectedBehavior: string;
|
|
35
|
+
readonly source: "historical" | "generated" | "reviewed";
|
|
36
|
+
readonly testPath: string;
|
|
37
|
+
} | {
|
|
38
|
+
readonly kind: "boundary";
|
|
39
|
+
readonly expectationMode: "changes" | "preserved";
|
|
40
|
+
readonly id: string;
|
|
41
|
+
readonly description: string;
|
|
42
|
+
readonly expectedBehavior: string;
|
|
43
|
+
readonly source: "historical" | "generated" | "reviewed";
|
|
44
|
+
readonly testPath: string;
|
|
45
|
+
} | {
|
|
46
|
+
readonly kind: "counterfactual";
|
|
47
|
+
readonly expectationMode: "changes";
|
|
48
|
+
readonly id: string;
|
|
49
|
+
readonly description: string;
|
|
50
|
+
readonly expectedBehavior: string;
|
|
51
|
+
readonly source: "historical" | "generated" | "reviewed";
|
|
52
|
+
readonly testPath: string;
|
|
53
|
+
} | {
|
|
54
|
+
readonly kind: "metamorphic";
|
|
55
|
+
readonly expectationMode: "preserved";
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly description: string;
|
|
58
|
+
readonly expectedBehavior: string;
|
|
59
|
+
readonly source: "historical" | "generated" | "reviewed";
|
|
60
|
+
readonly testPath: string;
|
|
61
|
+
})[];
|
|
62
|
+
readonly overlays: readonly {
|
|
63
|
+
readonly path: string;
|
|
64
|
+
readonly content: string;
|
|
65
|
+
readonly fixtureIds: readonly string[];
|
|
66
|
+
}[];
|
|
67
|
+
};
|
|
68
|
+
modelCalls: {
|
|
69
|
+
readonly reasoningEffort: "high" | "medium" | "low" | "xhigh" | "max" | "ultra";
|
|
70
|
+
readonly role: "oracle-critic" | "repository-analyst" | "specification-writer" | "specification-critic-a" | "specification-critic-b" | "trajectory-designer" | "trajectory-critic" | "oracle-designer" | "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" | "hill-climb-planner";
|
|
71
|
+
readonly model: string;
|
|
72
|
+
readonly operationId: string;
|
|
73
|
+
readonly callId?: string | undefined;
|
|
74
|
+
}[];
|
|
75
|
+
}, RepositoryFoundryError, RepositoryFoundryLanguageModel>;
|