@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 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { test } from "node:test";
|
|
3
|
+
import { repositoryCommandTestEvidenceV1 } from "../adapters/repository-command-evidence.js";
|
|
4
|
+
import { repositoryVitestTestArgumentsV1 } from "../adapters/repository-vitest-reporter.js";
|
|
5
|
+
import { VITEST_REPORTER_RESULTS } from "./fixtures/vitest-reporter-results.js";
|
|
6
|
+
const recipe = {
|
|
7
|
+
id: "vitest-behavior",
|
|
8
|
+
kind: "test",
|
|
9
|
+
cwd: ".",
|
|
10
|
+
executable: "corepack",
|
|
11
|
+
args: ["pnpm@11.15.1", "exec", "vitest", "run", "test/behavior.test.ts"],
|
|
12
|
+
timeoutMs: 10000
|
|
13
|
+
};
|
|
14
|
+
const result = (fixture, patch = {}) => ({
|
|
15
|
+
recipeId: recipe.id,
|
|
16
|
+
commit: "synthetic-fixture",
|
|
17
|
+
repetition: 1,
|
|
18
|
+
stage: "grade",
|
|
19
|
+
gradeExecuted: true,
|
|
20
|
+
exitCode: fixture.exitCode,
|
|
21
|
+
timedOut: false,
|
|
22
|
+
outputTruncated: false,
|
|
23
|
+
stdout: fixture.stdout,
|
|
24
|
+
stderr: "",
|
|
25
|
+
durationMs: 1,
|
|
26
|
+
trustedPreparationResults: [],
|
|
27
|
+
candidateValidationResults: [],
|
|
28
|
+
testReporter: "vitest-v1",
|
|
29
|
+
...patch
|
|
30
|
+
});
|
|
31
|
+
// Deliberately synthetic new-envelope data only for parser-shape mutation tests.
|
|
32
|
+
// These are not converted historical transcripts or framework-execution proof.
|
|
33
|
+
const schemaFixture = (failed) => ({
|
|
34
|
+
exitCode: failed ? 1 : 0,
|
|
35
|
+
stdout: "ROUTEKIT_VITEST_PHASE_EVIDENCE_V1 " + JSON.stringify({
|
|
36
|
+
version: 1, complete: true, starts: 1, ends: 1, reason: failed ? "failed" : "passed",
|
|
37
|
+
eventIntegrity: true, unfinishedHooks: false, completedTestIds: ["schema-test"], unhandledErrors: [],
|
|
38
|
+
modules: [{ id: "schema-module", state: failed ? "failed" : "passed", errors: [], hooks: [], suites: [],
|
|
39
|
+
tests: [{ id: "schema-test", name: "synthetic parser shape", state: failed ? "failed" : "passed",
|
|
40
|
+
errors: failed ? [{ name: "AssertionError", code: "ERR_ASSERTION" }] : [], hooks: [],
|
|
41
|
+
diagnostic: { retryCount: 0, repeatCount: 0, flaky: false, duration: 1 } }] }]
|
|
42
|
+
}) + "\n"
|
|
43
|
+
});
|
|
44
|
+
// Keep the raw historical captures unchanged, including their historical expected
|
|
45
|
+
// outcome annotations. They can no longer prove that an assertion was in a body.
|
|
46
|
+
test("legacy Vitest transcripts without phase attribution retain no semantic credit", () => {
|
|
47
|
+
for (const fixture of VITEST_REPORTER_RESULTS) {
|
|
48
|
+
const evidence = repositoryCommandTestEvidenceV1(result(fixture), recipe.id);
|
|
49
|
+
assert.equal(evidence.outcome, "unknown", fixture.name);
|
|
50
|
+
assert.equal(evidence.detail, "legacy Vitest evidence has no host-owned phase attribution");
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
test("candidate output cannot select the Vitest evidence adapter", () => {
|
|
54
|
+
const fixture = schemaFixture(false);
|
|
55
|
+
const untagged = result(fixture);
|
|
56
|
+
const { testReporter: _testReporter, ...withoutHostSelection } = untagged;
|
|
57
|
+
assert.equal(repositoryCommandTestEvidenceV1(withoutHostSelection, recipe.id).outcome, "unknown");
|
|
58
|
+
assert.equal(repositoryCommandTestEvidenceV1(result(fixture, { stdout: "" }), recipe.id).outcome, "unknown", "a selected reporter must emit its protocol, regardless of process success");
|
|
59
|
+
});
|
|
60
|
+
test("Vitest evidence cannot rescue interrupted, truncated, unexecuted or invalidated runs", () => {
|
|
61
|
+
const fixture = schemaFixture(false);
|
|
62
|
+
const invalid = [
|
|
63
|
+
{ timedOut: true },
|
|
64
|
+
{ outputTruncated: true },
|
|
65
|
+
{ exitCode: null },
|
|
66
|
+
{ gradeExecuted: false },
|
|
67
|
+
{ stage: "candidate-validation" },
|
|
68
|
+
{ recipeId: "different-recipe" },
|
|
69
|
+
{
|
|
70
|
+
candidateValidationResults: [
|
|
71
|
+
{
|
|
72
|
+
recipeId: "build",
|
|
73
|
+
commit: "synthetic-fixture",
|
|
74
|
+
repetition: 1,
|
|
75
|
+
stage: "candidate-validation",
|
|
76
|
+
exitCode: 1,
|
|
77
|
+
timedOut: false,
|
|
78
|
+
outputTruncated: false,
|
|
79
|
+
stdout: "",
|
|
80
|
+
stderr: "build did not pass",
|
|
81
|
+
durationMs: 1
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
];
|
|
86
|
+
for (const patch of invalid) {
|
|
87
|
+
assert.equal(repositoryCommandTestEvidenceV1(result(fixture, patch), recipe.id).outcome, "unknown", JSON.stringify(patch));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
test("duplicate, malformed and incomplete Vitest completion frames remain unknown", () => {
|
|
91
|
+
const fixture = schemaFixture(false);
|
|
92
|
+
assert.equal(repositoryCommandTestEvidenceV1(result(fixture), recipe.id).outcome, "pass", "schema mutation cases must start from a valid parser shape, not already-invalid legacy data");
|
|
93
|
+
const prefix = "ROUTEKIT_VITEST_PHASE_EVIDENCE_V1 ";
|
|
94
|
+
const parse = () => JSON.parse(fixture.stdout.slice(prefix.length));
|
|
95
|
+
const altered = (patch) => `${prefix}${JSON.stringify({ ...parse(), ...patch })}\n`;
|
|
96
|
+
const invalid = [
|
|
97
|
+
fixture.stdout + fixture.stdout,
|
|
98
|
+
fixture.stdout + VITEST_REPORTER_RESULTS[0].stdout,
|
|
99
|
+
`${prefix}{incomplete\n`,
|
|
100
|
+
altered({ complete: false }),
|
|
101
|
+
altered({ starts: 2 }),
|
|
102
|
+
altered({ ends: 2 }),
|
|
103
|
+
altered({ eventIntegrity: false }),
|
|
104
|
+
altered({ unfinishedHooks: true }),
|
|
105
|
+
altered({ completedTestIds: [] }),
|
|
106
|
+
altered({ completedTestIds: ["extra-case"] }),
|
|
107
|
+
altered({ reason: "interrupted" }),
|
|
108
|
+
altered({ modules: [] }),
|
|
109
|
+
altered({ unhandledErrors: [{ name: "AssertionError" }] })
|
|
110
|
+
];
|
|
111
|
+
for (const stdout of invalid) {
|
|
112
|
+
assert.equal(repositoryCommandTestEvidenceV1(result(fixture, { stdout }), recipe.id).outcome, "unknown", stdout);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
test("Vitest assertions cannot be admitted with inconsistent process or runner status", () => {
|
|
116
|
+
const passed = schemaFixture(false);
|
|
117
|
+
const failed = schemaFixture(true);
|
|
118
|
+
assert.equal(repositoryCommandTestEvidenceV1(result(passed, { exitCode: 1 }), recipe.id).outcome, "unknown");
|
|
119
|
+
assert.equal(repositoryCommandTestEvidenceV1(result(failed, { exitCode: 0 }), recipe.id).outcome, "unknown");
|
|
120
|
+
assert.equal(repositoryCommandTestEvidenceV1(result(failed, { exitCode: 2 }), recipe.id).outcome, "unknown");
|
|
121
|
+
});
|
|
122
|
+
test("only canonical one-shot Vitest commands receive the host reporter", () => {
|
|
123
|
+
const reporter = "/isolated/host-reporter.mjs";
|
|
124
|
+
const hostArguments = [
|
|
125
|
+
"--api.host=127.0.0.1",
|
|
126
|
+
"--api.middlewareMode",
|
|
127
|
+
"--reporter",
|
|
128
|
+
reporter
|
|
129
|
+
];
|
|
130
|
+
assert.deepEqual(repositoryVitestTestArgumentsV1(recipe, reporter), [
|
|
131
|
+
...recipe.args,
|
|
132
|
+
...hostArguments
|
|
133
|
+
]);
|
|
134
|
+
assert.deepEqual(repositoryVitestTestArgumentsV1({
|
|
135
|
+
...recipe,
|
|
136
|
+
args: [
|
|
137
|
+
...recipe.args,
|
|
138
|
+
"--reporter=json",
|
|
139
|
+
"--reporter",
|
|
140
|
+
"tap",
|
|
141
|
+
"--outputFile.json=old.json",
|
|
142
|
+
"--outputFile",
|
|
143
|
+
"old.txt",
|
|
144
|
+
"--api.host=localhost",
|
|
145
|
+
"--api.middlewareMode=false"
|
|
146
|
+
]
|
|
147
|
+
}, reporter), [...recipe.args, ...hostArguments]);
|
|
148
|
+
assert.deepEqual(repositoryVitestTestArgumentsV1({ ...recipe, executable: "pnpm", args: ["exec", "vitest", "run", "test.js"] }, reporter), ["exec", "vitest", "run", "test.js", ...hostArguments]);
|
|
149
|
+
for (const args of [
|
|
150
|
+
["pnpm@11.15.1", "exec", "vitest"],
|
|
151
|
+
["pnpm@11.15.1", "exec", "vitest", "watch"],
|
|
152
|
+
["pnpm@11.15.1", "exec", "node", "--test", "test.js"],
|
|
153
|
+
["npm", "exec", "vitest", "run"],
|
|
154
|
+
["pnpm@11.15.1", "test"]
|
|
155
|
+
]) {
|
|
156
|
+
assert.equal(repositoryVitestTestArgumentsV1({ ...recipe, args }, reporter), undefined);
|
|
157
|
+
}
|
|
158
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { execFile } from "node:child_process";
|
|
3
|
+
import { mkdir, mkdtemp, realpath, rm, writeFile } from "node:fs/promises";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { dirname, join } from "node:path";
|
|
6
|
+
import { test } from "node:test";
|
|
7
|
+
import { promisify } from "node:util";
|
|
8
|
+
import { Effect } from "effect";
|
|
9
|
+
import { replayRepositoryCommandsV1 } from "../adapters/repository-command-runner.js";
|
|
10
|
+
import { buildRepositoryBehaviorMapV1 } from "../services/repository-model/service.js";
|
|
11
|
+
import { extractHistoricalTaskSeedsV1 } from "../services/task-seed/service.js";
|
|
12
|
+
const exec = promisify(execFile);
|
|
13
|
+
async function repository(t, cycle = false, frameworkTarget = false) {
|
|
14
|
+
const root = await realpath(await mkdtemp(join(tmpdir(), "routekit-workspace-build-unit-")));
|
|
15
|
+
t.after(() => rm(root, { recursive: true, force: true }));
|
|
16
|
+
const file = async (path, content) => {
|
|
17
|
+
await mkdir(dirname(join(root, path)), { recursive: true });
|
|
18
|
+
await writeFile(join(root, path), content);
|
|
19
|
+
};
|
|
20
|
+
const manifest = (path, value) => file(path, `${JSON.stringify(value)}\n`);
|
|
21
|
+
await manifest("package.json", {
|
|
22
|
+
name: "workspace-build-fixture",
|
|
23
|
+
private: true,
|
|
24
|
+
packageManager: "pnpm@11.15.1"
|
|
25
|
+
});
|
|
26
|
+
await file("pnpm-workspace.yaml", 'packages:\n - "packages/*"\n - "apps/*"\n');
|
|
27
|
+
for (const [name, dependency] of [
|
|
28
|
+
["base", undefined],
|
|
29
|
+
["library", "base"]
|
|
30
|
+
]) {
|
|
31
|
+
await manifest(`packages/${name}/package.json`, {
|
|
32
|
+
name: `@fixture/${name}`,
|
|
33
|
+
type: "module",
|
|
34
|
+
exports: "./dist/index.js",
|
|
35
|
+
scripts: { build: "node build.mjs" },
|
|
36
|
+
...(dependency !== undefined || cycle
|
|
37
|
+
? { dependencies: { [`@fixture/${dependency ?? "library"}`]: "workspace:*" } }
|
|
38
|
+
: {})
|
|
39
|
+
});
|
|
40
|
+
await file(`packages/${name}/src/index.js`, dependency === undefined
|
|
41
|
+
? "export const stable = 1;\n"
|
|
42
|
+
: "export { stable } from '@fixture/base';\n");
|
|
43
|
+
await file(`packages/${name}/build.mjs`, [
|
|
44
|
+
"import { mkdir, copyFile } from 'node:fs/promises';",
|
|
45
|
+
"import { execFileSync } from 'node:child_process';",
|
|
46
|
+
"import assert from 'node:assert/strict';",
|
|
47
|
+
"assert.equal(execFileSync('pnpm', ['--version'], { encoding: 'utf8' }).trim(), '11.15.1');",
|
|
48
|
+
...(dependency === undefined
|
|
49
|
+
? []
|
|
50
|
+
: [
|
|
51
|
+
"import { stable } from '@fixture/base';",
|
|
52
|
+
"assert.equal(stable, 1);"
|
|
53
|
+
]),
|
|
54
|
+
"await mkdir('dist', { recursive: true });",
|
|
55
|
+
"await copyFile('src/index.js', 'dist/index.js');"
|
|
56
|
+
].join("\n"));
|
|
57
|
+
}
|
|
58
|
+
await manifest("apps/app/package.json", {
|
|
59
|
+
name: "@fixture/app",
|
|
60
|
+
type: "module",
|
|
61
|
+
dependencies: { "@fixture/library": "workspace:*" },
|
|
62
|
+
scripts: frameworkTarget
|
|
63
|
+
? {
|
|
64
|
+
build: "next build",
|
|
65
|
+
"types:check": "node typecheck.mjs",
|
|
66
|
+
test: "node --test src/*.test.js"
|
|
67
|
+
}
|
|
68
|
+
: { build: "node build.mjs", test: "node --test src/*.test.js" }
|
|
69
|
+
});
|
|
70
|
+
await file("apps/app/build.mjs", [
|
|
71
|
+
"import assert from 'node:assert/strict';",
|
|
72
|
+
"import { stable } from '@fixture/library';",
|
|
73
|
+
"assert.equal(stable, 1, 'the workspace dependency must have emitted its exported dist file');"
|
|
74
|
+
].join("\n"));
|
|
75
|
+
await manifest("packages/unrelated/package.json", {
|
|
76
|
+
name: "@fixture/unrelated",
|
|
77
|
+
type: "module",
|
|
78
|
+
scripts: { build: "node build.mjs" }
|
|
79
|
+
});
|
|
80
|
+
await file("packages/unrelated/build.mjs", "throw new Error('unrelated workspace must not build');\n");
|
|
81
|
+
await file(".gitignore", "node_modules/\ndist/\n.routekit/\n");
|
|
82
|
+
// All dependencies are local workspaces; this creates no network dependency.
|
|
83
|
+
await exec("corepack", ["pnpm@11.15.1", "install", "--lockfile-only", "--ignore-scripts", "--ignore-pnpmfile"], { cwd: root });
|
|
84
|
+
const git = (...args) => exec("git", ["-C", root, ...args]);
|
|
85
|
+
await git("init", "-q");
|
|
86
|
+
for (const value of [1, 2]) {
|
|
87
|
+
await file("apps/app/src/index.js", `import { stable } from '@fixture/library';\nexport const protocolValue = () => stable + ${value - 1};\n`);
|
|
88
|
+
await file("apps/app/src/index.test.js", [
|
|
89
|
+
"import assert from 'node:assert/strict';",
|
|
90
|
+
"import { test } from 'node:test';",
|
|
91
|
+
"import { protocolValue } from './index.js';",
|
|
92
|
+
`test('public protocol value', () => assert.equal(protocolValue(), ${value}));`
|
|
93
|
+
].join("\n"));
|
|
94
|
+
await git("add", ".");
|
|
95
|
+
await git("-c", "core.hooksPath=/dev/null", "-c", "commit.gpgsign=false", "-c", "user.name=Fixture", "-c", "user.email=fixture@example.test", "commit", "-qm", value === 1 ? "initial fixture" : "fix(app): protocol value regression");
|
|
96
|
+
}
|
|
97
|
+
return root;
|
|
98
|
+
}
|
|
99
|
+
test("manifest-only workspace dependencies build their exported artifacts before an app, excluding unrelated packages", async (t) => {
|
|
100
|
+
const root = await repository(t);
|
|
101
|
+
const map = await Effect.runPromise(buildRepositoryBehaviorMapV1({ repositoryRoot: root, requestedRef: "HEAD" }));
|
|
102
|
+
const seeds = await Effect.runPromise(extractHistoricalTaskSeedsV1(map));
|
|
103
|
+
const seed = seeds.find((candidate) => candidate.summary === "fix(app): protocol value regression");
|
|
104
|
+
assert.ok(seed?.referenceCommit);
|
|
105
|
+
assert.deepEqual(seed.environment.candidateValidationRecipes.map((recipe) => recipe.cwd), ["packages/base", "packages/library", "apps/app"]);
|
|
106
|
+
const frozenInstall = seed.environment.trustedPreparationRecipes.find((recipe) => recipe.id === "command-environment-pnpm-frozen-install");
|
|
107
|
+
assert.ok(frozenInstall);
|
|
108
|
+
assert.ok(!frozenInstall.args.includes("--filter"), "the frozen install must link every workspace importer before dependency repair is disabled");
|
|
109
|
+
assert.ok(seed.environment.protectedControlPaths.includes("packages/library/package.json"));
|
|
110
|
+
assert.ok(seed.environment.protectedControlPaths.includes("packages/base/package.json"));
|
|
111
|
+
assert.ok(!seed.environment.protectedControlPaths.includes("packages/unrelated/package.json"));
|
|
112
|
+
const results = await Effect.runPromise(replayRepositoryCommandsV1({
|
|
113
|
+
repositoryRoot: root,
|
|
114
|
+
commit: seed.referenceCommit,
|
|
115
|
+
recipes: seed.environment.gradeRecipes,
|
|
116
|
+
trustedPreparationRecipes: seed.environment.trustedPreparationRecipes,
|
|
117
|
+
candidateValidationRecipes: seed.environment.candidateValidationRecipes,
|
|
118
|
+
repetitions: 1
|
|
119
|
+
}));
|
|
120
|
+
assert.ok(results.length > 0);
|
|
121
|
+
for (const result of results) {
|
|
122
|
+
assert.equal(result.gradeExecuted, true, JSON.stringify(result));
|
|
123
|
+
assert.equal(result.exitCode, 0, JSON.stringify(result));
|
|
124
|
+
assert.equal(result.candidateValidationResults.length, 3);
|
|
125
|
+
assert.ok(result.candidateValidationResults.every((validation) => validation.exitCode === 0));
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
test("manifest workspace dependency cycles still fail before replay recipe execution", async (t) => {
|
|
129
|
+
const root = await repository(t, true);
|
|
130
|
+
const map = await Effect.runPromise(buildRepositoryBehaviorMapV1({ repositoryRoot: root, requestedRef: "HEAD" }));
|
|
131
|
+
await assert.rejects(Effect.runPromise(extractHistoricalTaskSeedsV1(map)), /workspace build graph contains a cycle/u);
|
|
132
|
+
});
|
|
133
|
+
test("framework source-test targets use hermetic type checks after building workspace dependencies", async (t) => {
|
|
134
|
+
const root = await repository(t, false, true);
|
|
135
|
+
const map = await Effect.runPromise(buildRepositoryBehaviorMapV1({ repositoryRoot: root, requestedRef: "HEAD" }));
|
|
136
|
+
const seeds = await Effect.runPromise(extractHistoricalTaskSeedsV1(map));
|
|
137
|
+
const seed = seeds.find((candidate) => candidate.summary === "fix(app): protocol value regression");
|
|
138
|
+
assert.ok(seed);
|
|
139
|
+
assert.deepEqual(seed.environment.candidateValidationRecipes.map((recipe) => [
|
|
140
|
+
recipe.id,
|
|
141
|
+
recipe.cwd,
|
|
142
|
+
recipe.args
|
|
143
|
+
]), [
|
|
144
|
+
[
|
|
145
|
+
"command-environment-build-fixture-base",
|
|
146
|
+
"packages/base",
|
|
147
|
+
["pnpm@11.15.1", "run", "build"]
|
|
148
|
+
],
|
|
149
|
+
[
|
|
150
|
+
"command-environment-build-fixture-library",
|
|
151
|
+
"packages/library",
|
|
152
|
+
["pnpm@11.15.1", "run", "build"]
|
|
153
|
+
],
|
|
154
|
+
[
|
|
155
|
+
"command-environment-types-check-fixture-app",
|
|
156
|
+
"apps/app",
|
|
157
|
+
["pnpm@11.15.1", "run", "types:check"]
|
|
158
|
+
]
|
|
159
|
+
]);
|
|
160
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
import { Effect, Layer, Schema } from "effect";
|
|
4
|
+
import { strictAuthoringSchema } from "../adapters/strict-authoring-schema.js";
|
|
5
|
+
import { EvalAuthoringTransport } from "../project-authoring.js";
|
|
6
|
+
import { RepositorySpecificationReviewV1 } from "../repository-specification-critique-protocol.js";
|
|
7
|
+
import { RepositoryFoundryLanguageModel, RepositoryFoundryLanguageModelLive } from "../services/language-model/service.js";
|
|
8
|
+
function assertStrictObjects(schema) {
|
|
9
|
+
if (typeof schema !== "object" || schema === null)
|
|
10
|
+
return;
|
|
11
|
+
const node = schema;
|
|
12
|
+
if (node.type === "object") {
|
|
13
|
+
assert.equal(node.additionalProperties, false);
|
|
14
|
+
assert.deepEqual([...node.required].sort(), Object.keys(node.properties).sort());
|
|
15
|
+
}
|
|
16
|
+
for (const value of Object.values(node)) {
|
|
17
|
+
if (Array.isArray(value))
|
|
18
|
+
value.forEach(assertStrictObjects);
|
|
19
|
+
else
|
|
20
|
+
assertStrictObjects(value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function generate(schema, response) {
|
|
24
|
+
const calls = [];
|
|
25
|
+
const transport = Layer.succeed(EvalAuthoringTransport, EvalAuthoringTransport.of({
|
|
26
|
+
complete: (input) => Effect.sync(() => {
|
|
27
|
+
calls.push(input);
|
|
28
|
+
assertStrictObjects(input.jsonSchema);
|
|
29
|
+
return JSON.stringify(response);
|
|
30
|
+
})
|
|
31
|
+
}));
|
|
32
|
+
const result = await Effect.runPromise(Effect.gen(function* () {
|
|
33
|
+
const model = yield* RepositoryFoundryLanguageModel;
|
|
34
|
+
return yield* model.generateAssignedStructured({
|
|
35
|
+
assignment: {
|
|
36
|
+
role: "specification-critic-a",
|
|
37
|
+
model: "codex/gpt-6-astra",
|
|
38
|
+
reasoningEffort: "high"
|
|
39
|
+
},
|
|
40
|
+
operationId: "strict-schema-regression",
|
|
41
|
+
instructions: "Review the task.",
|
|
42
|
+
input: {},
|
|
43
|
+
schemaName: "strict_schema_regression",
|
|
44
|
+
outputSchema: schema,
|
|
45
|
+
maximumOutputTokens: 256
|
|
46
|
+
});
|
|
47
|
+
}).pipe(Effect.provide(RepositoryFoundryLanguageModelLive.pipe(Layer.provide(transport)))));
|
|
48
|
+
return { result, calls };
|
|
49
|
+
}
|
|
50
|
+
test("model-facing critic properties become required nullable while legacy optional reviews remain valid", async () => {
|
|
51
|
+
const legacy = {
|
|
52
|
+
reviewerId: "critic",
|
|
53
|
+
reviewerKind: "model-critic",
|
|
54
|
+
independentlyProduced: true,
|
|
55
|
+
verdict: "sufficient",
|
|
56
|
+
detail: "The visible task states its requirements.",
|
|
57
|
+
findings: []
|
|
58
|
+
};
|
|
59
|
+
assert.deepEqual(Schema.decodeUnknownSync(RepositorySpecificationReviewV1)(legacy), legacy);
|
|
60
|
+
const { result, calls } = await generate(RepositorySpecificationReviewV1, {
|
|
61
|
+
...legacy,
|
|
62
|
+
criticalBehaviorCoverage: null,
|
|
63
|
+
dimensionFit: null
|
|
64
|
+
});
|
|
65
|
+
assert.deepEqual(result.value, legacy);
|
|
66
|
+
assert.equal(calls.length, 1);
|
|
67
|
+
const properties = calls[0]?.jsonSchema.properties;
|
|
68
|
+
for (const name of ["criticalBehaviorCoverage", "dimensionFit"])
|
|
69
|
+
assert.ok((properties[name]?.anyOf).some((branch) => branch.type === "null"));
|
|
70
|
+
assert.deepEqual(Schema.decodeUnknownSync(RepositorySpecificationReviewV1)(legacy), legacy);
|
|
71
|
+
});
|
|
72
|
+
test("strict response normalization preserves genuine nullable values and required field failures", async () => {
|
|
73
|
+
const output = Schema.Struct({
|
|
74
|
+
required: Schema.String,
|
|
75
|
+
requiredNullable: Schema.NullOr(Schema.String),
|
|
76
|
+
optionalNullable: Schema.optionalKey(Schema.NullOr(Schema.String)),
|
|
77
|
+
optional: Schema.optionalKey(Schema.String)
|
|
78
|
+
});
|
|
79
|
+
const response = {
|
|
80
|
+
required: "yes",
|
|
81
|
+
requiredNullable: null,
|
|
82
|
+
optionalNullable: null,
|
|
83
|
+
optional: null
|
|
84
|
+
};
|
|
85
|
+
const { result } = await generate(output, response);
|
|
86
|
+
assert.deepEqual(result.value, {
|
|
87
|
+
required: "yes",
|
|
88
|
+
requiredNullable: null,
|
|
89
|
+
optionalNullable: null
|
|
90
|
+
});
|
|
91
|
+
assert.equal(response.optional, null, "response evidence is not mutated");
|
|
92
|
+
await assert.rejects(generate(output, { ...response, required: null }), /violated strict_schema_regression/u);
|
|
93
|
+
});
|
|
94
|
+
test("strict conversion and normalization follow nested references, arrays, and discriminated anyOf branches", async () => {
|
|
95
|
+
const detail = Schema.Struct({ note: Schema.optionalKey(Schema.String) }).annotate({
|
|
96
|
+
identifier: "SharedDetail"
|
|
97
|
+
});
|
|
98
|
+
const output = Schema.Struct({
|
|
99
|
+
entries: Schema.Array(Schema.Union([
|
|
100
|
+
Schema.Struct({
|
|
101
|
+
kind: Schema.Literal("omitted"),
|
|
102
|
+
detail,
|
|
103
|
+
value: Schema.optionalKey(Schema.String)
|
|
104
|
+
}),
|
|
105
|
+
Schema.Struct({
|
|
106
|
+
kind: Schema.Literal("nullable"),
|
|
107
|
+
detail,
|
|
108
|
+
value: Schema.NullOr(Schema.String)
|
|
109
|
+
})
|
|
110
|
+
]))
|
|
111
|
+
});
|
|
112
|
+
const { result, calls } = await generate(output, {
|
|
113
|
+
entries: [
|
|
114
|
+
{ kind: "omitted", detail: { note: null }, value: null },
|
|
115
|
+
{ kind: "nullable", detail: { note: null }, value: null }
|
|
116
|
+
]
|
|
117
|
+
});
|
|
118
|
+
assert.deepEqual(result.value, {
|
|
119
|
+
entries: [
|
|
120
|
+
{ kind: "omitted", detail: {} },
|
|
121
|
+
{ kind: "nullable", detail: {}, value: null }
|
|
122
|
+
]
|
|
123
|
+
});
|
|
124
|
+
assert.ok(calls[0]?.jsonSchema.$defs);
|
|
125
|
+
});
|
|
126
|
+
test("recursive references preserve required structure while restoring optional descendants", () => {
|
|
127
|
+
const original = {
|
|
128
|
+
type: "object",
|
|
129
|
+
properties: { tree: { $ref: "#/$defs/Tree" } },
|
|
130
|
+
required: ["tree"],
|
|
131
|
+
additionalProperties: false,
|
|
132
|
+
$defs: {
|
|
133
|
+
Tree: {
|
|
134
|
+
type: "object",
|
|
135
|
+
properties: { name: { type: "string" }, child: { $ref: "#/$defs/Tree" } },
|
|
136
|
+
required: ["name"],
|
|
137
|
+
additionalProperties: false
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
const before = JSON.stringify(original);
|
|
142
|
+
const adapted = strictAuthoringSchema(original);
|
|
143
|
+
assertStrictObjects(adapted.jsonSchema);
|
|
144
|
+
assert.deepEqual(adapted.normalizeResponse({ tree: { name: "a", child: { name: "b", child: null } } }), { tree: { name: "a", child: { name: "b" } } });
|
|
145
|
+
assert.equal(JSON.stringify(original), before, "domain schema is not mutated");
|
|
146
|
+
});
|
|
147
|
+
test("unsupported open objects fail before model transport", async () => {
|
|
148
|
+
let calls = 0;
|
|
149
|
+
const transport = Layer.succeed(EvalAuthoringTransport, EvalAuthoringTransport.of({
|
|
150
|
+
complete: () => Effect.sync(() => {
|
|
151
|
+
calls++;
|
|
152
|
+
return "{}";
|
|
153
|
+
})
|
|
154
|
+
}));
|
|
155
|
+
const result = Effect.gen(function* () {
|
|
156
|
+
const model = yield* RepositoryFoundryLanguageModel;
|
|
157
|
+
return yield* model.generateAssignedStructured({
|
|
158
|
+
assignment: { role: "critic", model: "codex/gpt-6-astra", reasoningEffort: "high" },
|
|
159
|
+
operationId: "open-schema",
|
|
160
|
+
instructions: "Return data.",
|
|
161
|
+
input: {},
|
|
162
|
+
schemaName: "open_schema",
|
|
163
|
+
outputSchema: Schema.Record(Schema.String, Schema.String),
|
|
164
|
+
maximumOutputTokens: 256
|
|
165
|
+
});
|
|
166
|
+
}).pipe(Effect.provide(RepositoryFoundryLanguageModelLive.pipe(Layer.provide(transport))));
|
|
167
|
+
await assert.rejects(Effect.runPromise(result), /not strict-provider compatible/u);
|
|
168
|
+
assert.equal(calls, 0);
|
|
169
|
+
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@velum-labs/routekit-eval-setup",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.5.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/velum-labs/routekit.git",
|
|
@@ -18,6 +18,42 @@
|
|
|
18
18
|
"./effect": {
|
|
19
19
|
"types": "./dist/effect-api.d.ts",
|
|
20
20
|
"default": "./dist/effect-api.js"
|
|
21
|
+
},
|
|
22
|
+
"./agentic-capabilities-protocol": {
|
|
23
|
+
"types": "./dist/agentic-capabilities-protocol.d.ts",
|
|
24
|
+
"default": "./dist/agentic-capabilities-protocol.js"
|
|
25
|
+
},
|
|
26
|
+
"./eval-capability-policy": {
|
|
27
|
+
"types": "./dist/eval-capability-policy.d.ts",
|
|
28
|
+
"default": "./dist/eval-capability-policy.js"
|
|
29
|
+
},
|
|
30
|
+
"./eval-capability-execution-envelope": {
|
|
31
|
+
"types": "./dist/eval-capability-execution-envelope.d.ts",
|
|
32
|
+
"default": "./dist/eval-capability-execution-envelope.js"
|
|
33
|
+
},
|
|
34
|
+
"./services/eval-candidate/service": {
|
|
35
|
+
"types": "./dist/services/eval-candidate/service.d.ts",
|
|
36
|
+
"default": "./dist/services/eval-candidate/service.js"
|
|
37
|
+
},
|
|
38
|
+
"./services/eval-environment/service": {
|
|
39
|
+
"types": "./dist/services/eval-environment/service.d.ts",
|
|
40
|
+
"default": "./dist/services/eval-environment/service.js"
|
|
41
|
+
},
|
|
42
|
+
"./services/eval-capabilities/service": {
|
|
43
|
+
"types": "./dist/services/eval-capabilities/service.d.ts",
|
|
44
|
+
"default": "./dist/services/eval-capabilities/service.js"
|
|
45
|
+
},
|
|
46
|
+
"./case-checkpoint-store": {
|
|
47
|
+
"types": "./dist/case-checkpoint-store.d.ts",
|
|
48
|
+
"default": "./dist/case-checkpoint-store.js"
|
|
49
|
+
},
|
|
50
|
+
"./services/command-observability/service": {
|
|
51
|
+
"types": "./dist/services/command-observability/service.d.ts",
|
|
52
|
+
"default": "./dist/services/command-observability/service.js"
|
|
53
|
+
},
|
|
54
|
+
"./adapters/repository-command-runner": {
|
|
55
|
+
"types": "./dist/adapters/repository-command-runner.d.ts",
|
|
56
|
+
"default": "./dist/adapters/repository-command-runner.js"
|
|
21
57
|
}
|
|
22
58
|
},
|
|
23
59
|
"files": [
|
|
@@ -31,9 +67,13 @@
|
|
|
31
67
|
},
|
|
32
68
|
"dependencies": {
|
|
33
69
|
"effect": "4.0.0-rc.108",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
70
|
+
"typescript": "6.0.3",
|
|
71
|
+
"yaml": "2.9.0",
|
|
72
|
+
"zod": "4.4.3",
|
|
73
|
+
"@velum-labs/routekit-eval-contracts": "1.5.0",
|
|
74
|
+
"@velum-labs/routekit-eval-core": "1.5.0",
|
|
75
|
+
"@velum-labs/routekit-registry": "1.5.0",
|
|
76
|
+
"@velum-labs/routekit-runtime": "1.5.0"
|
|
37
77
|
},
|
|
38
78
|
"keywords": [
|
|
39
79
|
"routekit",
|
|
@@ -42,11 +82,13 @@
|
|
|
42
82
|
"routing"
|
|
43
83
|
],
|
|
44
84
|
"devDependencies": {
|
|
45
|
-
"@effect/platform-node": "4.0.0-rc.108"
|
|
85
|
+
"@effect/platform-node": "4.0.0-rc.108",
|
|
86
|
+
"vite": "7.3.6",
|
|
87
|
+
"vitest": "3.2.7"
|
|
46
88
|
},
|
|
47
89
|
"scripts": {
|
|
48
90
|
"build": "tsc -b",
|
|
49
91
|
"clean": "tsc -b --clean",
|
|
50
|
-
"test": "node --test \"dist/test/*.test.js\""
|
|
92
|
+
"test": "node --test --test-concurrency=1 \"dist/test/*.test.js\""
|
|
51
93
|
}
|
|
52
94
|
}
|