@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,250 @@
|
|
|
1
|
+
import { Context, Effect, Layer } from "effect";
|
|
2
|
+
import { captureGitTreeSnapshotV1, readGitChangeEpisodesV1 } from "../../adapters/git-task-history.js";
|
|
3
|
+
import { discoverRepositoryTestsV1 } from "../../adapters/test-discovery.js";
|
|
4
|
+
import { indexTypeScriptRepositoryV1 } from "../../adapters/typescript-repository-index.js";
|
|
5
|
+
import { assertRepositoryBehaviorMapV1 } from "../../repository-behavior-protocol.js";
|
|
6
|
+
const ownershipRoot = (path) => {
|
|
7
|
+
const parts = path.split("/");
|
|
8
|
+
if (parts.length >= 2 &&
|
|
9
|
+
(parts[0] === "packages" || parts[0] === "apps")) {
|
|
10
|
+
return parts.slice(0, 2).join("/");
|
|
11
|
+
}
|
|
12
|
+
return parts[0] ?? path;
|
|
13
|
+
};
|
|
14
|
+
const behaviorOwnershipRoots = (episode) => [
|
|
15
|
+
...new Set(episode.changedPaths
|
|
16
|
+
.filter((entry) => entry.kind === "implementation" ||
|
|
17
|
+
entry.kind === "protocol" ||
|
|
18
|
+
entry.kind === "schema" ||
|
|
19
|
+
entry.kind === "test")
|
|
20
|
+
.map((entry) => ownershipRoot(entry.path)))
|
|
21
|
+
].sort();
|
|
22
|
+
const pathWithinRoot = (path, root) => path === root || path.startsWith(`${root}/`);
|
|
23
|
+
const withoutExcludedPackageHistory = (episodes, excludedPackageRoots) => episodes.map((episode) => {
|
|
24
|
+
const changedPaths = episode.changedPaths.filter((entry) => !excludedPackageRoots.some((root) => pathWithinRoot(entry.path, root)));
|
|
25
|
+
const testPaths = changedPaths
|
|
26
|
+
.filter((entry) => entry.kind === "test")
|
|
27
|
+
.map((entry) => entry.path);
|
|
28
|
+
const implementationPaths = changedPaths
|
|
29
|
+
.filter((entry) => entry.kind === "implementation")
|
|
30
|
+
.map((entry) => entry.path);
|
|
31
|
+
const protocolPaths = changedPaths
|
|
32
|
+
.filter((entry) => entry.kind === "protocol" || entry.kind === "schema")
|
|
33
|
+
.map((entry) => entry.path);
|
|
34
|
+
const behaviorChanging = implementationPaths.length > 0 || protocolPaths.length > 0;
|
|
35
|
+
return {
|
|
36
|
+
...episode,
|
|
37
|
+
changedPaths,
|
|
38
|
+
testPaths,
|
|
39
|
+
implementationPaths,
|
|
40
|
+
protocolPaths,
|
|
41
|
+
behaviorChanging,
|
|
42
|
+
seedEligible: behaviorChanging &&
|
|
43
|
+
testPaths.length > 0 &&
|
|
44
|
+
episode.parentCommit !== undefined
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
const recurringSignals = (episodes) => {
|
|
48
|
+
const clusters = new Map();
|
|
49
|
+
const intentOf = (subject) => {
|
|
50
|
+
const conventional = /^(fix|feat|refactor|perf|build)(?:\([^)]+\))?[!:]/iu.exec(subject);
|
|
51
|
+
const verb = conventional?.[1]?.toLowerCase() ??
|
|
52
|
+
/^(fix|repair|add|implement|refactor|optimi[sz]e|harden|prevent|preserve)\b/iu
|
|
53
|
+
.exec(subject)?.[1]
|
|
54
|
+
?.toLowerCase();
|
|
55
|
+
if (verb === "fix" || verb === "repair" || verb === "harden" || verb === "prevent") {
|
|
56
|
+
return "repair";
|
|
57
|
+
}
|
|
58
|
+
if (verb === "feat" || verb === "add" || verb === "implement") {
|
|
59
|
+
return "feature";
|
|
60
|
+
}
|
|
61
|
+
if (verb === "perf" || verb === "optimize" || verb === "optimise") {
|
|
62
|
+
return "performance";
|
|
63
|
+
}
|
|
64
|
+
return verb === "build" ? "build" : "refactor";
|
|
65
|
+
};
|
|
66
|
+
const scopeOf = (episode) => {
|
|
67
|
+
const conventional = /^(?:fix|feat|refactor|perf|build)\(([^)]+)\)[!:]/iu.exec(episode.subject)?.[1];
|
|
68
|
+
if (conventional !== undefined) {
|
|
69
|
+
return conventional
|
|
70
|
+
.normalize("NFKC")
|
|
71
|
+
.toLowerCase()
|
|
72
|
+
.replace(/[^a-z0-9-]+/gu, "-")
|
|
73
|
+
.replace(/^-|-$/gu, "");
|
|
74
|
+
}
|
|
75
|
+
const roots = behaviorOwnershipRoots(episode);
|
|
76
|
+
return roots.length === 1
|
|
77
|
+
? roots[0].replace(/^packages\//u, "").replace(/^apps\//u, "")
|
|
78
|
+
: roots.length >= 2 && roots.length <= 3
|
|
79
|
+
? `cross-${roots
|
|
80
|
+
.map((root) => root.replace(/^packages\//u, "").replace(/^apps\//u, ""))
|
|
81
|
+
.join("-")}`
|
|
82
|
+
: undefined;
|
|
83
|
+
};
|
|
84
|
+
for (const episode of episodes.filter((entry) => entry.seedEligible)) {
|
|
85
|
+
const intent = intentOf(episode.subject);
|
|
86
|
+
const scope = scopeOf(episode);
|
|
87
|
+
if (scope === undefined)
|
|
88
|
+
continue;
|
|
89
|
+
const key = `${intent}:${scope}`;
|
|
90
|
+
const cluster = clusters.get(key) ?? { intent, scope, episodes: [] };
|
|
91
|
+
clusters.set(key, {
|
|
92
|
+
...cluster,
|
|
93
|
+
episodes: [...cluster.episodes, episode]
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return [...clusters.values()]
|
|
97
|
+
.filter((cluster) => cluster.episodes.length >= 2)
|
|
98
|
+
.sort((left, right) => right.episodes.length - left.episodes.length ||
|
|
99
|
+
left.intent.localeCompare(right.intent) ||
|
|
100
|
+
left.scope.localeCompare(right.scope))
|
|
101
|
+
.map((cluster, index) => {
|
|
102
|
+
const rootCounts = new Map();
|
|
103
|
+
for (const episode of cluster.episodes) {
|
|
104
|
+
for (const root of new Set(episode.changedPaths
|
|
105
|
+
.filter((entry) => entry.kind === "implementation" ||
|
|
106
|
+
entry.kind === "protocol" ||
|
|
107
|
+
entry.kind === "schema" ||
|
|
108
|
+
entry.kind === "test")
|
|
109
|
+
.map((entry) => ownershipRoot(entry.path)))) {
|
|
110
|
+
rootCounts.set(root, (rootCounts.get(root) ?? 0) + 1);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const minimumSupport = Math.ceil(cluster.episodes.length / 2);
|
|
114
|
+
const pathPatterns = [...rootCounts.entries()]
|
|
115
|
+
.filter(([, count]) => count >= minimumSupport)
|
|
116
|
+
.sort((left, right) => right[1] - left[1] || left[0].localeCompare(right[0]))
|
|
117
|
+
.slice(0, 6)
|
|
118
|
+
.map(([root]) => root);
|
|
119
|
+
const contractChanging = cluster.episodes.some((episode) => episode.changedPaths.some((path) => path.kind === "protocol" || path.kind === "schema"));
|
|
120
|
+
return {
|
|
121
|
+
id: `workload-recurring-${String(index + 1).padStart(3, "0")}`,
|
|
122
|
+
kind: "recurring-behavior-change",
|
|
123
|
+
label: `${cluster.intent} work in ${cluster.scope}`,
|
|
124
|
+
episodeIds: cluster.episodes.map((episode) => episode.id),
|
|
125
|
+
pathPatterns,
|
|
126
|
+
frequency: cluster.episodes.length,
|
|
127
|
+
importance: contractChanging || cluster.episodes.length >= 4
|
|
128
|
+
? "high"
|
|
129
|
+
: "normal",
|
|
130
|
+
confidence: cluster.episodes.length >= 3
|
|
131
|
+
? "high"
|
|
132
|
+
: "medium"
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
const recurringCochangeSignals = (episodes) => {
|
|
137
|
+
const clusters = new Map();
|
|
138
|
+
for (const episode of episodes.filter((entry) => entry.seedEligible)) {
|
|
139
|
+
const roots = behaviorOwnershipRoots(episode);
|
|
140
|
+
for (let left = 0; left < roots.length; left += 1) {
|
|
141
|
+
for (let right = left + 1; right < roots.length; right += 1) {
|
|
142
|
+
const pair = [roots[left], roots[right]];
|
|
143
|
+
const key = pair.join("\u0000");
|
|
144
|
+
const cluster = clusters.get(key);
|
|
145
|
+
clusters.set(key, {
|
|
146
|
+
roots: pair,
|
|
147
|
+
episodes: cluster === undefined
|
|
148
|
+
? [episode]
|
|
149
|
+
: [...cluster.episodes, episode]
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return [...clusters.values()]
|
|
155
|
+
.filter((cluster) => cluster.episodes.length >= 2)
|
|
156
|
+
.sort((left, right) => right.episodes.length - left.episodes.length ||
|
|
157
|
+
left.roots[0].localeCompare(right.roots[0]) ||
|
|
158
|
+
left.roots[1].localeCompare(right.roots[1]))
|
|
159
|
+
.map((cluster, index) => {
|
|
160
|
+
const contractChanging = cluster.episodes.some((episode) => episode.changedPaths.some((entry) => entry.kind === "protocol" || entry.kind === "schema"));
|
|
161
|
+
const labels = cluster.roots.map((root) => root.replace(/^packages\//u, "").replace(/^apps\//u, ""));
|
|
162
|
+
return {
|
|
163
|
+
id: `workload-cochange-${String(index + 1).padStart(3, "0")}`,
|
|
164
|
+
kind: "recurring-cochange",
|
|
165
|
+
label: `recurring cochange in ${labels[0]} and ${labels[1]}`,
|
|
166
|
+
episodeIds: cluster.episodes.map((episode) => episode.id),
|
|
167
|
+
pathPatterns: [...cluster.roots],
|
|
168
|
+
frequency: cluster.episodes.length,
|
|
169
|
+
importance: contractChanging || cluster.episodes.length >= 4
|
|
170
|
+
? "high"
|
|
171
|
+
: "normal",
|
|
172
|
+
confidence: cluster.episodes.length >= 3
|
|
173
|
+
? "high"
|
|
174
|
+
: "medium"
|
|
175
|
+
};
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
export class RepositoryModel extends Context.Service()("@velum-labs/routekit-eval-setup/RepositoryModel") {
|
|
179
|
+
}
|
|
180
|
+
export const buildRepositoryBehaviorMapV1 = Effect.fn("RepositoryModel.build")(function* (input) {
|
|
181
|
+
const snapshot = yield* captureGitTreeSnapshotV1(input);
|
|
182
|
+
const index = yield* indexTypeScriptRepositoryV1(snapshot);
|
|
183
|
+
const historyEpisodes = withoutExcludedPackageHistory(yield* readGitChangeEpisodesV1({
|
|
184
|
+
snapshot,
|
|
185
|
+
...(input.maximumHistoryEpisodes === undefined
|
|
186
|
+
? {}
|
|
187
|
+
: { maximumEpisodes: input.maximumHistoryEpisodes })
|
|
188
|
+
}), index.excludedPackageRoots);
|
|
189
|
+
const discovery = yield* discoverRepositoryTestsV1({
|
|
190
|
+
snapshot,
|
|
191
|
+
packages: index.packages,
|
|
192
|
+
publicSurfaces: index.publicSurfaces,
|
|
193
|
+
protocols: index.protocols,
|
|
194
|
+
commands: index.commands,
|
|
195
|
+
excludedPackageRoots: index.excludedPackageRoots
|
|
196
|
+
});
|
|
197
|
+
const blindSpots = [
|
|
198
|
+
...(index.excludedPackageRoots.length === 0
|
|
199
|
+
? []
|
|
200
|
+
: [
|
|
201
|
+
{
|
|
202
|
+
id: "blind-excluded-package-roots",
|
|
203
|
+
kind: "unknown-relationship",
|
|
204
|
+
detail: "Package-like trees outside the declared pnpm workspace were excluded from automatic ownership and behavior inference.",
|
|
205
|
+
paths: index.excludedPackageRoots
|
|
206
|
+
}
|
|
207
|
+
]),
|
|
208
|
+
...discovery.unmappedTestPaths.map((path, index) => ({
|
|
209
|
+
id: `blind-unmapped-test-${String(index + 1).padStart(3, "0")}`,
|
|
210
|
+
kind: "unmapped-test",
|
|
211
|
+
detail: "No evidence-backed production or package binding was found.",
|
|
212
|
+
paths: [path]
|
|
213
|
+
})),
|
|
214
|
+
...(historyEpisodes.some((episode) => episode.seedEligible)
|
|
215
|
+
? []
|
|
216
|
+
: [
|
|
217
|
+
{
|
|
218
|
+
id: "blind-history-gap",
|
|
219
|
+
kind: "history-gap",
|
|
220
|
+
detail: "No non-merge historical episode combines behavior-changing code with a changed test.",
|
|
221
|
+
paths: []
|
|
222
|
+
}
|
|
223
|
+
])
|
|
224
|
+
];
|
|
225
|
+
const map = {
|
|
226
|
+
version: 1,
|
|
227
|
+
repository: {
|
|
228
|
+
root: snapshot.root,
|
|
229
|
+
requestedRef: snapshot.requestedRef,
|
|
230
|
+
commit: snapshot.commit,
|
|
231
|
+
tree: snapshot.tree
|
|
232
|
+
},
|
|
233
|
+
packages: index.packages,
|
|
234
|
+
publicSurfaces: index.publicSurfaces,
|
|
235
|
+
protocols: index.protocols,
|
|
236
|
+
commands: index.commands,
|
|
237
|
+
tests: discovery.tests,
|
|
238
|
+
testBindings: discovery.testBindings,
|
|
239
|
+
historyEpisodes,
|
|
240
|
+
workloadSignals: [
|
|
241
|
+
...recurringSignals(historyEpisodes),
|
|
242
|
+
...recurringCochangeSignals(historyEpisodes)
|
|
243
|
+
],
|
|
244
|
+
blindSpots
|
|
245
|
+
};
|
|
246
|
+
assertRepositoryBehaviorMapV1(map);
|
|
247
|
+
return map;
|
|
248
|
+
});
|
|
249
|
+
export const makeRepositoryModel = Effect.succeed(RepositoryModel.of({ build: buildRepositoryBehaviorMapV1 }));
|
|
250
|
+
export const RepositoryModelLive = Layer.effect(RepositoryModel, makeRepositoryModel);
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { type RepositoryCandidateVisibleTaskV1 as RepositoryCandidateVisibleTask } from "../../repository-benchmark-protocol.js";
|
|
3
|
+
export declare const REPOSITORY_PUBLIC_ARTIFACT_PROJECTION_VERSION_V1: 1;
|
|
4
|
+
export declare const RepositoryPublicArtifactQualityV1: Schema.Struct<{
|
|
5
|
+
readonly axis: Schema.Literals<readonly ["authenticity", "specification-sufficiency", "oracle-adequacy", "stability", "distinctness", "realism", "leakage", "triviality", "coverage"]>;
|
|
6
|
+
readonly outcome: Schema.Literals<readonly ["pass", "fail", "review-required"]>;
|
|
7
|
+
}>;
|
|
8
|
+
export type RepositoryPublicArtifactQualityV1 = typeof RepositoryPublicArtifactQualityV1.Type;
|
|
9
|
+
export declare const RepositoryPublicArtifactTerminalCheckpointV1: Schema.Struct<{
|
|
10
|
+
readonly kind: Schema.Literal<"terminal">;
|
|
11
|
+
readonly stage: Schema.Literal<"admit">;
|
|
12
|
+
readonly createdAt: Schema.String;
|
|
13
|
+
readonly version: Schema.Literal<2>;
|
|
14
|
+
readonly checkpointId: Schema.String;
|
|
15
|
+
readonly identityDigest: Schema.String;
|
|
16
|
+
readonly attemptGeneration: Schema.Finite;
|
|
17
|
+
readonly sequence: Schema.Finite;
|
|
18
|
+
readonly loopName: Schema.optionalKey<Schema.String>;
|
|
19
|
+
readonly loopIteration: Schema.optionalKey<Schema.Finite>;
|
|
20
|
+
readonly parentDigest: Schema.String;
|
|
21
|
+
readonly payloadDigest: Schema.String;
|
|
22
|
+
readonly payloadBytes: Schema.Finite;
|
|
23
|
+
}>;
|
|
24
|
+
export type RepositoryPublicArtifactTerminalCheckpointV1 = typeof RepositoryPublicArtifactTerminalCheckpointV1.Type;
|
|
25
|
+
export declare const RepositoryPublicArtifactInputV1: Schema.Struct<{
|
|
26
|
+
readonly version: Schema.Literal<1>;
|
|
27
|
+
readonly admitted: Schema.Literal<true>;
|
|
28
|
+
readonly caseId: Schema.String;
|
|
29
|
+
readonly capabilityId: Schema.String;
|
|
30
|
+
readonly familyId: Schema.String;
|
|
31
|
+
readonly lane: Schema.Literals<readonly ["request", "repository-agent"]>;
|
|
32
|
+
readonly visible: Schema.Union<readonly [Schema.Struct<{
|
|
33
|
+
readonly lane: Schema.Literal<"request">;
|
|
34
|
+
readonly id: Schema.String;
|
|
35
|
+
readonly request: Schema.Struct<{
|
|
36
|
+
readonly endpoint: Schema.Literals<readonly ["chat", "responses", "anthropic"]>;
|
|
37
|
+
readonly method: Schema.Literal<"POST">;
|
|
38
|
+
readonly path: Schema.String;
|
|
39
|
+
readonly headers: Schema.$Array<Schema.Struct<{
|
|
40
|
+
readonly name: Schema.String;
|
|
41
|
+
readonly value: Schema.String;
|
|
42
|
+
}>>;
|
|
43
|
+
readonly bodyJson: Schema.String;
|
|
44
|
+
}>;
|
|
45
|
+
}>, Schema.Struct<{
|
|
46
|
+
readonly lane: Schema.Literal<"repository-agent">;
|
|
47
|
+
readonly id: Schema.String;
|
|
48
|
+
readonly requestText: Schema.String;
|
|
49
|
+
readonly checkoutCommit: Schema.String;
|
|
50
|
+
readonly allowedTools: Schema.$Array<Schema.Literals<readonly ["read", "search", "edit", "shell", "test"]>>;
|
|
51
|
+
readonly constraints: Schema.$Array<Schema.String>;
|
|
52
|
+
}>]>;
|
|
53
|
+
readonly sourceCommitSha: Schema.String;
|
|
54
|
+
readonly coverageCellId: Schema.String;
|
|
55
|
+
readonly basisDigest: Schema.String;
|
|
56
|
+
readonly behavioralFingerprint: Schema.String;
|
|
57
|
+
readonly admissionDigest: Schema.String;
|
|
58
|
+
readonly terminalCheckpoint: Schema.Struct<{
|
|
59
|
+
readonly kind: Schema.Literal<"terminal">;
|
|
60
|
+
readonly stage: Schema.Literal<"admit">;
|
|
61
|
+
readonly createdAt: Schema.String;
|
|
62
|
+
readonly version: Schema.Literal<2>;
|
|
63
|
+
readonly checkpointId: Schema.String;
|
|
64
|
+
readonly identityDigest: Schema.String;
|
|
65
|
+
readonly attemptGeneration: Schema.Finite;
|
|
66
|
+
readonly sequence: Schema.Finite;
|
|
67
|
+
readonly loopName: Schema.optionalKey<Schema.String>;
|
|
68
|
+
readonly loopIteration: Schema.optionalKey<Schema.Finite>;
|
|
69
|
+
readonly parentDigest: Schema.String;
|
|
70
|
+
readonly payloadDigest: Schema.String;
|
|
71
|
+
readonly payloadBytes: Schema.Finite;
|
|
72
|
+
}>;
|
|
73
|
+
readonly quality: Schema.$Array<Schema.Struct<{
|
|
74
|
+
readonly axis: Schema.Literals<readonly ["authenticity", "specification-sufficiency", "oracle-adequacy", "stability", "distinctness", "realism", "leakage", "triviality", "coverage"]>;
|
|
75
|
+
readonly outcome: Schema.Literals<readonly ["pass", "fail", "review-required"]>;
|
|
76
|
+
}>>;
|
|
77
|
+
}>;
|
|
78
|
+
export type RepositoryPublicArtifactInputV1 = typeof RepositoryPublicArtifactInputV1.Type;
|
|
79
|
+
export declare const repositoryPublicArtifactPathIdV1: (caseId: string) => string;
|
|
80
|
+
export declare const RepositoryProjectedPublicArtifactV1: Schema.Struct<{
|
|
81
|
+
readonly path: Schema.String;
|
|
82
|
+
readonly kind: Schema.Literals<readonly ["eval-definition", "public-metadata"]>;
|
|
83
|
+
readonly mediaType: Schema.Literal<"application/json">;
|
|
84
|
+
readonly content: Schema.String;
|
|
85
|
+
readonly caseId: Schema.String;
|
|
86
|
+
readonly admissionDigest: Schema.String;
|
|
87
|
+
readonly publicArtifactDigest: Schema.String;
|
|
88
|
+
readonly bytes: Schema.Finite;
|
|
89
|
+
readonly visibility: Schema.Literal<"public">;
|
|
90
|
+
readonly fileType: Schema.Literal<"regular">;
|
|
91
|
+
}>;
|
|
92
|
+
export type RepositoryProjectedPublicArtifactV1 = typeof RepositoryProjectedPublicArtifactV1.Type;
|
|
93
|
+
export declare const repositoryPublicArtifactProjectionDigestV1: (projection: {
|
|
94
|
+
readonly version: 1;
|
|
95
|
+
readonly admitted: true;
|
|
96
|
+
readonly caseId: string;
|
|
97
|
+
readonly sourceCommitSha: string;
|
|
98
|
+
readonly admissionDigest: string;
|
|
99
|
+
readonly terminalCheckpointDigest: string;
|
|
100
|
+
readonly artifacts: readonly RepositoryProjectedPublicArtifactV1[];
|
|
101
|
+
}) => string;
|
|
102
|
+
export declare const RepositoryPublicArtifactProjectionV1: Schema.Struct<{
|
|
103
|
+
readonly version: Schema.Literal<1>;
|
|
104
|
+
readonly admitted: Schema.Literal<true>;
|
|
105
|
+
readonly caseId: Schema.String;
|
|
106
|
+
readonly sourceCommitSha: Schema.String;
|
|
107
|
+
readonly admissionDigest: Schema.String;
|
|
108
|
+
readonly terminalCheckpointDigest: Schema.String;
|
|
109
|
+
readonly projectionDigest: Schema.String;
|
|
110
|
+
readonly artifacts: Schema.$Array<Schema.Struct<{
|
|
111
|
+
readonly path: Schema.String;
|
|
112
|
+
readonly kind: Schema.Literals<readonly ["eval-definition", "public-metadata"]>;
|
|
113
|
+
readonly mediaType: Schema.Literal<"application/json">;
|
|
114
|
+
readonly content: Schema.String;
|
|
115
|
+
readonly caseId: Schema.String;
|
|
116
|
+
readonly admissionDigest: Schema.String;
|
|
117
|
+
readonly publicArtifactDigest: Schema.String;
|
|
118
|
+
readonly bytes: Schema.Finite;
|
|
119
|
+
readonly visibility: Schema.Literal<"public">;
|
|
120
|
+
readonly fileType: Schema.Literal<"regular">;
|
|
121
|
+
}>>;
|
|
122
|
+
}>;
|
|
123
|
+
export type RepositoryPublicArtifactProjectionV1 = typeof RepositoryPublicArtifactProjectionV1.Type;
|
|
124
|
+
export declare const decodeRepositoryPublicArtifactProjectionV1: (value: unknown) => RepositoryPublicArtifactProjectionV1;
|
|
125
|
+
/**
|
|
126
|
+
* Creates the only repository-visible representation of an admitted case.
|
|
127
|
+
*
|
|
128
|
+
* The input is an explicit strict public DTO, not a foundry result. Hidden
|
|
129
|
+
* fixtures, oracle bodies, solutions, adversaries, responses, diagnostics,
|
|
130
|
+
* credentials, and checkpoint payloads therefore have no representable field.
|
|
131
|
+
*/
|
|
132
|
+
export declare const makeRepositoryPublicArtifactProjectionV1: (value: unknown) => RepositoryPublicArtifactProjectionV1;
|
|
133
|
+
export declare const repositoryPublicArtifactVisibleTaskV1: (input: RepositoryPublicArtifactInputV1) => RepositoryCandidateVisibleTask;
|