@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
|
@@ -3,6 +3,9 @@ import { assertRoutingBasis } from "@velum-labs/routekit-eval-contracts";
|
|
|
3
3
|
import { writeFileAtomicEffect } from "@velum-labs/routekit-runtime/effect";
|
|
4
4
|
import { Context, Effect, Exit, FileSystem, Layer, Path, Schema } from "effect";
|
|
5
5
|
import { EvalProjectArtifactError } from "./errors.js";
|
|
6
|
+
import { candidateCaseProjection, hiddenOracleProjection } from "./evaluation-structure-policy.js";
|
|
7
|
+
import { EVAL_GRADER_MINIMUM_SCORE, EVAL_GRADER_SYSTEM_PROMPT, renderEvaluationCandidatePromptSource } from "./evaluation-grading-policy.js";
|
|
8
|
+
import { assertEvaluationProposal, evaluationProposalDigest } from "./evaluation-proposal-policy.js";
|
|
6
9
|
import { EvalNamedEventLog as EvalNamedEventLogSchema } from "./eval-event-log.js";
|
|
7
10
|
import { EVAL_PROJECT_VERSION, EvalArtifactApproval as EvalArtifactApprovalSchema, BasisCandidatesArtifactsV3 as BasisCandidatesArtifactsV3Schema, BasisEvaluationProjectionV3 as BasisEvaluationProjectionV3Schema, BasisCandidateCheckpointV3 as BasisCandidateCheckpointV3Schema, BasisGenerationArtifactsV3 as BasisGenerationArtifactsV3Schema, BasisQualificationArtifactsV3 as BasisQualificationArtifactsV3Schema, BasisRepairArtifactsV3 as BasisRepairArtifactsV3Schema, BasisValidationJobCheckpointV3 as BasisValidationJobCheckpointV3Schema, BasisValidationResultsArtifactsV3 as BasisValidationResultsArtifactsV3Schema, BasisValidationArtifactsV3 as BasisValidationArtifactsV3Schema, EvalEvaluationProposal as EvalEvaluationProposalSchema, EvalExecutionPlan as EvalExecutionPlanSchema, EvalRoutingBasisProposal as EvalRoutingBasisProposalSchema, EvalRunReport as EvalRunReportSchema } from "./project-contracts.js";
|
|
8
11
|
const BASIS_PROPOSAL = "routing-basis.proposed.json";
|
|
@@ -34,29 +37,23 @@ const repeatedCase = (byId, selectedCaseId) => {
|
|
|
34
37
|
}
|
|
35
38
|
return { ...testCase, id: selectedCaseId };
|
|
36
39
|
};
|
|
37
|
-
const renderCandidatePrompt = () => `const prompt = [
|
|
38
|
-
testCase.prompt,
|
|
39
|
-
"",
|
|
40
|
-
"Response requirements:",
|
|
41
|
-
"- Answer every part of the request directly and completely.",
|
|
42
|
-
"- When translating protocols, emit the complete target-protocol envelope and terminal event; do not merely reframe or forward source objects.",
|
|
43
|
-
"- When asked for a body, bytes, frames, or code, include the concrete output rather than only describing it.",
|
|
44
|
-
...(testCase.context === undefined
|
|
45
|
-
? []
|
|
46
|
-
: ["", "Reference material:", "-----", testCase.context, "-----"])
|
|
47
|
-
].join("\\n");`;
|
|
48
40
|
const renderDimensionSuite = () => `import assert from "node:assert/strict";
|
|
49
41
|
import { test } from "node:test";
|
|
50
42
|
import { setupAgent, setupJudge } from "routekit/eval";
|
|
51
|
-
import
|
|
43
|
+
import candidateCases from "./data/candidate-cases.json" with { type: "json" };
|
|
44
|
+
import hiddenOracles from "./data/hidden-oracles.json" with { type: "json" };
|
|
52
45
|
import manifest from "./routekit.eval-manifest.json" with { type: "json" };
|
|
53
46
|
|
|
54
|
-
assert.equal(
|
|
55
|
-
assert.
|
|
47
|
+
assert.equal(candidateCases.length, manifest.caseCount);
|
|
48
|
+
assert.equal(hiddenOracles.length, manifest.caseCount);
|
|
49
|
+
assert.deepEqual(candidateCases.map((candidateCase) => candidateCase.id), manifest.caseIds);
|
|
50
|
+
assert.deepEqual(hiddenOracles.map((oracle) => oracle.id), manifest.caseIds);
|
|
56
51
|
const candidateReasoningEfforts = manifest.candidateReasoningEfforts ?? {};
|
|
52
|
+
const hiddenOracleById = new Map(hiddenOracles.map((oracle) => [oracle.id, oracle]));
|
|
57
53
|
const judge = setupJudge({
|
|
58
54
|
agent: setupAgent({ model: manifest.judgeModel }),
|
|
59
|
-
minScore:
|
|
55
|
+
minScore: ${String(EVAL_GRADER_MINIMUM_SCORE)},
|
|
56
|
+
systemPrompt: ${JSON.stringify(EVAL_GRADER_SYSTEM_PROMPT)}
|
|
60
57
|
});
|
|
61
58
|
|
|
62
59
|
for (const model of manifest.candidateModels) {
|
|
@@ -67,10 +64,10 @@ for (const model of manifest.candidateModels) {
|
|
|
67
64
|
? {}
|
|
68
65
|
: { parameters: { reasoning: { effort } } })
|
|
69
66
|
});
|
|
70
|
-
for (const
|
|
71
|
-
test(\`\${model} / \${
|
|
72
|
-
${
|
|
73
|
-
const run = await candidate.run({ prompt, caseId:
|
|
67
|
+
for (const candidateCase of candidateCases) {
|
|
68
|
+
test(\`\${model} / \${candidateCase.id}\`, async () => {
|
|
69
|
+
${renderEvaluationCandidatePromptSource()}
|
|
70
|
+
const run = await candidate.run({ prompt, caseId: candidateCase.id });
|
|
74
71
|
let candidateCompletionError;
|
|
75
72
|
try {
|
|
76
73
|
run.toComplete();
|
|
@@ -79,7 +76,9 @@ for (const model of manifest.candidateModels) {
|
|
|
79
76
|
}
|
|
80
77
|
let judgeError;
|
|
81
78
|
try {
|
|
82
|
-
|
|
79
|
+
const oracle = hiddenOracleById.get(candidateCase.id);
|
|
80
|
+
assert.ok(oracle);
|
|
81
|
+
await judge.autoEvals({ criteria: oracle.rubric, prompt, run });
|
|
83
82
|
} catch (error) {
|
|
84
83
|
judgeError = error;
|
|
85
84
|
}
|
|
@@ -103,96 +102,13 @@ const digest = (value) => createHash("sha256").update(JSON.stringify(value)).dig
|
|
|
103
102
|
export function routingBasisDigest(dimensions) {
|
|
104
103
|
return digest({ version: 2, dimensions });
|
|
105
104
|
}
|
|
106
|
-
export
|
|
107
|
-
return digest(proposal);
|
|
108
|
-
}
|
|
109
|
-
function assertEvaluationProposal(proposal) {
|
|
110
|
-
if (proposal.evaluationDigest !==
|
|
111
|
-
evaluationProposalDigest({
|
|
112
|
-
version: proposal.version,
|
|
113
|
-
basisDigest: proposal.basisDigest,
|
|
114
|
-
candidateModels: proposal.candidateModels,
|
|
115
|
-
...(proposal.candidateReasoningEfforts === undefined
|
|
116
|
-
? {}
|
|
117
|
-
: { candidateReasoningEfforts: proposal.candidateReasoningEfforts }),
|
|
118
|
-
judgeModel: proposal.judgeModel,
|
|
119
|
-
suites: proposal.suites,
|
|
120
|
-
decompositionBenchmark: proposal.decompositionBenchmark,
|
|
121
|
-
compositionSuite: proposal.compositionSuite
|
|
122
|
-
})) {
|
|
123
|
-
throw new Error("evaluation proposal digest does not match its contents");
|
|
124
|
-
}
|
|
125
|
-
if (proposal.candidateModels.length < 2) {
|
|
126
|
-
throw new Error("evaluation proposal requires at least two candidate models");
|
|
127
|
-
}
|
|
128
|
-
if (new Set(proposal.candidateModels).size !== proposal.candidateModels.length) {
|
|
129
|
-
throw new Error("evaluation proposal candidate models must be unique");
|
|
130
|
-
}
|
|
131
|
-
if (Object.keys(proposal.candidateReasoningEfforts ?? {}).some((model) => !proposal.candidateModels.includes(model))) {
|
|
132
|
-
throw new Error("evaluation proposal reasoning efforts must belong to candidate models");
|
|
133
|
-
}
|
|
134
|
-
if (proposal.judgeModel.trim().length === 0) {
|
|
135
|
-
throw new Error("evaluation proposal judge must be explicit");
|
|
136
|
-
}
|
|
137
|
-
const dimensions = new Set();
|
|
138
|
-
for (const suite of proposal.suites) {
|
|
139
|
-
if (dimensions.has(suite.dimensionId)) {
|
|
140
|
-
throw new Error(`duplicate dimension suite ${JSON.stringify(suite.dimensionId)}`);
|
|
141
|
-
}
|
|
142
|
-
dimensions.add(suite.dimensionId);
|
|
143
|
-
assertDimensionSuite(suite);
|
|
144
|
-
}
|
|
145
|
-
if (proposal.decompositionBenchmark.maximumVectorL1Error < 0 ||
|
|
146
|
-
proposal.decompositionBenchmark.maximumVectorL1Error > 2 ||
|
|
147
|
-
proposal.decompositionBenchmark.cases.length < 5) {
|
|
148
|
-
throw new Error("decomposition benchmark must define a reviewed threshold and at least five cases");
|
|
149
|
-
}
|
|
150
|
-
if (proposal.compositionSuite.maximumOutputTokens < 1 ||
|
|
151
|
-
proposal.compositionSuite.minimumWinnerScoreGap < 0 ||
|
|
152
|
-
proposal.compositionSuite.minimumWinnerScoreGap > 1 ||
|
|
153
|
-
proposal.compositionSuite.minimumWinnerAgreement < 0 ||
|
|
154
|
-
proposal.compositionSuite.minimumWinnerAgreement > 1 ||
|
|
155
|
-
proposal.compositionSuite.cases.length < 5) {
|
|
156
|
-
throw new Error("composition benchmark must define reviewed thresholds and at least five cases");
|
|
157
|
-
}
|
|
158
|
-
for (const [label, cases] of [
|
|
159
|
-
["decomposition", proposal.decompositionBenchmark.cases],
|
|
160
|
-
["composition", proposal.compositionSuite.cases]
|
|
161
|
-
]) {
|
|
162
|
-
const ids = new Set();
|
|
163
|
-
for (const testCase of cases) {
|
|
164
|
-
if (testCase.id.trim().length === 0 || ids.has(testCase.id)) {
|
|
165
|
-
throw new Error(`${label} benchmark contains an invalid or duplicate case id`);
|
|
166
|
-
}
|
|
167
|
-
ids.add(testCase.id);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
function assertDimensionSuite(suite) {
|
|
172
|
-
if (suite.maximumOutputTokens < 1) {
|
|
173
|
-
throw new Error(`dimension suite ${JSON.stringify(suite.dimensionId)} has no output allowance`);
|
|
174
|
-
}
|
|
175
|
-
if (suite.cases.length < 5) {
|
|
176
|
-
throw new Error(`dimension suite ${JSON.stringify(suite.dimensionId)} must contain at least five cases`);
|
|
177
|
-
}
|
|
178
|
-
const ids = new Set();
|
|
179
|
-
for (const testCase of suite.cases) {
|
|
180
|
-
if (testCase.id.trim().length === 0 ||
|
|
181
|
-
testCase.prompt.trim().length === 0 ||
|
|
182
|
-
testCase.rubric.trim().length === 0) {
|
|
183
|
-
throw new Error(`dimension suite ${JSON.stringify(suite.dimensionId)} contains an incomplete case`);
|
|
184
|
-
}
|
|
185
|
-
if (ids.has(testCase.id)) {
|
|
186
|
-
throw new Error(`dimension suite ${JSON.stringify(suite.dimensionId)} contains duplicate case ${JSON.stringify(testCase.id)}`);
|
|
187
|
-
}
|
|
188
|
-
ids.add(testCase.id);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
105
|
+
export { evaluationProposalDigest };
|
|
191
106
|
export class EvalProjectArtifacts extends Context.Service()("@velum-labs/routekit-eval-setup/EvalProjectArtifacts") {
|
|
192
107
|
}
|
|
193
108
|
export const makeFileEvalProjectArtifacts = Effect.gen(function* () {
|
|
194
109
|
const fs = yield* FileSystem.FileSystem;
|
|
195
110
|
const paths = yield* Path.Path;
|
|
111
|
+
const platform = yield* Effect.context();
|
|
196
112
|
const root = (repositoryRoot) => paths.join(paths.resolve(repositoryRoot), ".routekit", "evals");
|
|
197
113
|
const artifactPath = (repositoryRoot, name) => paths.join(root(repositoryRoot), name);
|
|
198
114
|
const candidateCheckpointName = (recipeId) => ARTIFACT_ID.test(recipeId)
|
|
@@ -209,7 +125,7 @@ export const makeFileEvalProjectArtifacts = Effect.gen(function* () {
|
|
|
209
125
|
};
|
|
210
126
|
const writeAtomic = (target, content) => writeFileAtomicEffect(target, content, {
|
|
211
127
|
mode: 0o600
|
|
212
|
-
}).pipe(Effect.mapError((cause) => artifactFailure("writing", target, cause)), Effect.
|
|
128
|
+
}).pipe(Effect.mapError((cause) => artifactFailure("writing", target, cause)), Effect.provide(platform));
|
|
213
129
|
const read = (repositoryRoot, name, decode) => Effect.gen(function* () {
|
|
214
130
|
const target = artifactPath(repositoryRoot, name);
|
|
215
131
|
const exists = yield* fs
|
|
@@ -308,19 +224,6 @@ export const makeFileEvalProjectArtifacts = Effect.gen(function* () {
|
|
|
308
224
|
for (const suite of proposal.suites) {
|
|
309
225
|
const suiteRoot = paths.join("dimensions", suite.dimensionId);
|
|
310
226
|
yield* write(repositoryRoot, paths.join(suiteRoot, "suite.json"), suite);
|
|
311
|
-
yield* writeText(repositoryRoot, paths.join(suiteRoot, `${suite.dimensionId}.eval.ts`), renderDimensionSuite());
|
|
312
|
-
yield* write(repositoryRoot, paths.join(suiteRoot, "data", "cases.json"), suite.cases);
|
|
313
|
-
yield* write(repositoryRoot, paths.join(suiteRoot, "routekit.eval-manifest.json"), {
|
|
314
|
-
version: EVAL_PROJECT_VERSION,
|
|
315
|
-
profileId: suite.dimensionId,
|
|
316
|
-
candidateModels: proposal.candidateModels,
|
|
317
|
-
candidateReasoningEfforts: proposal.candidateReasoningEfforts ?? {},
|
|
318
|
-
judgeModel: proposal.judgeModel,
|
|
319
|
-
caseCount: suite.cases.length,
|
|
320
|
-
caseIds: suite.cases.map((testCase) => testCase.id),
|
|
321
|
-
maxOutputTokens: suite.maximumOutputTokens,
|
|
322
|
-
expectedCallCount: suite.cases.length * proposal.candidateModels.length * 2
|
|
323
|
-
});
|
|
324
227
|
}
|
|
325
228
|
yield* write(repositoryRoot, paths.join("benchmarks", "decomposition.json"), proposal.decompositionBenchmark);
|
|
326
229
|
yield* write(repositoryRoot, paths.join("benchmarks", "composition.json"), proposal.compositionSuite);
|
|
@@ -343,7 +246,8 @@ export const makeFileEvalProjectArtifacts = Effect.gen(function* () {
|
|
|
343
246
|
const cases = selection.caseIds.map((caseId) => repeatedCase(byId, caseId));
|
|
344
247
|
const suiteRoot = paths.join("plans", plan.planId, "dimensions", selection.dimensionId);
|
|
345
248
|
yield* writeText(repositoryRoot, paths.join(suiteRoot, `${selection.dimensionId}.eval.ts`), renderDimensionSuite(), mode === "rematerialize");
|
|
346
|
-
yield* write(repositoryRoot, paths.join(suiteRoot, "data", "cases.json"), cases, mode === "rematerialize");
|
|
249
|
+
yield* write(repositoryRoot, paths.join(suiteRoot, "data", "candidate-cases.json"), cases.map(candidateCaseProjection), mode === "rematerialize");
|
|
250
|
+
yield* write(repositoryRoot, paths.join(suiteRoot, "data", "hidden-oracles.json"), cases.map(hiddenOracleProjection), mode === "rematerialize");
|
|
347
251
|
yield* write(repositoryRoot, paths.join(suiteRoot, "routekit.eval-manifest.json"), {
|
|
348
252
|
version: EVAL_PROJECT_VERSION,
|
|
349
253
|
profileId: selection.dimensionId,
|
|
@@ -360,7 +264,8 @@ export const makeFileEvalProjectArtifacts = Effect.gen(function* () {
|
|
|
360
264
|
const compositionCases = plan.selectedCompositionCaseIds.map((caseId) => repeatedCase(compositionById, caseId));
|
|
361
265
|
const compositionRoot = paths.join("plans", plan.planId, "composition");
|
|
362
266
|
yield* writeText(repositoryRoot, paths.join(compositionRoot, "composition.eval.ts"), renderDimensionSuite(), mode === "rematerialize");
|
|
363
|
-
yield* write(repositoryRoot, paths.join(compositionRoot, "data", "cases.json"), compositionCases, mode === "rematerialize");
|
|
267
|
+
yield* write(repositoryRoot, paths.join(compositionRoot, "data", "candidate-cases.json"), compositionCases.map(candidateCaseProjection), mode === "rematerialize");
|
|
268
|
+
yield* write(repositoryRoot, paths.join(compositionRoot, "data", "hidden-oracles.json"), compositionCases.map(hiddenOracleProjection), mode === "rematerialize");
|
|
364
269
|
yield* write(repositoryRoot, paths.join(compositionRoot, "routekit.eval-manifest.json"), {
|
|
365
270
|
version: EVAL_PROJECT_VERSION,
|
|
366
271
|
profileId: "composition",
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { type RoutingBasis } from "@velum-labs/routekit-eval-contracts";
|
|
2
2
|
import { Context, Effect, FileSystem, Layer, Path } from "effect";
|
|
3
3
|
import { EvalProjectAuthoringError } from "./errors.js";
|
|
4
|
-
import { type EvalEvaluationProposal, type EvalProposedDimension, type EvalProjectConfiguration } from "./project-contracts.js";
|
|
4
|
+
import { type EvalEvidenceSource, type EvalEvaluationProposal, type EvalProposedDimension, type EvalProjectConfiguration } from "./project-contracts.js";
|
|
5
5
|
export declare const EVAL_AUTHORING_SOURCE_BYTES = 60000;
|
|
6
6
|
export declare const EVAL_AUTHORING_SOURCE_FILES = 64;
|
|
7
7
|
export declare const EVAL_AUTHORING_CASES_PER_DIMENSION = 20;
|
|
8
8
|
export declare const EVAL_AUTHORING_EVALUATION_OUTPUT_TOKENS = 32768;
|
|
9
|
+
/**
|
|
10
|
+
* A routing basis admits at most ten dimensions, so cross-dimension preflight
|
|
11
|
+
* requests at most half as many dossiers as a twenty-case suite with the same
|
|
12
|
+
* authored-case schema. This is an output allowance, not a quality threshold.
|
|
13
|
+
*/
|
|
14
|
+
export declare const EVAL_AUTHORING_PREFLIGHT_OUTPUT_TOKENS = 16384;
|
|
9
15
|
/**
|
|
10
16
|
* Maximum serialized request body admitted for one authoring call.
|
|
11
17
|
*
|
|
@@ -14,37 +20,92 @@ export declare const EVAL_AUTHORING_EVALUATION_OUTPUT_TOKENS = 32768;
|
|
|
14
20
|
* reserves serialized UTF-8 bytes as a conservative input-token upper bound.
|
|
15
21
|
*/
|
|
16
22
|
export declare const EVAL_AUTHORING_REQUEST_BYTES = 512000;
|
|
23
|
+
/**
|
|
24
|
+
* Complete frozen reviews include both control populations and their replay
|
|
25
|
+
* history. This separately budgeted allowance is opt-in; archived authoring
|
|
26
|
+
* envelopes and all non-review roles retain the original 512KB bound.
|
|
27
|
+
*/
|
|
28
|
+
export declare const EVAL_AUTHORING_REVIEW_REQUEST_BYTES = 1000000;
|
|
17
29
|
export type EvalAuthoringSource = {
|
|
18
30
|
readonly path: string;
|
|
19
31
|
readonly content: string;
|
|
20
32
|
};
|
|
33
|
+
export type EvalAuthoringSourceClass = "implementation" | "test" | "protocol" | "documentation" | "operational";
|
|
34
|
+
export type EvalAuthoringSourceManifestEntry = {
|
|
35
|
+
readonly path: string;
|
|
36
|
+
readonly sizeBytes: number;
|
|
37
|
+
readonly sourceClass: EvalAuthoringSourceClass;
|
|
38
|
+
readonly targetDimensions: readonly string[];
|
|
39
|
+
readonly inclusionReason: string;
|
|
40
|
+
};
|
|
41
|
+
export type EvalAuthoringSourceManifest = {
|
|
42
|
+
readonly version: 1;
|
|
43
|
+
readonly purpose: "dimensions" | "evaluations";
|
|
44
|
+
readonly workloadDescription: string;
|
|
45
|
+
readonly basisDigest?: string;
|
|
46
|
+
readonly packets: readonly {
|
|
47
|
+
readonly target: string;
|
|
48
|
+
readonly targetDimensions: readonly string[];
|
|
49
|
+
readonly sources: readonly EvalAuthoringSourceManifestEntry[];
|
|
50
|
+
}[];
|
|
51
|
+
};
|
|
21
52
|
export type EvalAuthoringCompletion = {
|
|
22
53
|
readonly operationId: string;
|
|
23
54
|
readonly model: string;
|
|
55
|
+
readonly foundryRole?: string;
|
|
56
|
+
readonly reasoningEffort?: string;
|
|
57
|
+
readonly reviewInputVersion?: 2;
|
|
24
58
|
readonly instructions: string;
|
|
25
59
|
readonly input: string;
|
|
26
60
|
readonly schemaName: string;
|
|
27
61
|
readonly jsonSchema: Readonly<Record<string, unknown>>;
|
|
28
62
|
readonly maximumOutputTokens: number;
|
|
29
63
|
};
|
|
64
|
+
export type EvalAuthoringCompletionResult = {
|
|
65
|
+
readonly text: string;
|
|
66
|
+
readonly callId?: string;
|
|
67
|
+
};
|
|
30
68
|
export type EvalAuthoringTransportShape = {
|
|
31
69
|
readonly complete: (input: EvalAuthoringCompletion) => Effect.Effect<string, EvalProjectAuthoringError>;
|
|
70
|
+
readonly completeDetailed?: (input: EvalAuthoringCompletion) => Effect.Effect<EvalAuthoringCompletionResult, EvalProjectAuthoringError>;
|
|
32
71
|
};
|
|
33
72
|
declare const EvalAuthoringTransport_base: Context.ServiceClass<EvalAuthoringTransport, "@velum-labs/routekit-eval-setup/EvalAuthoringTransport", EvalAuthoringTransportShape>;
|
|
34
73
|
export declare class EvalAuthoringTransport extends EvalAuthoringTransport_base {
|
|
35
74
|
}
|
|
36
|
-
/**
|
|
37
|
-
* Revalidate every selected source at the read boundary. Discovery inventory
|
|
38
|
-
* membership is necessary but not sufficient because the checkout may mutate.
|
|
39
|
-
*/
|
|
40
75
|
export declare function readProjectAuthoringSources(input: {
|
|
41
76
|
readonly repositoryRoot: string;
|
|
42
77
|
readonly selectedFiles: readonly string[];
|
|
43
78
|
readonly sourceInventory: readonly string[];
|
|
44
79
|
}): Effect.Effect<readonly EvalAuthoringSource[], EvalProjectAuthoringError, FileSystem.FileSystem | Path.Path>;
|
|
80
|
+
type EvalAuthoringSourcePacket = {
|
|
81
|
+
readonly sources: readonly EvalAuthoringSourceManifestEntry[];
|
|
82
|
+
};
|
|
83
|
+
type EvalAuthoringEvidencePacket = {
|
|
84
|
+
readonly packet: EvalAuthoringSourcePacket;
|
|
85
|
+
readonly evidenceSources: readonly EvalEvidenceSource[];
|
|
86
|
+
};
|
|
87
|
+
type EvalAuthoringDimensionEvidencePacket = EvalAuthoringEvidencePacket & {
|
|
88
|
+
readonly preflightEvidenceSources: readonly EvalEvidenceSource[];
|
|
89
|
+
};
|
|
90
|
+
export declare const selectProjectAuthoringEvidencePacket: (input: {
|
|
91
|
+
readonly repositoryRoot: string;
|
|
92
|
+
readonly sourceInventory: readonly string[];
|
|
93
|
+
readonly targetDimensions: RoutingBasis["dimensions"];
|
|
94
|
+
}) => Effect.Effect<EvalAuthoringDimensionEvidencePacket, EvalProjectAuthoringError, FileSystem.FileSystem | Path.Path>;
|
|
95
|
+
export declare const selectSharedProjectAuthoringEvidencePacket: (input: {
|
|
96
|
+
readonly repositoryRoot: string;
|
|
97
|
+
readonly sourceInventory: readonly string[];
|
|
98
|
+
readonly targetDimensions: RoutingBasis["dimensions"];
|
|
99
|
+
}) => Effect.Effect<EvalAuthoringEvidencePacket, EvalProjectAuthoringError, FileSystem.FileSystem | Path.Path>;
|
|
45
100
|
export declare function selectProjectAuthoringSourceFiles(input: {
|
|
46
101
|
readonly repositoryRoot: string;
|
|
47
102
|
readonly sourceInventory: readonly string[];
|
|
103
|
+
readonly workloadDescription?: string;
|
|
104
|
+
readonly targetDimensions?: RoutingBasis["dimensions"];
|
|
105
|
+
readonly explicitInclusions?: readonly {
|
|
106
|
+
readonly path: string;
|
|
107
|
+
readonly reason: string;
|
|
108
|
+
}[];
|
|
48
109
|
}): Effect.Effect<readonly string[], EvalProjectAuthoringError, FileSystem.FileSystem | Path.Path>;
|
|
49
110
|
export type EvalProjectAuthorShape = {
|
|
50
111
|
readonly proposeDimensions: (input: {
|