@velum-labs/routekit-eval-setup 1.3.2 → 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 -10
- package/dist/effect-api.js +56 -6
- 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 +140 -0
- package/dist/eval-event-log.js +220 -0
- 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 -17
- package/dist/index.js +69 -11
- package/dist/inspection.js +2 -3
- package/dist/project-artifacts.d.ts +7 -2
- package/dist/project-artifacts.js +49 -136
- package/dist/project-authoring.d.ts +66 -5
- package/dist/project-authoring.js +783 -109
- package/dist/project-contracts.d.ts +419 -84
- package/dist/project-contracts.js +160 -52
- package/dist/project-store.js +2 -1
- package/dist/project-workflow.d.ts +5 -4
- package/dist/project-workflow.js +154 -35
- 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.d.ts +1 -0
- package/dist/test/eval-event-log.test.js +125 -0
- 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 +419 -40
- 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 -6
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { PipelineCheckpointDescriptorV2, decodePipelineCheckpointDescriptorV2, pipelineCheckpointDescriptorDigestV2 } from "../../case-pipeline-protocol-v2.js";
|
|
4
|
+
import { RepositoryCandidateVisibleTaskV1 } from "../../repository-benchmark-protocol.js";
|
|
5
|
+
import { compilePortableRepositoryBundleV2 } from "../repository-bundle/service.js";
|
|
6
|
+
export const REPOSITORY_PUBLIC_ARTIFACT_PROJECTION_VERSION_V1 = 1;
|
|
7
|
+
const Sha256 = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => /^[a-f0-9]{64}$/u.test(value) ? undefined : "must be a lowercase SHA-256 digest")));
|
|
8
|
+
const CommitSha = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => /^[a-f0-9]{40}$/u.test(value) ? undefined : "must be a lowercase Git commit SHA")));
|
|
9
|
+
const BoundedId = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => value.length >= 1 && value.length <= 256 && value.trim() === value
|
|
10
|
+
? undefined
|
|
11
|
+
: "must be a trimmed identifier between 1 and 256 characters")));
|
|
12
|
+
const PositiveInteger = Schema.Finite.pipe(Schema.check(Schema.makeFilter((value) => Number.isInteger(value) && value > 0 ? undefined : "must be a positive integer")));
|
|
13
|
+
const NonNegativeInteger = Schema.Finite.pipe(Schema.check(Schema.makeFilter((value) => Number.isInteger(value) && value >= 0 ? undefined : "must be a non-negative integer")));
|
|
14
|
+
const Timestamp = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => {
|
|
15
|
+
const parsed = new Date(value);
|
|
16
|
+
return Number.isFinite(parsed.getTime()) && parsed.toISOString() === value
|
|
17
|
+
? undefined
|
|
18
|
+
: "must be a canonical ISO-8601 timestamp with millisecond precision";
|
|
19
|
+
})));
|
|
20
|
+
const QUALITY_AXES = [
|
|
21
|
+
"authenticity",
|
|
22
|
+
"specification-sufficiency",
|
|
23
|
+
"oracle-adequacy",
|
|
24
|
+
"stability",
|
|
25
|
+
"distinctness",
|
|
26
|
+
"realism",
|
|
27
|
+
"leakage",
|
|
28
|
+
"triviality",
|
|
29
|
+
"coverage"
|
|
30
|
+
];
|
|
31
|
+
const ADMISSION_QUALITY_AXES = new Set(QUALITY_AXES.filter((axis) => axis !== "coverage"));
|
|
32
|
+
export const RepositoryPublicArtifactQualityV1 = Schema.Struct({
|
|
33
|
+
axis: Schema.Literals(QUALITY_AXES),
|
|
34
|
+
outcome: Schema.Literals(["pass", "fail", "review-required"])
|
|
35
|
+
}).annotate({ parseOptions: { onExcessProperty: "error" } });
|
|
36
|
+
const RepositoryPublicArtifactQualitySetV1 = Schema.Array(RepositoryPublicArtifactQualityV1).pipe(Schema.check(Schema.makeFilter((quality) => {
|
|
37
|
+
const axes = quality.map(({ axis }) => axis);
|
|
38
|
+
if (quality.length !== QUALITY_AXES.length ||
|
|
39
|
+
new Set(axes).size !== quality.length ||
|
|
40
|
+
QUALITY_AXES.some((axis) => !axes.includes(axis))) {
|
|
41
|
+
return "admitted public artifacts require exactly one finding for every quality axis";
|
|
42
|
+
}
|
|
43
|
+
if (quality.some(({ axis, outcome }) => ADMISSION_QUALITY_AXES.has(axis) && outcome !== "pass")) {
|
|
44
|
+
return "admitted public artifacts require every admission quality axis to pass";
|
|
45
|
+
}
|
|
46
|
+
return undefined;
|
|
47
|
+
})));
|
|
48
|
+
export const RepositoryPublicArtifactTerminalCheckpointV1 = Schema.Struct({
|
|
49
|
+
...PipelineCheckpointDescriptorV2.fields,
|
|
50
|
+
kind: Schema.Literal("terminal"),
|
|
51
|
+
stage: Schema.Literal("admit"),
|
|
52
|
+
createdAt: Timestamp
|
|
53
|
+
}).annotate({ parseOptions: { onExcessProperty: "error" } });
|
|
54
|
+
export const RepositoryPublicArtifactInputV1 = Schema.Struct({
|
|
55
|
+
version: Schema.Literal(REPOSITORY_PUBLIC_ARTIFACT_PROJECTION_VERSION_V1),
|
|
56
|
+
admitted: Schema.Literal(true),
|
|
57
|
+
caseId: BoundedId,
|
|
58
|
+
capabilityId: BoundedId,
|
|
59
|
+
familyId: BoundedId,
|
|
60
|
+
lane: Schema.Literals(["request", "repository-agent"]),
|
|
61
|
+
visible: RepositoryCandidateVisibleTaskV1,
|
|
62
|
+
sourceCommitSha: CommitSha,
|
|
63
|
+
coverageCellId: BoundedId,
|
|
64
|
+
basisDigest: Sha256,
|
|
65
|
+
behavioralFingerprint: BoundedId,
|
|
66
|
+
admissionDigest: Sha256,
|
|
67
|
+
terminalCheckpoint: RepositoryPublicArtifactTerminalCheckpointV1,
|
|
68
|
+
quality: RepositoryPublicArtifactQualitySetV1
|
|
69
|
+
}).annotate({ parseOptions: { onExcessProperty: "error" } });
|
|
70
|
+
const RepositoryPublicEvalDefinitionV1 = Schema.Struct({
|
|
71
|
+
version: Schema.Literal(1),
|
|
72
|
+
id: BoundedId,
|
|
73
|
+
capabilityId: BoundedId,
|
|
74
|
+
familyId: BoundedId,
|
|
75
|
+
lane: Schema.Literals(["request", "repository-agent"]),
|
|
76
|
+
task: RepositoryCandidateVisibleTaskV1
|
|
77
|
+
});
|
|
78
|
+
const RepositoryPublicMetadataV1 = Schema.Struct({
|
|
79
|
+
version: Schema.Literal(1),
|
|
80
|
+
admitted: Schema.Literal(true),
|
|
81
|
+
caseId: BoundedId,
|
|
82
|
+
sourceCommitSha: CommitSha,
|
|
83
|
+
coverageCellId: BoundedId,
|
|
84
|
+
basisDigest: Sha256,
|
|
85
|
+
admissionDigest: Sha256,
|
|
86
|
+
terminalCheckpoint: Schema.Struct({
|
|
87
|
+
identityDigest: Sha256,
|
|
88
|
+
descriptorDigest: Sha256,
|
|
89
|
+
sequence: PositiveInteger,
|
|
90
|
+
attemptGeneration: PositiveInteger
|
|
91
|
+
}),
|
|
92
|
+
quality: RepositoryPublicArtifactQualitySetV1
|
|
93
|
+
});
|
|
94
|
+
const stableValue = (value) => {
|
|
95
|
+
if (Array.isArray(value))
|
|
96
|
+
return value.map(stableValue);
|
|
97
|
+
if (value !== null && typeof value === "object") {
|
|
98
|
+
return Object.fromEntries(Object.entries(value)
|
|
99
|
+
.filter(([, child]) => child !== undefined)
|
|
100
|
+
.sort(([left], [right]) => left.localeCompare(right))
|
|
101
|
+
.map(([key, child]) => [key, stableValue(child)]));
|
|
102
|
+
}
|
|
103
|
+
return value;
|
|
104
|
+
};
|
|
105
|
+
const stableJson = (value) => `${JSON.stringify(stableValue(value), null, 2)}\n`;
|
|
106
|
+
const digest = (value) => createHash("sha256").update(value, "utf8").digest("hex");
|
|
107
|
+
const PRIVATE_MATERIAL_PATTERNS = [
|
|
108
|
+
/\bHIDDEN[_ -]?FIXTURE(?:S|[_ -]?CANARY)?\b/iu,
|
|
109
|
+
/\bORACLE[_ -]?(?:BODY(?:[_ -]?CANARY)?|CANARY)\b/iu,
|
|
110
|
+
/\bSOLUTION[_ -]?CANARY\b/iu,
|
|
111
|
+
/\bADVERSAR(?:Y|IES)[_ -]?CANARY\b/iu,
|
|
112
|
+
/\bRAW[_ -]?MODEL[_ -]?(?:RESPONSE|OUTPUT)(?:[_ -]?CANARY)?\b/iu,
|
|
113
|
+
/\bPROVIDER[_ -]?DIAGNOSTICS?(?:[_ -]?CANARY)?\b/iu,
|
|
114
|
+
/\bPRIVATE[_ -]?(?:CHECKPOINT|EVIDENCE)(?:[_ -]?CANARY)?\b/iu,
|
|
115
|
+
/\bPRIVATE[_ -]?CANARY\b/iu
|
|
116
|
+
];
|
|
117
|
+
const assertNoPrivateMaterial = (value) => {
|
|
118
|
+
const inspect = (child) => {
|
|
119
|
+
if (typeof child === "string") {
|
|
120
|
+
if (PRIVATE_MATERIAL_PATTERNS.some((pattern) => pattern.test(child))) {
|
|
121
|
+
throw new Error("public artifact material resembles private foundry evidence");
|
|
122
|
+
}
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (Array.isArray(child)) {
|
|
126
|
+
for (const entry of child)
|
|
127
|
+
inspect(entry);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (child !== null && typeof child === "object") {
|
|
131
|
+
for (const entry of Object.values(child))
|
|
132
|
+
inspect(entry);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
inspect(value);
|
|
136
|
+
};
|
|
137
|
+
export const repositoryPublicArtifactPathIdV1 = (caseId) => {
|
|
138
|
+
const slug = caseId
|
|
139
|
+
.normalize("NFKC")
|
|
140
|
+
.toLowerCase()
|
|
141
|
+
.replace(/[^a-z0-9]+/gu, "-")
|
|
142
|
+
.replace(/^-+|-+$/gu, "")
|
|
143
|
+
.slice(0, 64);
|
|
144
|
+
return `${slug.length === 0 ? "case" : slug}-${digest(caseId).slice(0, 12)}`;
|
|
145
|
+
};
|
|
146
|
+
const decodePublicEvalDefinitionV1 = (content) => Schema.decodeUnknownSync(RepositoryPublicEvalDefinitionV1, { onExcessProperty: "error" })(JSON.parse(content));
|
|
147
|
+
const decodePublicMetadataV1 = (content) => Schema.decodeUnknownSync(RepositoryPublicMetadataV1, { onExcessProperty: "error" })(JSON.parse(content));
|
|
148
|
+
const RepositoryProjectedPublicArtifactV1Core = Schema.Struct({
|
|
149
|
+
path: Schema.String,
|
|
150
|
+
kind: Schema.Literals(["eval-definition", "public-metadata"]),
|
|
151
|
+
mediaType: Schema.Literal("application/json"),
|
|
152
|
+
content: Schema.String,
|
|
153
|
+
caseId: BoundedId,
|
|
154
|
+
admissionDigest: Sha256,
|
|
155
|
+
publicArtifactDigest: Sha256,
|
|
156
|
+
bytes: NonNegativeInteger,
|
|
157
|
+
visibility: Schema.Literal("public"),
|
|
158
|
+
fileType: Schema.Literal("regular")
|
|
159
|
+
});
|
|
160
|
+
export const RepositoryProjectedPublicArtifactV1 = RepositoryProjectedPublicArtifactV1Core.pipe(Schema.check(Schema.makeFilter((artifact) => {
|
|
161
|
+
if (artifact.publicArtifactDigest !== digest(artifact.content)) {
|
|
162
|
+
return "public artifact digest does not match its exact content";
|
|
163
|
+
}
|
|
164
|
+
if (artifact.bytes !== Buffer.byteLength(artifact.content, "utf8")) {
|
|
165
|
+
return "public artifact byte count does not match its exact content";
|
|
166
|
+
}
|
|
167
|
+
const id = repositoryPublicArtifactPathIdV1(artifact.caseId);
|
|
168
|
+
const expectedPath = artifact.kind === "eval-definition"
|
|
169
|
+
? `.routekit/evals/cases/${id}.eval.json`
|
|
170
|
+
: `.routekit/evals/cases/${id}.metadata.json`;
|
|
171
|
+
if (artifact.path !== expectedPath) {
|
|
172
|
+
return "public artifact path does not match its immutable case identity";
|
|
173
|
+
}
|
|
174
|
+
try {
|
|
175
|
+
assertNoPrivateMaterial(artifact);
|
|
176
|
+
if (artifact.kind === "eval-definition") {
|
|
177
|
+
const definition = decodePublicEvalDefinitionV1(artifact.content);
|
|
178
|
+
if (definition.id !== artifact.caseId ||
|
|
179
|
+
definition.task.id !== artifact.caseId ||
|
|
180
|
+
definition.task.lane !== definition.lane) {
|
|
181
|
+
return "public eval definition substituted its immutable case identity";
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
const metadata = decodePublicMetadataV1(artifact.content);
|
|
186
|
+
if (metadata.caseId !== artifact.caseId ||
|
|
187
|
+
metadata.admissionDigest !== artifact.admissionDigest) {
|
|
188
|
+
return "public metadata substituted its immutable admission identity";
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
compilePortableRepositoryBundleV2({
|
|
192
|
+
admitted: true,
|
|
193
|
+
sourceCommitSha: "0".repeat(40),
|
|
194
|
+
artifacts: [artifact]
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
return error instanceof Error ? error.message : "invalid public artifact content";
|
|
199
|
+
}
|
|
200
|
+
return undefined;
|
|
201
|
+
}))).annotate({ parseOptions: { onExcessProperty: "error" } });
|
|
202
|
+
export const repositoryPublicArtifactProjectionDigestV1 = (projection) => digest(stableJson({
|
|
203
|
+
...projection,
|
|
204
|
+
artifacts: projection.artifacts.map(({ content: _content, ...descriptor }) => descriptor)
|
|
205
|
+
}));
|
|
206
|
+
const RepositoryPublicArtifactProjectionV1Core = Schema.Struct({
|
|
207
|
+
version: Schema.Literal(REPOSITORY_PUBLIC_ARTIFACT_PROJECTION_VERSION_V1),
|
|
208
|
+
admitted: Schema.Literal(true),
|
|
209
|
+
caseId: BoundedId,
|
|
210
|
+
sourceCommitSha: CommitSha,
|
|
211
|
+
admissionDigest: Sha256,
|
|
212
|
+
terminalCheckpointDigest: Sha256,
|
|
213
|
+
projectionDigest: Sha256,
|
|
214
|
+
artifacts: Schema.Array(RepositoryProjectedPublicArtifactV1)
|
|
215
|
+
});
|
|
216
|
+
export const RepositoryPublicArtifactProjectionV1 = RepositoryPublicArtifactProjectionV1Core.pipe(Schema.check(Schema.makeFilter((projection) => {
|
|
217
|
+
if (projection.artifacts.length !== 2 ||
|
|
218
|
+
projection.artifacts[0]?.kind !== "eval-definition" ||
|
|
219
|
+
projection.artifacts[1]?.kind !== "public-metadata") {
|
|
220
|
+
return "public projection requires exactly its sorted definition and metadata artifacts";
|
|
221
|
+
}
|
|
222
|
+
if (projection.artifacts.some(({ caseId, admissionDigest }) => caseId !== projection.caseId || admissionDigest !== projection.admissionDigest)) {
|
|
223
|
+
return "public projection artifacts substituted case or admission identity";
|
|
224
|
+
}
|
|
225
|
+
try {
|
|
226
|
+
const definition = decodePublicEvalDefinitionV1(projection.artifacts[0].content);
|
|
227
|
+
const metadata = decodePublicMetadataV1(projection.artifacts[1].content);
|
|
228
|
+
if (metadata.sourceCommitSha !== projection.sourceCommitSha ||
|
|
229
|
+
metadata.terminalCheckpoint.descriptorDigest !==
|
|
230
|
+
projection.terminalCheckpointDigest ||
|
|
231
|
+
definition.id !== metadata.caseId ||
|
|
232
|
+
(definition.task.lane === "repository-agent" &&
|
|
233
|
+
definition.task.checkoutCommit !== projection.sourceCommitSha)) {
|
|
234
|
+
return "public projection substituted pinned source or terminal identity";
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
catch (error) {
|
|
238
|
+
return error instanceof Error ? error.message : "invalid public projection content";
|
|
239
|
+
}
|
|
240
|
+
const { projectionDigest: _projectionDigest, ...core } = projection;
|
|
241
|
+
if (projection.projectionDigest !== repositoryPublicArtifactProjectionDigestV1(core)) {
|
|
242
|
+
return "public projection digest does not bind its exact admitted artifacts";
|
|
243
|
+
}
|
|
244
|
+
return undefined;
|
|
245
|
+
}))).annotate({ parseOptions: { onExcessProperty: "error" } });
|
|
246
|
+
export const decodeRepositoryPublicArtifactProjectionV1 = (value) => Schema.decodeUnknownSync(RepositoryPublicArtifactProjectionV1, {
|
|
247
|
+
onExcessProperty: "error"
|
|
248
|
+
})(value);
|
|
249
|
+
const projectedArtifact = (artifact, provenance) => ({
|
|
250
|
+
...artifact,
|
|
251
|
+
caseId: provenance.caseId,
|
|
252
|
+
admissionDigest: provenance.admissionDigest,
|
|
253
|
+
publicArtifactDigest: digest(artifact.content),
|
|
254
|
+
bytes: Buffer.byteLength(artifact.content, "utf8"),
|
|
255
|
+
visibility: "public",
|
|
256
|
+
fileType: "regular"
|
|
257
|
+
});
|
|
258
|
+
/**
|
|
259
|
+
* Creates the only repository-visible representation of an admitted case.
|
|
260
|
+
*
|
|
261
|
+
* The input is an explicit strict public DTO, not a foundry result. Hidden
|
|
262
|
+
* fixtures, oracle bodies, solutions, adversaries, responses, diagnostics,
|
|
263
|
+
* credentials, and checkpoint payloads therefore have no representable field.
|
|
264
|
+
*/
|
|
265
|
+
export const makeRepositoryPublicArtifactProjectionV1 = (value) => {
|
|
266
|
+
const input = Schema.decodeUnknownSync(RepositoryPublicArtifactInputV1, {
|
|
267
|
+
onExcessProperty: "error"
|
|
268
|
+
})(value);
|
|
269
|
+
assertNoPrivateMaterial(input);
|
|
270
|
+
const terminalCheckpoint = decodePipelineCheckpointDescriptorV2(input.terminalCheckpoint);
|
|
271
|
+
const terminalCheckpointDigest = pipelineCheckpointDescriptorDigestV2(terminalCheckpoint);
|
|
272
|
+
if (input.visible.lane !== input.lane || input.visible.id !== input.caseId) {
|
|
273
|
+
throw new Error("public case identity does not match its visible task");
|
|
274
|
+
}
|
|
275
|
+
if (input.visible.lane === "repository-agent" &&
|
|
276
|
+
input.visible.checkoutCommit !== input.sourceCommitSha) {
|
|
277
|
+
throw new Error("public repository task is not pinned to the admitted source commit");
|
|
278
|
+
}
|
|
279
|
+
const quality = [...input.quality].sort((left, right) => left.axis.localeCompare(right.axis) || left.outcome.localeCompare(right.outcome));
|
|
280
|
+
const id = repositoryPublicArtifactPathIdV1(input.caseId);
|
|
281
|
+
const provenance = { caseId: input.caseId, admissionDigest: input.admissionDigest };
|
|
282
|
+
const definition = projectedArtifact({
|
|
283
|
+
path: `.routekit/evals/cases/${id}.eval.json`,
|
|
284
|
+
kind: "eval-definition",
|
|
285
|
+
mediaType: "application/json",
|
|
286
|
+
content: stableJson({
|
|
287
|
+
version: 1,
|
|
288
|
+
id: input.caseId,
|
|
289
|
+
capabilityId: input.capabilityId,
|
|
290
|
+
familyId: input.familyId,
|
|
291
|
+
lane: input.lane,
|
|
292
|
+
task: input.visible
|
|
293
|
+
})
|
|
294
|
+
}, provenance);
|
|
295
|
+
const metadata = projectedArtifact({
|
|
296
|
+
path: `.routekit/evals/cases/${id}.metadata.json`,
|
|
297
|
+
kind: "public-metadata",
|
|
298
|
+
mediaType: "application/json",
|
|
299
|
+
content: stableJson({
|
|
300
|
+
version: 1,
|
|
301
|
+
admitted: true,
|
|
302
|
+
caseId: input.caseId,
|
|
303
|
+
sourceCommitSha: input.sourceCommitSha,
|
|
304
|
+
coverageCellId: input.coverageCellId,
|
|
305
|
+
basisDigest: input.basisDigest,
|
|
306
|
+
admissionDigest: input.admissionDigest,
|
|
307
|
+
terminalCheckpoint: {
|
|
308
|
+
identityDigest: terminalCheckpoint.identityDigest,
|
|
309
|
+
descriptorDigest: terminalCheckpointDigest,
|
|
310
|
+
sequence: terminalCheckpoint.sequence,
|
|
311
|
+
attemptGeneration: terminalCheckpoint.attemptGeneration
|
|
312
|
+
},
|
|
313
|
+
quality
|
|
314
|
+
})
|
|
315
|
+
}, provenance);
|
|
316
|
+
const core = {
|
|
317
|
+
version: 1,
|
|
318
|
+
admitted: true,
|
|
319
|
+
caseId: input.caseId,
|
|
320
|
+
sourceCommitSha: input.sourceCommitSha,
|
|
321
|
+
admissionDigest: input.admissionDigest,
|
|
322
|
+
terminalCheckpointDigest,
|
|
323
|
+
artifacts: [definition, metadata]
|
|
324
|
+
};
|
|
325
|
+
return decodeRepositoryPublicArtifactProjectionV1({
|
|
326
|
+
...core,
|
|
327
|
+
projectionDigest: repositoryPublicArtifactProjectionDigestV1(core)
|
|
328
|
+
});
|
|
329
|
+
};
|
|
330
|
+
export const repositoryPublicArtifactVisibleTaskV1 = (input) => input.visible;
|