@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,183 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { test } from "node:test";
|
|
3
|
+
import { decodeRepositoryReviewEvidenceV2, encodeRepositoryReviewEvidenceV1, encodeRepositoryReviewEvidenceV2 } from "../adapters/repository-review-evidence.js";
|
|
4
|
+
const wire = (value) => JSON.stringify(value);
|
|
5
|
+
const bytes = (value) => Buffer.byteLength(wire(value));
|
|
6
|
+
test("compact review encoding preserves arbitrary JSON, source changes, and string delimiters", () => {
|
|
7
|
+
const source = `${"export const stable = true;\n".repeat(200)}😀 selected\n`;
|
|
8
|
+
const input = {
|
|
9
|
+
sources: [{ content: source }, { content: source.replace("selected", "changed") }],
|
|
10
|
+
values: [null, true, false, 0, undefined, ["row", 0, "literal array"]],
|
|
11
|
+
diagnostics: [
|
|
12
|
+
"recipe=retained-behavior; exit=0; timeout=false; assertions=23; durationMs=102; exactly repeated delimiter field;".repeat(2),
|
|
13
|
+
"recipe=retained-behavior; exit=1; timeout=false; assertions=23; durationMs=103; exactly repeated delimiter field;"
|
|
14
|
+
],
|
|
15
|
+
special: Object.fromEntries([
|
|
16
|
+
["__proto__", { kept: true }],
|
|
17
|
+
["toJSON", "literal key"],
|
|
18
|
+
["encoding", ["string", 0]],
|
|
19
|
+
["unicode", ["\ud800".repeat(256), "é😀\r\n"]]
|
|
20
|
+
])
|
|
21
|
+
};
|
|
22
|
+
const packet = encodeRepositoryReviewEvidenceV2(input, [source]);
|
|
23
|
+
assert.equal(wire(decodeRepositoryReviewEvidenceV2(packet)), wire(input));
|
|
24
|
+
assert.equal(wire(decodeRepositoryReviewEvidenceV2(JSON.parse(wire(packet)))), wire(input));
|
|
25
|
+
});
|
|
26
|
+
test("compact review retains full executed populations, including failing and unknown observations", () => {
|
|
27
|
+
const source = `${"export const unchanged = true;\n".repeat(900)}export const selected = 0;\n`;
|
|
28
|
+
const observation = (index, phase) => ({
|
|
29
|
+
solutionId: `independently-authored-${phase}-control-${index % 18}`,
|
|
30
|
+
clauseId: `required-executable-behavior-clause-${index % 12}`,
|
|
31
|
+
repetition: (index % 2) + 1,
|
|
32
|
+
outcome: index % 19 === 0 ? "unknown" : index % 13 === 0 ? "fail" : "pass",
|
|
33
|
+
detail: [
|
|
34
|
+
"recipe=command-complete-targeted-tests",
|
|
35
|
+
"observedRecipe=command-complete-targeted-tests",
|
|
36
|
+
`exit=${index % 13 === 0 ? 1 : 0}`,
|
|
37
|
+
"stage=grade",
|
|
38
|
+
"gradeExecuted=true",
|
|
39
|
+
"timeout=false",
|
|
40
|
+
`durationMs=${index + 200}`,
|
|
41
|
+
`preparationTemplate=${"a".repeat(64)}`,
|
|
42
|
+
`cloneDurationMs=${index + 1000}`,
|
|
43
|
+
"evidence=host reporter recorded complete named assertions"
|
|
44
|
+
].join("; ")
|
|
45
|
+
});
|
|
46
|
+
const input = {
|
|
47
|
+
sources: [{ path: "src/example.ts", content: source }],
|
|
48
|
+
solutions: Array.from({ length: 30 }, (_, index) => ({
|
|
49
|
+
id: `independent-control-${index}`,
|
|
50
|
+
content: source.replace("selected = 0", `selected = ${index + 1}`)
|
|
51
|
+
})),
|
|
52
|
+
development: Array.from({ length: 460 }, (_, index) => observation(index, "development")),
|
|
53
|
+
heldOut: Array.from({ length: 540 }, (_, index) => observation(index, "held-out")),
|
|
54
|
+
evidenceInventory: Array.from({ length: 540 }, (_, index) => `review-packet:/heldOut/${index}`)
|
|
55
|
+
};
|
|
56
|
+
const old = encodeRepositoryReviewEvidenceV1(input, [source]);
|
|
57
|
+
const compact = encodeRepositoryReviewEvidenceV2(input, [source]);
|
|
58
|
+
assert.ok(bytes(old) > 512_000);
|
|
59
|
+
assert.ok(bytes(compact) < 512_000);
|
|
60
|
+
assert.ok(bytes(compact) < bytes(old) * 0.8);
|
|
61
|
+
const decoded = decodeRepositoryReviewEvidenceV2(compact);
|
|
62
|
+
assert.equal(wire(decoded), wire(input));
|
|
63
|
+
assert.equal(decoded.heldOut.length, 540);
|
|
64
|
+
assert.equal(decoded.development.length, 460);
|
|
65
|
+
assert.deepEqual(decoded.heldOut.filter((entry) => entry.outcome !== "pass"), input.heldOut.filter((entry) => entry.outcome !== "pass"));
|
|
66
|
+
});
|
|
67
|
+
test("compact review rejects changed outcomes, missing columns, invalid references, and digest changes", () => {
|
|
68
|
+
const packet = encodeRepositoryReviewEvidenceV2({ solutionId: "independent-solution", outcome: "unknown", observations: [true] }, []);
|
|
69
|
+
const damaged = (edit) => {
|
|
70
|
+
const copy = JSON.parse(wire(packet));
|
|
71
|
+
edit(copy);
|
|
72
|
+
return copy;
|
|
73
|
+
};
|
|
74
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV2(damaged((copy) => {
|
|
75
|
+
copy.evidence[3] = "pass";
|
|
76
|
+
})), /original evidence digest mismatch/u);
|
|
77
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV2(damaged((copy) => {
|
|
78
|
+
copy.evidence.pop();
|
|
79
|
+
})), /object shape/u);
|
|
80
|
+
for (const invalid of [-1, 0.5, 99])
|
|
81
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV2(damaged((copy) => {
|
|
82
|
+
copy.evidence[1] = invalid;
|
|
83
|
+
})), /shape reference is missing/u);
|
|
84
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV2(damaged((copy) => {
|
|
85
|
+
copy.shapes[0][1] = copy.shapes[0][0];
|
|
86
|
+
})), /unique object shape/u);
|
|
87
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV2(damaged((copy) => {
|
|
88
|
+
copy.evidence[2] = ["j", "text", 7];
|
|
89
|
+
})), /only literal string parts/u);
|
|
90
|
+
});
|
|
91
|
+
test("shared review subtrees retain every occurrence and reject cycles and changed shared outcomes", () => {
|
|
92
|
+
const observed = {
|
|
93
|
+
id: "complete-frozen-control-population",
|
|
94
|
+
observations: Array.from({ length: 20 }, (_, index) => ({
|
|
95
|
+
solutionId: `retained-control-${index}`,
|
|
96
|
+
outcome: index === 7 ? "unknown" : "pass",
|
|
97
|
+
repetition: 2,
|
|
98
|
+
detail: "Retain this complete executed observation in every population."
|
|
99
|
+
}))
|
|
100
|
+
};
|
|
101
|
+
const input = { first: observed, second: observed, nested: [{ retained: observed }] };
|
|
102
|
+
const packet = encodeRepositoryReviewEvidenceV2(input, []);
|
|
103
|
+
assert.ok(packet.nodes.length > 0);
|
|
104
|
+
assert.deepEqual(decodeRepositoryReviewEvidenceV2(packet), input);
|
|
105
|
+
assert.ok(bytes(packet) < bytes(encodeRepositoryReviewEvidenceV1(input, [])));
|
|
106
|
+
const damaged = {
|
|
107
|
+
...packet,
|
|
108
|
+
nodes: [["n", 0], ...packet.nodes.slice(1)]
|
|
109
|
+
};
|
|
110
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV2(damaged), /acyclic and point backwards/u);
|
|
111
|
+
const changed = {
|
|
112
|
+
...packet,
|
|
113
|
+
nodes: [["a", "changed outcome"], ...packet.nodes.slice(1)]
|
|
114
|
+
};
|
|
115
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV2(changed), /original evidence digest mismatch/u);
|
|
116
|
+
});
|
|
117
|
+
test("separated source edits retain unchanged regions, Unicode, CRLF, and complete control populations", () => {
|
|
118
|
+
const source = Array.from({ length: 480 }, (_, index) => `export const unchanged_${index} = ${index}; // retained 😀\r\n`).join("");
|
|
119
|
+
const variants = Array.from({ length: 18 }, (_, index) => source
|
|
120
|
+
.replace("unchanged_12 = 12", `unchanged_12 = ${1000 + index}`)
|
|
121
|
+
.replace("unchanged_415 = 415", `unchanged_415 = ${2000 + index}`)
|
|
122
|
+
.concat(`export const added_${index} = "é";\r\n`));
|
|
123
|
+
const input = {
|
|
124
|
+
source,
|
|
125
|
+
controls: variants.map((content, index) => ({
|
|
126
|
+
id: `independent-control-${index}`,
|
|
127
|
+
content,
|
|
128
|
+
outcome: index === 6 ? "unknown" : index === 8 ? "fail" : "pass"
|
|
129
|
+
}))
|
|
130
|
+
};
|
|
131
|
+
const compact = encodeRepositoryReviewEvidenceV2(input, [source]);
|
|
132
|
+
const legacy = encodeRepositoryReviewEvidenceV1(input, [source]);
|
|
133
|
+
assert.ok(compact.texts.some(([, text]) => text[0] === "patch"));
|
|
134
|
+
assert.ok(bytes(compact) < bytes(legacy) * 0.3);
|
|
135
|
+
assert.deepEqual(decodeRepositoryReviewEvidenceV2(compact), input);
|
|
136
|
+
assert.deepEqual(decodeRepositoryReviewEvidenceV2(JSON.parse(wire(compact))), input);
|
|
137
|
+
});
|
|
138
|
+
test("source patches reject overlapping edits, incorrect context, modified replacements, and cycles", () => {
|
|
139
|
+
const source = Array.from({ length: 300 }, (_, index) => `export const retained_${index} = ${index};\n`).join("");
|
|
140
|
+
const changed = source
|
|
141
|
+
.replace("retained_10 = 10", "retained_10 = -1")
|
|
142
|
+
.replace("retained_270 = 270", "retained_270 = -2");
|
|
143
|
+
const packet = encodeRepositoryReviewEvidenceV2({ source, changed }, [source]);
|
|
144
|
+
const index = packet.texts.findIndex(([, entry]) => entry[0] === "patch");
|
|
145
|
+
assert.ok(index >= 0);
|
|
146
|
+
const damaged = (edit) => {
|
|
147
|
+
const copy = JSON.parse(wire(packet));
|
|
148
|
+
edit(copy);
|
|
149
|
+
return copy;
|
|
150
|
+
};
|
|
151
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV2(damaged((copy) => {
|
|
152
|
+
const edits = copy.texts[index][1][2];
|
|
153
|
+
edits[1][0] = edits[0][0];
|
|
154
|
+
})), /invalid ranges or source context/u);
|
|
155
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV2(damaged((copy) => {
|
|
156
|
+
copy.texts[index][1][2][0][3].startLine += 1;
|
|
157
|
+
})), /invalid ranges or source context/u);
|
|
158
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV2(damaged((copy) => {
|
|
159
|
+
copy.texts[index][1][2][0][2] += "invalid";
|
|
160
|
+
})), /text digest mismatch/u);
|
|
161
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV2(damaged((copy) => {
|
|
162
|
+
copy.texts[index][1][1] = copy.texts[index][0];
|
|
163
|
+
})), /bounded and acyclic/u);
|
|
164
|
+
});
|
|
165
|
+
test("source patch round trips preserve arbitrary insertion and deletion positions", () => {
|
|
166
|
+
let seed = 1729;
|
|
167
|
+
const random = (maximum) => {
|
|
168
|
+
seed = (Math.imul(seed, 1664525) + 1013904223) >>> 0;
|
|
169
|
+
return seed % maximum;
|
|
170
|
+
};
|
|
171
|
+
const source = Array.from({ length: 90 }, (_, index) => `const retained_${index} = "${index}😀";\n${index % 3 === 0 ? "\n" : ""}`).join("");
|
|
172
|
+
for (let iteration = 0; iteration < 60; iteration += 1) {
|
|
173
|
+
let changed = source;
|
|
174
|
+
for (let edit = 0; edit < 6; edit += 1) {
|
|
175
|
+
const start = random(changed.length + 1);
|
|
176
|
+
const end = Math.min(changed.length, start + random(50));
|
|
177
|
+
const replacement = ["", "😀\r\n", `value_${iteration}_${edit}`, "\ud800"][random(4)];
|
|
178
|
+
changed = changed.slice(0, start) + replacement + changed.slice(end);
|
|
179
|
+
}
|
|
180
|
+
const input = { source, changed, duplicate: changed };
|
|
181
|
+
assert.equal(wire(decodeRepositoryReviewEvidenceV2(encodeRepositoryReviewEvidenceV2(input, [source]))), wire(input));
|
|
182
|
+
}
|
|
183
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { test } from "node:test";
|
|
3
|
+
import { decodeRepositoryReviewEvidenceV1, encodeRepositoryReviewEvidenceV1 } from "../adapters/repository-review-evidence.js";
|
|
4
|
+
const wire = (value) => JSON.stringify(value);
|
|
5
|
+
const bytes = (value) => Buffer.byteLength(wire(value));
|
|
6
|
+
test("review encoding preserves every JSON byte, including Unicode, reserved-looking keys, arrays and full-file edits", () => {
|
|
7
|
+
const base = `${"export const retained = true;\n".repeat(200)}😀 original\n${"// unchanged suffix\n".repeat(200)}`;
|
|
8
|
+
const variants = [
|
|
9
|
+
base.replace("😀 original", "😃 repaired"),
|
|
10
|
+
`added at start\n${base}`,
|
|
11
|
+
`${base}\nadded at end`,
|
|
12
|
+
base.replace("😀 original", "")
|
|
13
|
+
];
|
|
14
|
+
const input = {
|
|
15
|
+
sources: [{ path: "src/wire.ts", content: base }],
|
|
16
|
+
controls: variants.map((content, index) => ({
|
|
17
|
+
id: String(index),
|
|
18
|
+
fileOverrides: [{ content }]
|
|
19
|
+
})),
|
|
20
|
+
observations: variants.map((_, index) => ({
|
|
21
|
+
index,
|
|
22
|
+
outcome: "unknown",
|
|
23
|
+
detail: "Exact evidence stays present."
|
|
24
|
+
})),
|
|
25
|
+
arbitrary: Object.fromEntries([
|
|
26
|
+
["__proto__", { important: true }],
|
|
27
|
+
["$foundryText", ["text", "a".repeat(64)]],
|
|
28
|
+
["encoding", "routekit-lossless-review-json-v1"],
|
|
29
|
+
["toJSON", "ordinary JSON field"],
|
|
30
|
+
["unicode", ["\ud800".repeat(256), "\ud801".repeat(256), "é😀\r\n"]]
|
|
31
|
+
]),
|
|
32
|
+
optional: undefined,
|
|
33
|
+
arrayWithMissingValue: [undefined, null, false, 0]
|
|
34
|
+
};
|
|
35
|
+
const packet = encodeRepositoryReviewEvidenceV1(input, [base]);
|
|
36
|
+
assert.equal(wire(decodeRepositoryReviewEvidenceV1(packet)), wire(input));
|
|
37
|
+
assert.equal(wire(decodeRepositoryReviewEvidenceV1(JSON.parse(wire(packet)))), wire(input));
|
|
38
|
+
assert.ok(Object.values(packet.texts).some((entry) => entry[0] === "splice"));
|
|
39
|
+
assert.ok(bytes(packet) < bytes(input));
|
|
40
|
+
});
|
|
41
|
+
test("review reconstruction rejects changed text, missing bases and overlapping UTF16 ranges", () => {
|
|
42
|
+
const base = "😀 original behavior\n".repeat(300);
|
|
43
|
+
const packet = encodeRepositoryReviewEvidenceV1({ content: base.replace("original", "repaired") }, [base]);
|
|
44
|
+
const spliceKey = Object.keys(packet.texts).find((key) => packet.texts[key]?.[0] === "splice");
|
|
45
|
+
assert.ok(spliceKey);
|
|
46
|
+
const damaged = (edit) => {
|
|
47
|
+
const copy = JSON.parse(wire(packet));
|
|
48
|
+
edit(copy.texts);
|
|
49
|
+
return copy;
|
|
50
|
+
};
|
|
51
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV1(damaged((texts) => {
|
|
52
|
+
const splice = texts[spliceKey];
|
|
53
|
+
splice[4] = "different source";
|
|
54
|
+
})), /digest mismatch/u);
|
|
55
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV1(damaged((texts) => {
|
|
56
|
+
const splice = texts[spliceKey];
|
|
57
|
+
delete texts[splice[1]];
|
|
58
|
+
})), /invalid base/u);
|
|
59
|
+
for (const invalidPrefix of [-1, 0.5, base.length + 1]) {
|
|
60
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV1(damaged((texts) => {
|
|
61
|
+
const splice = texts[spliceKey];
|
|
62
|
+
splice[2] = invalidPrefix;
|
|
63
|
+
})), /overlapping ranges/u);
|
|
64
|
+
}
|
|
65
|
+
assert.throws(() => decodeRepositoryReviewEvidenceV1(damaged((texts) => {
|
|
66
|
+
const splice = texts[spliceKey];
|
|
67
|
+
splice[5] = {
|
|
68
|
+
startLine: 1,
|
|
69
|
+
endLine: 1,
|
|
70
|
+
immediatelyBefore: "misleading source",
|
|
71
|
+
immediatelyAfter: ""
|
|
72
|
+
};
|
|
73
|
+
})), /context does not match/u);
|
|
74
|
+
});
|
|
75
|
+
test("v4-sized development and held-out populations fit unchanged review cap with exact full evidence", () => {
|
|
76
|
+
// Synthetic ordinary source, sized after the saved v4 population. No private task or oracle data.
|
|
77
|
+
const source = `${Array.from({ length: 390 }, (_, i) => `export const value${i} = ${i}; // retained public behavior\n`).join("")}export const selected = 0;\n`;
|
|
78
|
+
const solution = (population, index) => ({
|
|
79
|
+
id: `${population}-${index}`,
|
|
80
|
+
kind: index < 6 ? "mutation" : "reward-hacking",
|
|
81
|
+
family: `${population}-family-${index}`,
|
|
82
|
+
fileOverrides: [
|
|
83
|
+
{
|
|
84
|
+
path: "src/wire.ts",
|
|
85
|
+
content: source.replace("selected = 0", `selected = ${index + (population === "held-out" ? 30 : 1)}`)
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
});
|
|
89
|
+
const input = {
|
|
90
|
+
repositoryEnvironment: { sources: [{ path: "src/wire.ts", content: source }] },
|
|
91
|
+
visible: { requestText: "Preserve the public protocol behavior." },
|
|
92
|
+
validSolutions: [solution("valid", 0), solution("valid", 1)],
|
|
93
|
+
developmentAdversaries: Array.from({ length: 9 }, (_, i) => solution("development", i)),
|
|
94
|
+
heldOutAdversaries: Array.from({ length: 9 }, (_, i) => solution("held-out", i)),
|
|
95
|
+
fixtureProposal: {
|
|
96
|
+
fixtures: Array.from({ length: 10 }, (_, i) => ({
|
|
97
|
+
id: `fixture-${i}`,
|
|
98
|
+
expectedBehavior: `Requirement ${i}`
|
|
99
|
+
})),
|
|
100
|
+
overlays: Array.from({ length: 10 }, (_, i) => ({
|
|
101
|
+
path: "test/wire.test.ts",
|
|
102
|
+
content: `// fixture ${i}\n${"assert.equal(actual, expected);\n".repeat(160)}`
|
|
103
|
+
}))
|
|
104
|
+
},
|
|
105
|
+
evidenceInventory: ["review-packet:/heldOutAdversaries/8", "review-packet:/validSolutions/1"]
|
|
106
|
+
};
|
|
107
|
+
assert.ok(bytes(input) > 512_000, `unencoded fixture was only ${bytes(input)} bytes`);
|
|
108
|
+
const packet = encodeRepositoryReviewEvidenceV1(input, [source]);
|
|
109
|
+
assert.ok(bytes(packet) < 512_000, `encoded fixture was ${bytes(packet)} bytes`);
|
|
110
|
+
assert.equal(wire(decodeRepositoryReviewEvidenceV1(packet)), wire(input));
|
|
111
|
+
const restored = decodeRepositoryReviewEvidenceV1(packet);
|
|
112
|
+
assert.equal(restored.heldOutAdversaries.length, 9);
|
|
113
|
+
assert.equal(restored.developmentAdversaries.length, 9);
|
|
114
|
+
assert.deepEqual(restored.evidenceInventory, input.evidenceInventory);
|
|
115
|
+
});
|
|
116
|
+
test("encoding remains bounded before creating a whole oversized JSON request", () => {
|
|
117
|
+
for (const input of [new Date(0), { toJSON: () => ({ hiddenTransformation: true }) }])
|
|
118
|
+
assert.throws(() => encodeRepositoryReviewEvidenceV1(input, []), /plain JSON/u);
|
|
119
|
+
assert.throws(() => encodeRepositoryReviewEvidenceV1({ source: "x".repeat(16 * 1024 * 1024) }, []), /16MiB encoding bound/u);
|
|
120
|
+
let nested = "leaf";
|
|
121
|
+
for (let i = 0; i < 130; i += 1)
|
|
122
|
+
nested = [nested];
|
|
123
|
+
assert.throws(() => encodeRepositoryReviewEvidenceV1(nested, []), /depth bound/u);
|
|
124
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
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 { join } from "node:path";
|
|
6
|
+
import { test } from "node:test";
|
|
7
|
+
import { promisify } from "node:util";
|
|
8
|
+
import { Effect } from "effect";
|
|
9
|
+
import { assertRepositoryFoundryGenerationPlanV1, assertRepositoryFoundryReferenceExclusionsV1, repositoryFoundryGenerationPlanDigestV1 } from "../repository-foundry-plan-protocol.js";
|
|
10
|
+
import { repositoryFoundryModelPlanV1 } from "../repository-language-model-protocol.js";
|
|
11
|
+
import { planHistoricalRepositoryCaseGenerationV1 } from "../services/foundry/service.js";
|
|
12
|
+
const exec = promisify(execFile);
|
|
13
|
+
const modelPlan = repositoryFoundryModelPlanV1({ primaryModel: "codex/gpt-6-astra" });
|
|
14
|
+
async function fixture(t) {
|
|
15
|
+
const root = await realpath(await mkdtemp(join(tmpdir(), "seed-exclusion-unit-")));
|
|
16
|
+
t.after(() => rm(root, { recursive: true, force: true }));
|
|
17
|
+
await mkdir(join(root, "src"));
|
|
18
|
+
await mkdir(join(root, "test"));
|
|
19
|
+
await writeFile(join(root, "package.json"), JSON.stringify({
|
|
20
|
+
name: "protocol-value-fixture",
|
|
21
|
+
type: "module",
|
|
22
|
+
scripts: { test: "node --test test/*.test.js" }
|
|
23
|
+
}));
|
|
24
|
+
const git = (...args) => exec("git", ["-C", root, ...args]);
|
|
25
|
+
await git("init", "-q");
|
|
26
|
+
const commits = [];
|
|
27
|
+
for (let value = 0; value <= 2; value += 1) {
|
|
28
|
+
await writeFile(join(root, "src/index.js"), `export const protocolValue = () => ${value};\n`);
|
|
29
|
+
await writeFile(join(root, "test/value.test.js"), `import assert from 'node:assert/strict';\nimport { test } from 'node:test';\nimport { protocolValue } from '../src/index.js';\ntest('protocol value', () => assert.equal(protocolValue(), ${value}));\n`);
|
|
30
|
+
await git("add", ".");
|
|
31
|
+
await git("-c", "core.hooksPath=/dev/null", "-c", "commit.gpgsign=false", "-c", "user.name=Fixture", "-c", "user.email=fixture@example.test", "commit", "-qm", value === 0 ? "initial fixture" : `fix: protocol value regression ${value}`);
|
|
32
|
+
commits.push((await git("rev-parse", "HEAD")).stdout.trim());
|
|
33
|
+
}
|
|
34
|
+
return { root, references: commits.slice(1) };
|
|
35
|
+
}
|
|
36
|
+
test("admitted references are removed before the one-candidate qualification budget", async (t) => {
|
|
37
|
+
const f = await fixture(t);
|
|
38
|
+
const input = {
|
|
39
|
+
repositoryRoot: f.root,
|
|
40
|
+
caseId: "first-selection",
|
|
41
|
+
requestedDimension: "protocol value",
|
|
42
|
+
maximumSeedCandidates: 1,
|
|
43
|
+
modelPlan
|
|
44
|
+
};
|
|
45
|
+
const first = await Effect.runPromise(planHistoricalRepositoryCaseGenerationV1(input));
|
|
46
|
+
assert.ok(f.references.includes(first.referenceCommit));
|
|
47
|
+
assert.equal(first.excludedReferenceCommits, undefined);
|
|
48
|
+
const second = await Effect.runPromise(planHistoricalRepositoryCaseGenerationV1({
|
|
49
|
+
...input,
|
|
50
|
+
caseId: "second-selection",
|
|
51
|
+
excludedReferenceCommits: [first.referenceCommit]
|
|
52
|
+
}));
|
|
53
|
+
assert.notEqual(second.referenceCommit, first.referenceCommit);
|
|
54
|
+
assert.ok(f.references.includes(second.referenceCommit));
|
|
55
|
+
assert.deepEqual(second.excludedReferenceCommits, [first.referenceCommit]);
|
|
56
|
+
assertRepositoryFoundryGenerationPlanV1(second);
|
|
57
|
+
const { planDigest: _digest, ...withoutDigest } = second;
|
|
58
|
+
assert.notEqual(repositoryFoundryGenerationPlanDigestV1({
|
|
59
|
+
...withoutDigest,
|
|
60
|
+
excludedReferenceCommits: ["f".repeat(40)]
|
|
61
|
+
}), second.planDigest);
|
|
62
|
+
const invalid = { ...withoutDigest, excludedReferenceCommits: [second.referenceCommit] };
|
|
63
|
+
assert.throws(() => assertRepositoryFoundryGenerationPlanV1({
|
|
64
|
+
...invalid,
|
|
65
|
+
planDigest: repositoryFoundryGenerationPlanDigestV1(invalid)
|
|
66
|
+
}), /selected an excluded reference/u);
|
|
67
|
+
await assert.rejects(Effect.runPromise(planHistoricalRepositoryCaseGenerationV1({
|
|
68
|
+
...input,
|
|
69
|
+
caseId: "exhausted",
|
|
70
|
+
excludedReferenceCommits: [...f.references].sort()
|
|
71
|
+
})), /no unseen eligible historical seed/u);
|
|
72
|
+
});
|
|
73
|
+
test("reference exclusion inputs are canonical and cannot alter explicit calibration preparation", async () => {
|
|
74
|
+
const a = "a".repeat(40);
|
|
75
|
+
const b = "b".repeat(40);
|
|
76
|
+
assertRepositoryFoundryReferenceExclusionsV1(undefined);
|
|
77
|
+
assertRepositoryFoundryReferenceExclusionsV1([a, b]);
|
|
78
|
+
for (const references of [
|
|
79
|
+
[],
|
|
80
|
+
[a, a],
|
|
81
|
+
[b, a],
|
|
82
|
+
["A".repeat(40)],
|
|
83
|
+
["abc"],
|
|
84
|
+
["a".repeat(41)],
|
|
85
|
+
Array.from({ length: 257 }, (_, index) => index.toString(16).padStart(40, "0"))
|
|
86
|
+
]) {
|
|
87
|
+
assert.throws(() => assertRepositoryFoundryReferenceExclusionsV1(references), /sorted unique lowercase full commit SHAs/u);
|
|
88
|
+
}
|
|
89
|
+
await assert.rejects(Effect.runPromise(planHistoricalRepositoryCaseGenerationV1({
|
|
90
|
+
repositoryRoot: "/never-opened-fixture",
|
|
91
|
+
referenceCommit: b,
|
|
92
|
+
excludedReferenceCommits: [a],
|
|
93
|
+
caseId: "conflicting-calibration",
|
|
94
|
+
modelPlan
|
|
95
|
+
})), /generation request failed validation/u);
|
|
96
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|