@velum-labs/routekit-eval-setup 1.4.0 → 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 -12
- package/dist/effect-api.js +56 -7
- 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 +51 -0
- package/dist/eval-event-log.js +69 -10
- 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 -19
- package/dist/index.js +69 -12
- package/dist/inspection.js +2 -3
- package/dist/project-artifacts.d.ts +2 -2
- package/dist/project-artifacts.js +26 -121
- package/dist/project-authoring.d.ts +66 -5
- package/dist/project-authoring.js +783 -109
- package/dist/project-contracts.d.ts +292 -82
- package/dist/project-contracts.js +65 -7
- package/dist/project-store.js +2 -1
- package/dist/project-workflow.d.ts +3 -3
- package/dist/project-workflow.js +116 -18
- 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.js +34 -1
- 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 +395 -32
- 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 -7
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { Context, Effect, Layer } from "effect";
|
|
2
|
+
import { captureGitTreeSnapshotV1 } from "../../adapters/git-task-history.js";
|
|
3
|
+
import { assertRepositorySpecificationCritiqueV1 } from "../../repository-specification-critique-protocol.js";
|
|
4
|
+
const visibleText = (visible) => visible.lane === "repository-agent"
|
|
5
|
+
? [visible.requestText, ...visible.constraints].join("\n")
|
|
6
|
+
: visible.request.bodyJson;
|
|
7
|
+
const implementationDetailLanguage = /\b(?:hidden (?:grader|test)|reference (?:patch|solution)|post-change|mutation|expected answer|gold answer)\b/iu;
|
|
8
|
+
const actionableLanguage = /\b(?:fix|repair|implement|preserve|update|add|remove|change|prevent|ensure)\b/iu;
|
|
9
|
+
export class SpecificationCritic extends Context.Service()("@velum-labs/routekit-eval-setup/SpecificationCritic") {
|
|
10
|
+
}
|
|
11
|
+
export const critiqueRepositoryTaskSpecificationV1 = Effect.fn("SpecificationCritic.critique")(function* (input) {
|
|
12
|
+
const snapshot = yield* captureGitTreeSnapshotV1({
|
|
13
|
+
repositoryRoot: input.repositoryRoot,
|
|
14
|
+
requestedRef: input.seed.initialState.commit
|
|
15
|
+
});
|
|
16
|
+
const text = visibleText(input.visible);
|
|
17
|
+
const visibleEvidencePaths = [
|
|
18
|
+
...new Set(input.seed.capabilityEvidence
|
|
19
|
+
.map((evidence) => evidence.path)
|
|
20
|
+
.filter((path) => path !== undefined))
|
|
21
|
+
];
|
|
22
|
+
const unavailablePaths = visibleEvidencePaths.filter((path) => !snapshot.files.includes(path));
|
|
23
|
+
const criticalIds = new Set(input.seed.targetBehavior.filter((clause) => clause.critical).map((clause) => clause.id));
|
|
24
|
+
const reviewCoverageFindings = input.reviews.flatMap((review) => {
|
|
25
|
+
const coverage = review.criticalBehaviorCoverage;
|
|
26
|
+
if (coverage === undefined)
|
|
27
|
+
return [];
|
|
28
|
+
const ids = coverage.map((entry) => entry.behaviorId);
|
|
29
|
+
return ids.length !== criticalIds.size || new Set(ids).size !== ids.length ||
|
|
30
|
+
ids.some((id) => !criticalIds.has(id)) ||
|
|
31
|
+
coverage.some((entry) => entry.outcome !== "covered" || entry.detail.trim().length === 0)
|
|
32
|
+
? [{
|
|
33
|
+
axis: "missing-precondition",
|
|
34
|
+
severity: "blocker",
|
|
35
|
+
detail: `Reviewer ${review.reviewerId} did not establish coverage of every critical seed requirement.`
|
|
36
|
+
}]
|
|
37
|
+
: [];
|
|
38
|
+
});
|
|
39
|
+
const dimensionFindings = input.requestedDimension === undefined
|
|
40
|
+
? []
|
|
41
|
+
: input.reviews.flatMap((review) => {
|
|
42
|
+
const fit = review.dimensionFit;
|
|
43
|
+
return fit === undefined || fit.requestedDimension !== input.requestedDimension ||
|
|
44
|
+
fit.outcome !== "fit" || fit.detail.trim().length === 0 || fit.evidencePaths.length === 0 ||
|
|
45
|
+
fit.evidencePaths.some((path) => !snapshot.files.includes(path))
|
|
46
|
+
? [{
|
|
47
|
+
axis: "unsupported-assumption",
|
|
48
|
+
severity: "blocker",
|
|
49
|
+
detail: `Reviewer ${review.reviewerId} did not establish fit to requested dimension ${JSON.stringify(input.requestedDimension)}.`
|
|
50
|
+
}]
|
|
51
|
+
: [];
|
|
52
|
+
});
|
|
53
|
+
const mechanicalFindings = [
|
|
54
|
+
...reviewCoverageFindings,
|
|
55
|
+
...dimensionFindings,
|
|
56
|
+
...(text.trim().length >= 100 && actionableLanguage.test(text)
|
|
57
|
+
? []
|
|
58
|
+
: [
|
|
59
|
+
{
|
|
60
|
+
axis: "missing-precondition",
|
|
61
|
+
severity: "blocker",
|
|
62
|
+
detail: "The visible request does not contain enough actionable task context."
|
|
63
|
+
}
|
|
64
|
+
]),
|
|
65
|
+
...(input.visible.lane === input.family.lane
|
|
66
|
+
? []
|
|
67
|
+
: [
|
|
68
|
+
{
|
|
69
|
+
axis: "unsupported-assumption",
|
|
70
|
+
severity: "blocker",
|
|
71
|
+
detail: "The visible task lane does not match its task family."
|
|
72
|
+
}
|
|
73
|
+
]),
|
|
74
|
+
...(input.visible.lane !== "repository-agent" ||
|
|
75
|
+
input.visible.checkoutCommit === input.seed.initialState.commit
|
|
76
|
+
? []
|
|
77
|
+
: [
|
|
78
|
+
{
|
|
79
|
+
axis: "unsupported-assumption",
|
|
80
|
+
severity: "blocker",
|
|
81
|
+
detail: "The repository-agent task does not expose the replay-qualified pre-task checkout."
|
|
82
|
+
}
|
|
83
|
+
]),
|
|
84
|
+
...(input.family.seedIds.includes(input.seed.id)
|
|
85
|
+
? []
|
|
86
|
+
: [
|
|
87
|
+
{
|
|
88
|
+
axis: "unsupported-assumption",
|
|
89
|
+
severity: "blocker",
|
|
90
|
+
detail: "The task family does not contain the task seed."
|
|
91
|
+
}
|
|
92
|
+
]),
|
|
93
|
+
...(unavailablePaths.length === 0
|
|
94
|
+
? []
|
|
95
|
+
: [
|
|
96
|
+
{
|
|
97
|
+
axis: "unavailable-context",
|
|
98
|
+
severity: "blocker",
|
|
99
|
+
detail: `The pre-task checkout does not contain referenced paths: ${unavailablePaths.join(", ")}`
|
|
100
|
+
}
|
|
101
|
+
]),
|
|
102
|
+
...(input.seed.referenceCommit === undefined ||
|
|
103
|
+
!text.includes(input.seed.referenceCommit)
|
|
104
|
+
? []
|
|
105
|
+
: [
|
|
106
|
+
{
|
|
107
|
+
axis: "hidden-answer-leakage",
|
|
108
|
+
severity: "blocker",
|
|
109
|
+
detail: "The visible task contains the post-change commit."
|
|
110
|
+
}
|
|
111
|
+
]),
|
|
112
|
+
...(implementationDetailLanguage.test(text)
|
|
113
|
+
? [
|
|
114
|
+
{
|
|
115
|
+
axis: "unrealistic-phrasing",
|
|
116
|
+
severity: "blocker",
|
|
117
|
+
detail: "The visible task uses evaluation-only or hidden-answer terminology."
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
: []),
|
|
121
|
+
...input.seed.targetBehavior.flatMap((clause) => clause.critical &&
|
|
122
|
+
!text.toLowerCase().includes(clause.description.toLowerCase()) &&
|
|
123
|
+
input.reviews.filter((review) => review.independentlyProduced &&
|
|
124
|
+
review.criticalBehaviorCoverage?.some((entry) => entry.behaviorId === clause.id &&
|
|
125
|
+
entry.outcome === "covered" && entry.detail.trim().length > 0)).length < 2
|
|
126
|
+
? [
|
|
127
|
+
{
|
|
128
|
+
axis: "multiple-interpretations",
|
|
129
|
+
severity: "blocker",
|
|
130
|
+
detail: `Critical behavior is neither stated directly nor independently established in the request: ${clause.description}`
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
: [])
|
|
134
|
+
];
|
|
135
|
+
const independentApprovalCount = input.reviews.filter((review) => review.independentlyProduced && review.verdict === "sufficient").length;
|
|
136
|
+
const blocker = mechanicalFindings.some((finding) => finding.severity === "blocker") ||
|
|
137
|
+
input.reviews.some((review) => review.verdict === "insufficient" ||
|
|
138
|
+
review.findings.some((finding) => finding.severity === "blocker"));
|
|
139
|
+
const outcome = blocker
|
|
140
|
+
? "fail"
|
|
141
|
+
: independentApprovalCount >= 2
|
|
142
|
+
? "pass"
|
|
143
|
+
: "review-required";
|
|
144
|
+
const rejectionReasons = [
|
|
145
|
+
...mechanicalFindings
|
|
146
|
+
.filter((finding) => finding.severity === "blocker")
|
|
147
|
+
.map((finding) => `${finding.axis}: ${finding.detail}`),
|
|
148
|
+
...input.reviews
|
|
149
|
+
.filter((review) => review.verdict === "insufficient")
|
|
150
|
+
.map((review) => `reviewer ${JSON.stringify(review.reviewerId)} found the task insufficient: ${review.detail}`),
|
|
151
|
+
...(blocker || independentApprovalCount >= 2
|
|
152
|
+
? []
|
|
153
|
+
: [
|
|
154
|
+
`only ${String(independentApprovalCount)} independent reviewers found the task sufficiently specified; two are required`
|
|
155
|
+
])
|
|
156
|
+
];
|
|
157
|
+
const critique = {
|
|
158
|
+
version: 1,
|
|
159
|
+
caseId: input.visible.id,
|
|
160
|
+
outcome,
|
|
161
|
+
mechanicalFindings,
|
|
162
|
+
reviews: input.reviews,
|
|
163
|
+
independentApprovalCount,
|
|
164
|
+
rejectionReasons
|
|
165
|
+
};
|
|
166
|
+
assertRepositorySpecificationCritiqueV1(critique);
|
|
167
|
+
return critique;
|
|
168
|
+
});
|
|
169
|
+
export const makeSpecificationCritic = Effect.succeed(SpecificationCritic.of({
|
|
170
|
+
critique: critiqueRepositoryTaskSpecificationV1
|
|
171
|
+
}));
|
|
172
|
+
export const SpecificationCriticLive = Layer.effect(SpecificationCritic, makeSpecificationCritic);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Context, Effect, Layer } from "effect";
|
|
2
|
+
import type { RepositoryBehaviorMapV1 } from "../../repository-behavior-protocol.js";
|
|
3
|
+
import { type RepositoryTaskFamilyV1 } from "../../repository-task-family-protocol.js";
|
|
4
|
+
import type { RepositoryTaskSeedV1 } from "../../repository-task-seed-protocol.js";
|
|
5
|
+
export type TaskFamilyShape = {
|
|
6
|
+
readonly derive: (input: {
|
|
7
|
+
readonly map: RepositoryBehaviorMapV1;
|
|
8
|
+
readonly seeds: readonly RepositoryTaskSeedV1[];
|
|
9
|
+
}) => Effect.Effect<readonly RepositoryTaskFamilyV1[]>;
|
|
10
|
+
};
|
|
11
|
+
declare const TaskFamily_base: Context.ServiceClass<TaskFamily, "@velum-labs/routekit-eval-setup/TaskFamily", TaskFamilyShape>;
|
|
12
|
+
export declare class TaskFamily extends TaskFamily_base {
|
|
13
|
+
}
|
|
14
|
+
export declare const deriveRepositoryTaskFamiliesV1: (input: {
|
|
15
|
+
readonly map: RepositoryBehaviorMapV1;
|
|
16
|
+
readonly seeds: readonly RepositoryTaskSeedV1[];
|
|
17
|
+
}) => Effect.Effect<{
|
|
18
|
+
readonly version: 1;
|
|
19
|
+
readonly id: string;
|
|
20
|
+
readonly capabilityId: string;
|
|
21
|
+
readonly jobStatement: string;
|
|
22
|
+
readonly lane: "request" | "repository-agent";
|
|
23
|
+
readonly seedIds: readonly string[];
|
|
24
|
+
readonly inputStateFacets: readonly string[];
|
|
25
|
+
readonly requestedChangeFacets: readonly string[];
|
|
26
|
+
readonly observableFacets: readonly string[];
|
|
27
|
+
readonly admissibleSolutionPolicy: "behavior-equivalent" | "behavior-and-structure" | "exact-artifact";
|
|
28
|
+
readonly fixtureAxes: readonly string[];
|
|
29
|
+
readonly adversaryFamilies: readonly string[];
|
|
30
|
+
readonly excludedNearMisses: readonly string[];
|
|
31
|
+
readonly repositoryCoverage: readonly {
|
|
32
|
+
readonly kind: "symbol" | "package" | "public-surface" | "protocol" | "schema" | "test" | "command" | "history-episode" | "workload-signal" | "documentation";
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly path?: string | undefined;
|
|
35
|
+
}[];
|
|
36
|
+
readonly confidence: "high" | "medium" | "review-required";
|
|
37
|
+
}[], never, never>;
|
|
38
|
+
export declare const makeTaskFamily: Effect.Effect<TaskFamilyShape, never, never>;
|
|
39
|
+
export declare const TaskFamilyLive: Layer.Layer<TaskFamily, never, never>;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Context, Effect, Layer } from "effect";
|
|
2
|
+
import { assertRepositoryTaskFamilyV1 } from "../../repository-task-family-protocol.js";
|
|
3
|
+
const slug = (value) => value
|
|
4
|
+
.normalize("NFKC")
|
|
5
|
+
.toLowerCase()
|
|
6
|
+
.replace(/[^a-z0-9]+/gu, "-")
|
|
7
|
+
.replace(/^-|-$/gu, "")
|
|
8
|
+
.slice(0, 80);
|
|
9
|
+
const episodeId = (seed) => seed.source.kind === "historical-fix" ||
|
|
10
|
+
seed.source.kind === "historical-feature" ||
|
|
11
|
+
seed.source.kind === "historical-refactor"
|
|
12
|
+
? seed.source.changeEpisodeId
|
|
13
|
+
: undefined;
|
|
14
|
+
export class TaskFamily extends Context.Service()("@velum-labs/routekit-eval-setup/TaskFamily") {
|
|
15
|
+
}
|
|
16
|
+
export const deriveRepositoryTaskFamiliesV1 = Effect.fn("TaskFamily.derive")(function* (input) {
|
|
17
|
+
const qualified = input.seeds.filter((seed) => seed.status === "qualified");
|
|
18
|
+
const families = qualified.map((seed) => {
|
|
19
|
+
const sourceEpisodeId = episodeId(seed);
|
|
20
|
+
const signal = input.map.workloadSignals.find((entry) => sourceEpisodeId !== undefined &&
|
|
21
|
+
entry.episodeIds.includes(sourceEpisodeId));
|
|
22
|
+
const capabilityId = signal === undefined
|
|
23
|
+
? `capability-${slug(seed.summary)}`
|
|
24
|
+
: `capability-${slug(signal.label)}`;
|
|
25
|
+
const family = {
|
|
26
|
+
version: 1,
|
|
27
|
+
id: `family-${slug(seed.summary)}`,
|
|
28
|
+
capabilityId,
|
|
29
|
+
jobStatement: seed.summary,
|
|
30
|
+
lane: "repository-agent",
|
|
31
|
+
seedIds: [seed.id],
|
|
32
|
+
inputStateFacets: ["historical-pre-change-checkout"],
|
|
33
|
+
requestedChangeFacets: ["repair-observed-regression"],
|
|
34
|
+
observableFacets: seed.targetBehavior.map((clause) => clause.description),
|
|
35
|
+
admissibleSolutionPolicy: "behavior-equivalent",
|
|
36
|
+
fixtureAxes: ["historical-failing-state"],
|
|
37
|
+
adversaryFamilies: [
|
|
38
|
+
"historical-defect",
|
|
39
|
+
"partial-fix",
|
|
40
|
+
"integration-near-miss"
|
|
41
|
+
],
|
|
42
|
+
excludedNearMisses: [
|
|
43
|
+
"documentation-only response",
|
|
44
|
+
"test-only expectation weakening"
|
|
45
|
+
],
|
|
46
|
+
repositoryCoverage: seed.capabilityEvidence,
|
|
47
|
+
confidence: seed.confidence
|
|
48
|
+
};
|
|
49
|
+
assertRepositoryTaskFamilyV1(family);
|
|
50
|
+
return family;
|
|
51
|
+
});
|
|
52
|
+
return families;
|
|
53
|
+
});
|
|
54
|
+
export const makeTaskFamily = Effect.succeed(TaskFamily.of({ derive: deriveRepositoryTaskFamiliesV1 }));
|
|
55
|
+
export const TaskFamilyLive = Layer.effect(TaskFamily, makeTaskFamily);
|