@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,544 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { execFile } from "node:child_process";
|
|
3
|
+
import { mkdtemp, mkdir, rm, writeFile } from "node:fs/promises";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import { promisify } from "node:util";
|
|
7
|
+
import { test } from "node:test";
|
|
8
|
+
import { Deferred, Effect, Layer } from "effect";
|
|
9
|
+
import { EvalProjectAuthoringError } from "../errors.js";
|
|
10
|
+
import { assertRepositoryFoundryModelPlanV1, gpt56RepositoryFoundryModelPlanV1, REPOSITORY_FOUNDRY_MODEL_ROLES, repositoryFoundryModelAssignmentV1, repositoryFoundryModelPlanV1 } from "../repository-language-model-protocol.js";
|
|
11
|
+
import { EvalAuthoringTransport } from "../project-authoring.js";
|
|
12
|
+
import { authorRepositoryCaseSpecificationV1, repositoryGenerationContextCandidatesV1 } from "../services/case-authoring/service.js";
|
|
13
|
+
import { RepositoryFoundryLanguageModelLive } from "../services/language-model/service.js";
|
|
14
|
+
const assertStrictObjectSchemas = (value) => {
|
|
15
|
+
if (value === null || typeof value !== "object")
|
|
16
|
+
return;
|
|
17
|
+
if (Array.isArray(value)) {
|
|
18
|
+
for (const entry of value)
|
|
19
|
+
assertStrictObjectSchemas(entry);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const node = value;
|
|
23
|
+
if (node.type === "object" || node.properties !== undefined) {
|
|
24
|
+
assert.equal(node.additionalProperties, false);
|
|
25
|
+
assert.deepEqual([...(node.required ?? [])].sort(), Object.keys(node.properties ?? {}).sort());
|
|
26
|
+
}
|
|
27
|
+
for (const child of Object.values(node))
|
|
28
|
+
assertStrictObjectSchemas(child);
|
|
29
|
+
};
|
|
30
|
+
const execFilePromise = promisify(execFile);
|
|
31
|
+
const git = async (root, args) => (await execFilePromise("git", ["-C", root, ...args], {
|
|
32
|
+
encoding: "utf8"
|
|
33
|
+
})).stdout.trim();
|
|
34
|
+
const fixture = async () => {
|
|
35
|
+
const root = await mkdtemp(path.join(tmpdir(), "routekit-foundry-model-"));
|
|
36
|
+
await git(root, ["init", "-q"]);
|
|
37
|
+
await git(root, ["config", "user.email", "eval@example.test"]);
|
|
38
|
+
await git(root, ["config", "user.name", "Eval Fixture"]);
|
|
39
|
+
await mkdir(path.join(root, "src"), { recursive: true });
|
|
40
|
+
await writeFile(path.join(root, "package.json"), `${JSON.stringify({
|
|
41
|
+
name: "stream-fixture",
|
|
42
|
+
private: true,
|
|
43
|
+
type: "module",
|
|
44
|
+
exports: "./src/index.ts"
|
|
45
|
+
}, null, 2)}\n`);
|
|
46
|
+
await writeFile(path.join(root, "src", "stream.ts"), [
|
|
47
|
+
"export type Event = { type: string };",
|
|
48
|
+
"export const normalize = (events: Event[]) => events;"
|
|
49
|
+
].join("\n"));
|
|
50
|
+
await writeFile(path.join(root, "src", "stream.test.ts"), "test('keeps completion last', () => {});\n");
|
|
51
|
+
await writeFile(path.join(root, "src", "index.ts"), 'export { normalize, type Event } from "./stream.js";\n');
|
|
52
|
+
await git(root, ["add", "."]);
|
|
53
|
+
await git(root, ["commit", "-qm", "initial stream adapter"]);
|
|
54
|
+
const initialCommit = await git(root, ["rev-parse", "HEAD"]);
|
|
55
|
+
return { root, initialCommit };
|
|
56
|
+
};
|
|
57
|
+
const seed = (initialCommit) => ({
|
|
58
|
+
version: 1,
|
|
59
|
+
id: "seed-stream-terminal-order",
|
|
60
|
+
status: "qualified",
|
|
61
|
+
source: {
|
|
62
|
+
kind: "historical-fix",
|
|
63
|
+
changeEpisodeId: "change-stream-terminal-order"
|
|
64
|
+
},
|
|
65
|
+
summary: "Preserve provider events while ensuring the completion event is emitted last",
|
|
66
|
+
capabilityEvidence: [
|
|
67
|
+
{ kind: "symbol", id: "stream", path: "src/stream.ts" },
|
|
68
|
+
{ kind: "test", id: "stream-test", path: "src/stream.test.ts" }
|
|
69
|
+
],
|
|
70
|
+
initialState: { commit: initialCommit },
|
|
71
|
+
targetBehavior: [
|
|
72
|
+
{
|
|
73
|
+
id: "terminal-last",
|
|
74
|
+
description: "Preserve every provider event while ensuring exactly one completion event is emitted last.",
|
|
75
|
+
critical: true,
|
|
76
|
+
evidence: [{ kind: "test", id: "stream-test", path: "src/stream.test.ts" }]
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
referenceCommit: "b".repeat(40),
|
|
80
|
+
baselineObservations: [
|
|
81
|
+
{
|
|
82
|
+
id: "baseline",
|
|
83
|
+
kind: "test-command",
|
|
84
|
+
subjectId: "stream-test",
|
|
85
|
+
outcome: "pass",
|
|
86
|
+
detail: "control passed"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
preChangeObservations: [
|
|
90
|
+
{
|
|
91
|
+
id: "pre",
|
|
92
|
+
kind: "test-command",
|
|
93
|
+
subjectId: "stream-test",
|
|
94
|
+
outcome: "fail",
|
|
95
|
+
detail: "completion was not last"
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
postChangeObservations: [
|
|
99
|
+
{
|
|
100
|
+
id: "post",
|
|
101
|
+
kind: "test-command",
|
|
102
|
+
subjectId: "stream-test",
|
|
103
|
+
outcome: "pass",
|
|
104
|
+
detail: "completion was last"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
candidateTestIds: ["stream-test"],
|
|
108
|
+
environment: {
|
|
109
|
+
protectedControlPaths: ["src/stream.test.ts"],
|
|
110
|
+
trustedPreparationRecipes: [],
|
|
111
|
+
candidateValidationRecipes: [],
|
|
112
|
+
baselineGradeRecipes: [],
|
|
113
|
+
gradeRecipes: []
|
|
114
|
+
},
|
|
115
|
+
confidence: "high",
|
|
116
|
+
risks: [],
|
|
117
|
+
rejectionReasons: []
|
|
118
|
+
});
|
|
119
|
+
const behaviorMap = (root, commit) => ({
|
|
120
|
+
version: 1,
|
|
121
|
+
repository: {
|
|
122
|
+
root,
|
|
123
|
+
requestedRef: commit,
|
|
124
|
+
commit,
|
|
125
|
+
tree: "fixture-tree"
|
|
126
|
+
},
|
|
127
|
+
packages: [
|
|
128
|
+
{
|
|
129
|
+
id: "package-stream-fixture",
|
|
130
|
+
name: "stream-fixture",
|
|
131
|
+
path: ".",
|
|
132
|
+
manifestPath: "package.json",
|
|
133
|
+
dependencyPackageIds: [],
|
|
134
|
+
publicExports: ["."]
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
publicSurfaces: [
|
|
138
|
+
{
|
|
139
|
+
id: "surface-stream-fixture",
|
|
140
|
+
packageId: "package-stream-fixture",
|
|
141
|
+
path: "src/index.ts",
|
|
142
|
+
kind: "package-export",
|
|
143
|
+
symbols: ["normalize", "Event"]
|
|
144
|
+
}
|
|
145
|
+
],
|
|
146
|
+
protocols: [],
|
|
147
|
+
commands: [],
|
|
148
|
+
tests: [],
|
|
149
|
+
testBindings: [],
|
|
150
|
+
historyEpisodes: [],
|
|
151
|
+
workloadSignals: [],
|
|
152
|
+
blindSpots: []
|
|
153
|
+
});
|
|
154
|
+
const family = {
|
|
155
|
+
version: 1,
|
|
156
|
+
id: "family-stream-normalization",
|
|
157
|
+
capabilityId: "provider-stream-translation",
|
|
158
|
+
jobStatement: "Repair provider stream normalization while preserving the public event contract.",
|
|
159
|
+
lane: "repository-agent",
|
|
160
|
+
seedIds: ["seed-stream-terminal-order"],
|
|
161
|
+
inputStateFacets: ["provider event sequence"],
|
|
162
|
+
requestedChangeFacets: ["terminal ordering"],
|
|
163
|
+
observableFacets: ["event preservation", "completion ordering"],
|
|
164
|
+
admissibleSolutionPolicy: "behavior-equivalent",
|
|
165
|
+
fixtureAxes: ["missing completion", "duplicate completion", "trailing output"],
|
|
166
|
+
adversaryFamilies: ["event drop", "duplicate terminal"],
|
|
167
|
+
excludedNearMisses: ["format-only changes"],
|
|
168
|
+
repositoryCoverage: [{ kind: "symbol", id: "stream", path: "src/stream.ts" }],
|
|
169
|
+
confidence: "high"
|
|
170
|
+
};
|
|
171
|
+
const completionFor = (input) => {
|
|
172
|
+
switch (input.foundryRole) {
|
|
173
|
+
case "repository-analyst":
|
|
174
|
+
return {
|
|
175
|
+
summary: "The adapter must retain the provider event sequence and normalize completion ordering.",
|
|
176
|
+
userObservableBehaviors: [
|
|
177
|
+
"all provider events remain visible",
|
|
178
|
+
"one completion event is last"
|
|
179
|
+
],
|
|
180
|
+
constraints: ["preserve the exported event contract"],
|
|
181
|
+
risks: ["streams without a completion event must remain valid"],
|
|
182
|
+
relevantPaths: ["src/stream.ts", "src/stream.test.ts", "src/index.ts"]
|
|
183
|
+
};
|
|
184
|
+
case "specification-writer":
|
|
185
|
+
return {
|
|
186
|
+
requestText: "Repair the provider stream adapter so every provider event remains observable while exactly one completion event is emitted at the end of a completed stream. Streams that never contain a completion event must otherwise remain unchanged, and the exported event contract must remain compatible.",
|
|
187
|
+
constraints: [
|
|
188
|
+
"Preserve streams without a completion event.",
|
|
189
|
+
"Do not change the exported event shape."
|
|
190
|
+
]
|
|
191
|
+
};
|
|
192
|
+
case "specification-critic-a":
|
|
193
|
+
case "specification-critic-b":
|
|
194
|
+
return {
|
|
195
|
+
verdict: "sufficient",
|
|
196
|
+
detail: "The request states the observable terminal-ordering and preservation behavior without prescribing an implementation.",
|
|
197
|
+
criticalBehaviorCoverage: JSON.parse(input.input).targetBehavior.filter((clause) => clause.critical).map((clause) => ({
|
|
198
|
+
behaviorId: clause.id, outcome: "covered", detail: "The request states the required behavior through a faithful paraphrase."
|
|
199
|
+
})),
|
|
200
|
+
...(JSON.parse(input.input).requestedDimension === undefined ? {} : {
|
|
201
|
+
dimensionFit: {
|
|
202
|
+
requestedDimension: JSON.parse(input.input).requestedDimension,
|
|
203
|
+
outcome: "fit", detail: "The requested behavior exercises this area in the repository.",
|
|
204
|
+
evidencePaths: ["src/stream.ts"]
|
|
205
|
+
}
|
|
206
|
+
}),
|
|
207
|
+
findings: []
|
|
208
|
+
};
|
|
209
|
+
default:
|
|
210
|
+
throw new Error(`unexpected model role in specification test: ${input.foundryRole}`);
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
test("foundry plans pin GPT-6 Astra and independently configured critics without model fallback", () => {
|
|
214
|
+
const plan = repositoryFoundryModelPlanV1({
|
|
215
|
+
primaryModel: "openai/gpt-6-astra",
|
|
216
|
+
criticAModel: "codex/gpt-6-astra",
|
|
217
|
+
criticBModel: "bedrock/anthropic.claude-opus-4-6-v1:0",
|
|
218
|
+
reviewerModel: "openrouter/google/gemini-3.1-pro-preview",
|
|
219
|
+
primaryReasoningEffort: "max",
|
|
220
|
+
reviewReasoningEffort: "high"
|
|
221
|
+
});
|
|
222
|
+
assert.doesNotThrow(() => assertRepositoryFoundryModelPlanV1(plan));
|
|
223
|
+
assert.deepEqual(plan.assignments.map((assignment) => assignment.role), REPOSITORY_FOUNDRY_MODEL_ROLES);
|
|
224
|
+
for (const role of [
|
|
225
|
+
"repository-analyst",
|
|
226
|
+
"oracle-designer",
|
|
227
|
+
"valid-solution-generator-a",
|
|
228
|
+
"adversary"
|
|
229
|
+
]) {
|
|
230
|
+
assert.deepEqual(repositoryFoundryModelAssignmentV1(plan, role), {
|
|
231
|
+
role,
|
|
232
|
+
model: "openai/gpt-6-astra",
|
|
233
|
+
reasoningEffort: "max"
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
assert.equal(repositoryFoundryModelAssignmentV1(plan, "solution-critic-a").model, "codex/gpt-6-astra");
|
|
237
|
+
assert.equal(repositoryFoundryModelAssignmentV1(plan, "held-out-solution-critic-b").model, "bedrock/anthropic.claude-opus-4-6-v1:0");
|
|
238
|
+
assert.equal(repositoryFoundryModelAssignmentV1(plan, "quality-reviewer").model, "openrouter/google/gemini-3.1-pro-preview");
|
|
239
|
+
});
|
|
240
|
+
test("foundry plans explicitly assign the selected primary model to every unspecified critic role", () => {
|
|
241
|
+
const plan = repositoryFoundryModelPlanV1({ primaryModel: "openai/gpt-6-astra" });
|
|
242
|
+
assert.equal(plan.assignments.length, REPOSITORY_FOUNDRY_MODEL_ROLES.length);
|
|
243
|
+
assert.ok(plan.assignments.every((assignment) => assignment.model === "openai/gpt-6-astra" && assignment.reasoningEffort === "high"));
|
|
244
|
+
});
|
|
245
|
+
test("foundry plans reject implicit models and routing aliases for every authoring role", () => {
|
|
246
|
+
for (const model of [
|
|
247
|
+
"",
|
|
248
|
+
"gpt-6-astra",
|
|
249
|
+
"auto",
|
|
250
|
+
"openai/auto",
|
|
251
|
+
"openai/default",
|
|
252
|
+
"openai/router",
|
|
253
|
+
"router/gpt-6-astra",
|
|
254
|
+
"openai/ AUTO",
|
|
255
|
+
" openai/gpt-6-astra",
|
|
256
|
+
"openai/gpt-6-astra "
|
|
257
|
+
]) {
|
|
258
|
+
for (const role of REPOSITORY_FOUNDRY_MODEL_ROLES) {
|
|
259
|
+
const plan = repositoryFoundryModelPlanV1({ primaryModel: "openai/gpt-6-astra" });
|
|
260
|
+
assert.throws(() => assertRepositoryFoundryModelPlanV1({
|
|
261
|
+
...plan,
|
|
262
|
+
assignments: plan.assignments.map((assignment) => assignment.role === role ? { ...assignment, model } : assignment)
|
|
263
|
+
}), /(?:explicit|concrete) provider\/model/u, `${role}: ${JSON.stringify(model)}`);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
test("foundry plans require one explicit assignment per role and high primary reasoning", () => {
|
|
268
|
+
const plan = repositoryFoundryModelPlanV1({ primaryModel: "openai/gpt-6-astra" });
|
|
269
|
+
assert.throws(() => assertRepositoryFoundryModelPlanV1({ ...plan, assignments: plan.assignments.slice(1) }), /exactly one assignment/u);
|
|
270
|
+
assert.throws(() => assertRepositoryFoundryModelPlanV1({
|
|
271
|
+
...plan,
|
|
272
|
+
assignments: [...plan.assignments.slice(1), plan.assignments[1]]
|
|
273
|
+
}), /exactly one assignment/u);
|
|
274
|
+
assert.throws(() => repositoryFoundryModelPlanV1({
|
|
275
|
+
primaryModel: "openai/gpt-6-astra",
|
|
276
|
+
primaryReasoningEffort: "low"
|
|
277
|
+
}), /high or stronger reasoning/u);
|
|
278
|
+
});
|
|
279
|
+
test("existing GPT-5.6 model plan builder remains compatible", () => {
|
|
280
|
+
const input = {
|
|
281
|
+
primaryModel: "openai/gpt-5.6-sol",
|
|
282
|
+
criticAModel: "openai/gpt-5.6-luna",
|
|
283
|
+
criticBModel: "openai/gpt-5.6-terra",
|
|
284
|
+
reviewerModel: "openai/gpt-5.6-terra"
|
|
285
|
+
};
|
|
286
|
+
assert.deepEqual(gpt56RepositoryFoundryModelPlanV1(input), repositoryFoundryModelPlanV1(input));
|
|
287
|
+
});
|
|
288
|
+
test("model-authored specifications run both isolated critics before either completes", async () => {
|
|
289
|
+
const { root, initialCommit } = await fixture();
|
|
290
|
+
const calls = [];
|
|
291
|
+
const criticsStarted = new Set();
|
|
292
|
+
const bothCriticsStarted = Deferred.makeUnsafe();
|
|
293
|
+
try {
|
|
294
|
+
const transport = Layer.succeed(EvalAuthoringTransport, EvalAuthoringTransport.of({
|
|
295
|
+
completeDetailed: (input) => Effect.gen(function* () {
|
|
296
|
+
assertStrictObjectSchemas(input.jsonSchema);
|
|
297
|
+
calls.push(input);
|
|
298
|
+
if (input.foundryRole?.startsWith("specification-critic-")) {
|
|
299
|
+
criticsStarted.add(input.foundryRole);
|
|
300
|
+
if (criticsStarted.size === 2)
|
|
301
|
+
yield* Deferred.succeed(bothCriticsStarted, undefined);
|
|
302
|
+
yield* Deferred.await(bothCriticsStarted).pipe(Effect.timeout("2 seconds"), Effect.orDie);
|
|
303
|
+
assert.equal(criticsStarted.size, 2, "neither critic may finish before its sibling starts");
|
|
304
|
+
}
|
|
305
|
+
return {
|
|
306
|
+
text: JSON.stringify(completionFor(input)),
|
|
307
|
+
callId: `call-${input.foundryRole}`
|
|
308
|
+
};
|
|
309
|
+
}),
|
|
310
|
+
complete: (input) => Effect.succeed(JSON.stringify(completionFor(input)))
|
|
311
|
+
}));
|
|
312
|
+
const languageModel = RepositoryFoundryLanguageModelLive.pipe(Layer.provide(transport));
|
|
313
|
+
const result = await Effect.runPromise(authorRepositoryCaseSpecificationV1({
|
|
314
|
+
repositoryRoot: root,
|
|
315
|
+
operationId: "foundry-case-stream",
|
|
316
|
+
requestedDimension: "Provider stream translation",
|
|
317
|
+
caseId: "case-stream-terminal-order",
|
|
318
|
+
map: behaviorMap(root, initialCommit),
|
|
319
|
+
seed: seed(initialCommit),
|
|
320
|
+
family,
|
|
321
|
+
modelPlan: gpt56RepositoryFoundryModelPlanV1({
|
|
322
|
+
primaryModel: "openai/gpt-5.6-sol",
|
|
323
|
+
criticAModel: "openai/gpt-5.6-luna",
|
|
324
|
+
criticBModel: "openai/gpt-5.6-terra"
|
|
325
|
+
})
|
|
326
|
+
}).pipe(Effect.provide(languageModel)));
|
|
327
|
+
assert.equal(result.visible.lane, "repository-agent");
|
|
328
|
+
assert.match(result.visible.requestText, /exactly one completion event/u);
|
|
329
|
+
assert.equal(result.reviews.length, 2);
|
|
330
|
+
assert.ok(calls.every((call) => JSON.parse(call.input).requestedDimension === "Provider stream translation"));
|
|
331
|
+
assert.ok(result.reviews.every((review) => review.dimensionFit?.outcome === "fit"));
|
|
332
|
+
assert.equal(result.modelCalls.length, 4);
|
|
333
|
+
assert.deepEqual(calls.map((call) => call.foundryRole), [
|
|
334
|
+
"repository-analyst",
|
|
335
|
+
"specification-writer",
|
|
336
|
+
"specification-critic-a",
|
|
337
|
+
"specification-critic-b"
|
|
338
|
+
]);
|
|
339
|
+
assert.deepEqual(calls.map((call) => call.model), ["openai/gpt-5.6-sol", "openai/gpt-5.6-sol", "openai/gpt-5.6-luna", "openai/gpt-5.6-terra"]);
|
|
340
|
+
assert.ok(calls.every((call) => call.reasoningEffort === "high"));
|
|
341
|
+
const writerInput = JSON.parse(calls[1]?.input ?? "{}");
|
|
342
|
+
assert.equal(writerInput.initialCommit, initialCommit);
|
|
343
|
+
assert.deepEqual(writerInput.selectedRepositoryContext?.map((source) => source.path), ["src/stream.ts", "src/stream.test.ts", "src/index.ts"]);
|
|
344
|
+
assert.equal(calls[1]?.input.includes("b".repeat(40)), false, "the specification writer must not receive the historical reference commit");
|
|
345
|
+
assert.equal(calls[2]?.input.includes("call-specification-critic"), false, "critics must not receive each other's outputs");
|
|
346
|
+
}
|
|
347
|
+
finally {
|
|
348
|
+
await rm(root, { recursive: true, force: true });
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
test("a failed specification critic interrupts its in-flight sibling and fails authoring", async () => {
|
|
352
|
+
const { root, initialCommit } = await fixture();
|
|
353
|
+
const siblingStarted = Deferred.makeUnsafe();
|
|
354
|
+
const calls = [];
|
|
355
|
+
let siblingInterrupted = false;
|
|
356
|
+
const transport = Layer.succeed(EvalAuthoringTransport, EvalAuthoringTransport.of({
|
|
357
|
+
complete: (input) => Effect.gen(function* () {
|
|
358
|
+
calls.push(input.foundryRole ?? "unknown");
|
|
359
|
+
if (input.foundryRole === "specification-critic-a") {
|
|
360
|
+
yield* Deferred.await(siblingStarted);
|
|
361
|
+
return yield* Effect.fail(new EvalProjectAuthoringError({
|
|
362
|
+
operation: "authoring-evaluations", detail: "critic request failed"
|
|
363
|
+
}));
|
|
364
|
+
}
|
|
365
|
+
if (input.foundryRole === "specification-critic-b") {
|
|
366
|
+
yield* Deferred.succeed(siblingStarted, undefined);
|
|
367
|
+
return yield* Effect.never.pipe(Effect.onInterrupt(() => Effect.sync(() => {
|
|
368
|
+
siblingInterrupted = true;
|
|
369
|
+
})));
|
|
370
|
+
}
|
|
371
|
+
return JSON.stringify(completionFor(input));
|
|
372
|
+
})
|
|
373
|
+
}));
|
|
374
|
+
try {
|
|
375
|
+
await assert.rejects(Effect.runPromise(authorRepositoryCaseSpecificationV1({
|
|
376
|
+
repositoryRoot: root,
|
|
377
|
+
operationId: "foundry-critic-cancellation",
|
|
378
|
+
caseId: "case-stream-terminal-order",
|
|
379
|
+
map: behaviorMap(root, initialCommit),
|
|
380
|
+
seed: seed(initialCommit),
|
|
381
|
+
family,
|
|
382
|
+
modelPlan: repositoryFoundryModelPlanV1({ primaryModel: "openai/gpt-6-astra" })
|
|
383
|
+
}).pipe(Effect.provide(RepositoryFoundryLanguageModelLive.pipe(Layer.provide(transport))), Effect.timeout("5 seconds"))), /critic request failed/u);
|
|
384
|
+
assert.equal(siblingInterrupted, true);
|
|
385
|
+
assert.deepEqual(calls, [
|
|
386
|
+
"repository-analyst", "specification-writer", "specification-critic-a", "specification-critic-b"
|
|
387
|
+
]);
|
|
388
|
+
}
|
|
389
|
+
finally {
|
|
390
|
+
await rm(root, { recursive: true, force: true });
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
test("specification criticism rejects dimension mismatch and missing critical coverage before returning a draft", async () => {
|
|
394
|
+
const { root, initialCommit } = await fixture();
|
|
395
|
+
try {
|
|
396
|
+
for (const issue of ["dimension-mismatch", "missing-dimension", "omitted-critical", "missing-critical-review"]) {
|
|
397
|
+
const response = (input) => {
|
|
398
|
+
const value = completionFor(input);
|
|
399
|
+
if (input.foundryRole !== "specification-critic-b")
|
|
400
|
+
return value;
|
|
401
|
+
if (issue === "dimension-mismatch") {
|
|
402
|
+
return { ...value, dimensionFit: { ...value.dimensionFit, outcome: "mismatch" } };
|
|
403
|
+
}
|
|
404
|
+
if (issue === "missing-dimension") {
|
|
405
|
+
const { dimensionFit: _dimensionFit, ...rest } = value;
|
|
406
|
+
return rest;
|
|
407
|
+
}
|
|
408
|
+
return { ...value, criticalBehaviorCoverage: issue === "missing-critical-review" ? [] : [{
|
|
409
|
+
behaviorId: "terminal-last", outcome: "omitted", detail: "The required preservation condition is absent."
|
|
410
|
+
}] };
|
|
411
|
+
};
|
|
412
|
+
const transport = Layer.succeed(EvalAuthoringTransport, EvalAuthoringTransport.of({
|
|
413
|
+
complete: (input) => Effect.succeed(JSON.stringify(response(input))),
|
|
414
|
+
completeDetailed: (input) => Effect.succeed({ text: JSON.stringify(response(input)) })
|
|
415
|
+
}));
|
|
416
|
+
await assert.rejects(Effect.runPromise(authorRepositoryCaseSpecificationV1({
|
|
417
|
+
repositoryRoot: root,
|
|
418
|
+
operationId: `reject-${issue}`,
|
|
419
|
+
caseId: "case-stream-terminal-order",
|
|
420
|
+
requestedDimension: "Provider stream translation",
|
|
421
|
+
map: behaviorMap(root, initialCommit),
|
|
422
|
+
seed: seed(initialCommit),
|
|
423
|
+
family,
|
|
424
|
+
modelPlan: repositoryFoundryModelPlanV1({ primaryModel: "openai/gpt-6-astra" })
|
|
425
|
+
}).pipe(Effect.provide(RepositoryFoundryLanguageModelLive.pipe(Layer.provide(transport))))), /generated specification failed independent review/u, issue);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
finally {
|
|
429
|
+
await rm(root, { recursive: true, force: true });
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
test("repository analyst path selection fails closed before specification writing", async () => {
|
|
433
|
+
const { root, initialCommit } = await fixture();
|
|
434
|
+
const calls = [];
|
|
435
|
+
try {
|
|
436
|
+
const transport = Layer.succeed(EvalAuthoringTransport, EvalAuthoringTransport.of({
|
|
437
|
+
complete: (input) => {
|
|
438
|
+
calls.push(input);
|
|
439
|
+
const output = completionFor(input);
|
|
440
|
+
return Effect.succeed(JSON.stringify(input.foundryRole === "repository-analyst"
|
|
441
|
+
? {
|
|
442
|
+
...output,
|
|
443
|
+
relevantPaths: ["src/not-in-the-repository.ts"]
|
|
444
|
+
}
|
|
445
|
+
: output));
|
|
446
|
+
}
|
|
447
|
+
}));
|
|
448
|
+
await assert.rejects(Effect.runPromise(authorRepositoryCaseSpecificationV1({
|
|
449
|
+
repositoryRoot: root,
|
|
450
|
+
operationId: "foundry-invalid-context",
|
|
451
|
+
caseId: "case-stream-invalid-context",
|
|
452
|
+
map: behaviorMap(root, initialCommit),
|
|
453
|
+
seed: seed(initialCommit),
|
|
454
|
+
family,
|
|
455
|
+
modelPlan: gpt56RepositoryFoundryModelPlanV1({
|
|
456
|
+
primaryModel: "openai/gpt-5.6-sol",
|
|
457
|
+
criticAModel: "openai/gpt-5.6-luna",
|
|
458
|
+
criticBModel: "openai/gpt-5.6-terra"
|
|
459
|
+
})
|
|
460
|
+
}).pipe(Effect.provide(RepositoryFoundryLanguageModelLive.pipe(Layer.provide(transport))))), /select-generation-context.*between one and eight unique paths/u);
|
|
461
|
+
assert.deepEqual(calls.map((call) => call.foundryRole), ["repository-analyst"]);
|
|
462
|
+
}
|
|
463
|
+
finally {
|
|
464
|
+
await rm(root, { recursive: true, force: true });
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
test("generation context ownership prefers the deepest workspace package", () => {
|
|
468
|
+
const nestedSeed = {
|
|
469
|
+
...seed("a".repeat(40)),
|
|
470
|
+
capabilityEvidence: [
|
|
471
|
+
{
|
|
472
|
+
kind: "symbol",
|
|
473
|
+
id: "nested-implementation",
|
|
474
|
+
path: "packages/feature/src/feature.ts"
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
kind: "test",
|
|
478
|
+
id: "nested-test",
|
|
479
|
+
path: "packages/feature/src/feature.test.ts"
|
|
480
|
+
}
|
|
481
|
+
]
|
|
482
|
+
};
|
|
483
|
+
const map = {
|
|
484
|
+
...behaviorMap("/repo", "a".repeat(40)),
|
|
485
|
+
packages: [
|
|
486
|
+
{
|
|
487
|
+
id: "package-root",
|
|
488
|
+
name: "root",
|
|
489
|
+
path: ".",
|
|
490
|
+
manifestPath: "package.json",
|
|
491
|
+
dependencyPackageIds: [],
|
|
492
|
+
publicExports: ["."]
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
id: "package-feature",
|
|
496
|
+
name: "feature",
|
|
497
|
+
path: "packages/feature",
|
|
498
|
+
manifestPath: "packages/feature/package.json",
|
|
499
|
+
dependencyPackageIds: [],
|
|
500
|
+
publicExports: ["."]
|
|
501
|
+
}
|
|
502
|
+
],
|
|
503
|
+
publicSurfaces: [
|
|
504
|
+
{
|
|
505
|
+
id: "surface-root",
|
|
506
|
+
packageId: "package-root",
|
|
507
|
+
path: "src/index.ts",
|
|
508
|
+
kind: "package-export",
|
|
509
|
+
symbols: []
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
id: "surface-feature",
|
|
513
|
+
packageId: "package-feature",
|
|
514
|
+
path: "packages/feature/src/index.ts",
|
|
515
|
+
kind: "package-export",
|
|
516
|
+
symbols: ["feature"]
|
|
517
|
+
}
|
|
518
|
+
],
|
|
519
|
+
protocols: [
|
|
520
|
+
{
|
|
521
|
+
id: "protocol-root",
|
|
522
|
+
path: "src/root-protocol.ts",
|
|
523
|
+
name: "RootProtocol",
|
|
524
|
+
kind: "internal-boundary"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
id: "protocol-feature",
|
|
528
|
+
path: "packages/feature/src/feature-protocol.ts",
|
|
529
|
+
name: "FeatureProtocol",
|
|
530
|
+
kind: "internal-boundary"
|
|
531
|
+
}
|
|
532
|
+
]
|
|
533
|
+
};
|
|
534
|
+
const candidates = repositoryGenerationContextCandidatesV1({
|
|
535
|
+
map,
|
|
536
|
+
seed: nestedSeed
|
|
537
|
+
}).map((candidate) => candidate.path);
|
|
538
|
+
assert.ok(candidates.includes("packages/feature/package.json"));
|
|
539
|
+
assert.ok(candidates.includes("packages/feature/src/index.ts"));
|
|
540
|
+
assert.ok(candidates.includes("packages/feature/src/feature-protocol.ts"));
|
|
541
|
+
assert.equal(candidates.includes("package.json"), false);
|
|
542
|
+
assert.equal(candidates.includes("src/index.ts"), false);
|
|
543
|
+
assert.equal(candidates.includes("src/root-protocol.ts"), false);
|
|
544
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|