ppef 1.0.0 → 1.1.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/README.md +172 -0
- package/bin/ppef.mjs +20 -0
- package/dist/__tests__/framework-pipeline.integration.test.d.ts +7 -0
- package/dist/__tests__/framework-pipeline.integration.test.d.ts.map +1 -0
- package/dist/__tests__/framework-pipeline.integration.test.js +415 -0
- package/dist/__tests__/framework-pipeline.integration.test.js.map +1 -0
- package/dist/__tests__/index-exports.unit.test.d.ts +8 -0
- package/dist/__tests__/index-exports.unit.test.d.ts.map +1 -0
- package/dist/__tests__/index-exports.unit.test.js +127 -0
- package/dist/__tests__/index-exports.unit.test.js.map +1 -0
- package/dist/__tests__/registry-executor.integration.test.d.ts +5 -0
- package/dist/__tests__/registry-executor.integration.test.d.ts.map +1 -0
- package/dist/__tests__/registry-executor.integration.test.js +352 -0
- package/dist/__tests__/registry-executor.integration.test.js.map +1 -0
- package/dist/__tests__/test-helpers.d.ts +94 -0
- package/dist/__tests__/test-helpers.d.ts.map +1 -0
- package/dist/__tests__/test-helpers.js +271 -0
- package/dist/__tests__/test-helpers.js.map +1 -0
- package/dist/aggregation/__tests__/aggregators.unit.test.d.ts +7 -0
- package/dist/aggregation/__tests__/aggregators.unit.test.d.ts.map +1 -0
- package/dist/aggregation/__tests__/aggregators.unit.test.js +350 -0
- package/dist/aggregation/__tests__/aggregators.unit.test.js.map +1 -0
- package/dist/aggregation/__tests__/pipeline.unit.test.d.ts +7 -0
- package/dist/aggregation/__tests__/pipeline.unit.test.d.ts.map +1 -0
- package/dist/aggregation/__tests__/pipeline.unit.test.js +213 -0
- package/dist/aggregation/__tests__/pipeline.unit.test.js.map +1 -0
- package/dist/aggregation/aggregators.d.ts +63 -0
- package/dist/aggregation/aggregators.d.ts.map +1 -0
- package/dist/aggregation/aggregators.js +228 -0
- package/dist/aggregation/aggregators.js.map +1 -0
- package/dist/aggregation/index.d.ts +8 -0
- package/dist/aggregation/index.d.ts.map +1 -0
- package/dist/aggregation/index.js +8 -0
- package/dist/aggregation/index.js.map +1 -0
- package/dist/aggregation/pipeline.d.ts +38 -0
- package/dist/aggregation/pipeline.d.ts.map +1 -0
- package/dist/aggregation/pipeline.js +198 -0
- package/dist/aggregation/pipeline.js.map +1 -0
- package/dist/claims/__tests__/evaluator.unit.test.d.ts +12 -0
- package/dist/claims/__tests__/evaluator.unit.test.d.ts.map +1 -0
- package/dist/claims/__tests__/evaluator.unit.test.js +801 -0
- package/dist/claims/__tests__/evaluator.unit.test.js.map +1 -0
- package/dist/claims/evaluator.d.ts +33 -0
- package/dist/claims/evaluator.d.ts.map +1 -0
- package/dist/claims/evaluator.js +174 -0
- package/dist/claims/evaluator.js.map +1 -0
- package/dist/claims/index.d.ts +7 -0
- package/dist/claims/index.d.ts.map +1 -0
- package/dist/claims/index.js +7 -0
- package/dist/claims/index.js.map +1 -0
- package/dist/cli/__tests__/aggregate.command.unit.test.d.ts +7 -0
- package/dist/cli/__tests__/aggregate.command.unit.test.d.ts.map +1 -0
- package/dist/cli/__tests__/aggregate.command.unit.test.js +396 -0
- package/dist/cli/__tests__/aggregate.command.unit.test.js.map +1 -0
- package/dist/cli/__tests__/commands.unit.test.d.ts +10 -0
- package/dist/cli/__tests__/commands.unit.test.d.ts.map +1 -0
- package/dist/cli/__tests__/commands.unit.test.js +217 -0
- package/dist/cli/__tests__/commands.unit.test.js.map +1 -0
- package/dist/cli/__tests__/index.unit.test.d.ts +10 -0
- package/dist/cli/__tests__/index.unit.test.d.ts.map +1 -0
- package/dist/cli/__tests__/index.unit.test.js +65 -0
- package/dist/cli/__tests__/index.unit.test.js.map +1 -0
- package/dist/cli/__tests__/logger.unit.test.d.ts +11 -0
- package/dist/cli/__tests__/logger.unit.test.d.ts.map +1 -0
- package/dist/cli/__tests__/logger.unit.test.js +180 -0
- package/dist/cli/__tests__/logger.unit.test.js.map +1 -0
- package/dist/cli/__tests__/module-loader.unit.test.d.ts +11 -0
- package/dist/cli/__tests__/module-loader.unit.test.d.ts.map +1 -0
- package/dist/cli/__tests__/module-loader.unit.test.js +262 -0
- package/dist/cli/__tests__/module-loader.unit.test.js.map +1 -0
- package/dist/cli/__tests__/output-writer.unit.test.d.ts +10 -0
- package/dist/cli/__tests__/output-writer.unit.test.d.ts.map +1 -0
- package/dist/cli/__tests__/output-writer.unit.test.js +216 -0
- package/dist/cli/__tests__/output-writer.unit.test.js.map +1 -0
- package/dist/cli/__tests__/plan.command.unit.test.d.ts +7 -0
- package/dist/cli/__tests__/plan.command.unit.test.d.ts.map +1 -0
- package/dist/cli/__tests__/plan.command.unit.test.js +289 -0
- package/dist/cli/__tests__/plan.command.unit.test.js.map +1 -0
- package/dist/cli/__tests__/run.command.unit.test.d.ts +7 -0
- package/dist/cli/__tests__/run.command.unit.test.d.ts.map +1 -0
- package/dist/cli/__tests__/run.command.unit.test.js +422 -0
- package/dist/cli/__tests__/run.command.unit.test.js.map +1 -0
- package/dist/cli/__tests__/validate.command.unit.test.d.ts +7 -0
- package/dist/cli/__tests__/validate.command.unit.test.d.ts.map +1 -0
- package/dist/cli/__tests__/validate.command.unit.test.js +226 -0
- package/dist/cli/__tests__/validate.command.unit.test.js.map +1 -0
- package/dist/cli/command-deps.d.ts +125 -0
- package/dist/cli/command-deps.d.ts.map +1 -0
- package/dist/cli/command-deps.js +7 -0
- package/dist/cli/command-deps.js.map +1 -0
- package/dist/cli/commands/aggregate.d.ts +35 -0
- package/dist/cli/commands/aggregate.d.ts.map +1 -0
- package/dist/cli/commands/aggregate.js +121 -0
- package/dist/cli/commands/aggregate.js.map +1 -0
- package/dist/cli/commands/plan.d.ts +36 -0
- package/dist/cli/commands/plan.d.ts.map +1 -0
- package/dist/cli/commands/plan.js +109 -0
- package/dist/cli/commands/plan.js.map +1 -0
- package/dist/cli/commands/run.d.ts +33 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +185 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +27 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +88 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/config-loader.d.ts +30 -0
- package/dist/cli/config-loader.d.ts.map +1 -0
- package/dist/cli/config-loader.js +181 -0
- package/dist/cli/config-loader.js.map +1 -0
- package/dist/cli/index.d.ts +26 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +58 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/logger.d.ts +75 -0
- package/dist/cli/logger.d.ts.map +1 -0
- package/dist/cli/logger.js +131 -0
- package/dist/cli/logger.js.map +1 -0
- package/dist/cli/module-loader.d.ts +46 -0
- package/dist/cli/module-loader.d.ts.map +1 -0
- package/dist/cli/module-loader.js +116 -0
- package/dist/cli/module-loader.js.map +1 -0
- package/dist/cli/output-writer.d.ts +51 -0
- package/dist/cli/output-writer.d.ts.map +1 -0
- package/dist/cli/output-writer.js +65 -0
- package/dist/cli/output-writer.js.map +1 -0
- package/dist/cli/types.d.ts +174 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +7 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/collector/__tests__/result-collector.unit.test.d.ts +7 -0
- package/dist/collector/__tests__/result-collector.unit.test.d.ts.map +1 -0
- package/dist/collector/__tests__/result-collector.unit.test.js +1021 -0
- package/dist/collector/__tests__/result-collector.unit.test.js.map +1 -0
- package/dist/collector/__tests__/schema.unit.test.d.ts +7 -0
- package/dist/collector/__tests__/schema.unit.test.d.ts.map +1 -0
- package/dist/collector/__tests__/schema.unit.test.js +360 -0
- package/dist/collector/__tests__/schema.unit.test.js.map +1 -0
- package/dist/collector/index.d.ts +8 -0
- package/dist/collector/index.d.ts.map +1 -0
- package/dist/collector/index.js +8 -0
- package/dist/collector/index.js.map +1 -0
- package/dist/collector/result-collector.d.ts +159 -0
- package/dist/collector/result-collector.d.ts.map +1 -0
- package/dist/collector/result-collector.js +213 -0
- package/dist/collector/result-collector.js.map +1 -0
- package/dist/collector/schema.d.ts +34 -0
- package/dist/collector/schema.d.ts.map +1 -0
- package/dist/collector/schema.js +145 -0
- package/dist/collector/schema.js.map +1 -0
- package/dist/executor/__tests__/checkpoint-hash-bug.diagnostic.test.d.ts +10 -0
- package/dist/executor/__tests__/checkpoint-hash-bug.diagnostic.test.d.ts.map +1 -0
- package/dist/executor/__tests__/checkpoint-hash-bug.diagnostic.test.js +122 -0
- package/dist/executor/__tests__/checkpoint-hash-bug.diagnostic.test.js.map +1 -0
- package/dist/executor/__tests__/checkpoint-manager.integration.test.d.ts +7 -0
- package/dist/executor/__tests__/checkpoint-manager.integration.test.d.ts.map +1 -0
- package/dist/executor/__tests__/checkpoint-manager.integration.test.js +330 -0
- package/dist/executor/__tests__/checkpoint-manager.integration.test.js.map +1 -0
- package/dist/executor/__tests__/checkpoint-manager.unit.test.d.ts +7 -0
- package/dist/executor/__tests__/checkpoint-manager.unit.test.d.ts.map +1 -0
- package/dist/executor/__tests__/checkpoint-manager.unit.test.js +531 -0
- package/dist/executor/__tests__/checkpoint-manager.unit.test.js.map +1 -0
- package/dist/executor/__tests__/checkpoint-merge-bug.diagnostic.test.d.ts +8 -0
- package/dist/executor/__tests__/checkpoint-merge-bug.diagnostic.test.d.ts.map +1 -0
- package/dist/executor/__tests__/checkpoint-merge-bug.diagnostic.test.js +493 -0
- package/dist/executor/__tests__/checkpoint-merge-bug.diagnostic.test.js.map +1 -0
- package/dist/executor/__tests__/checkpoint-merge-bug.unit.test.d.ts +8 -0
- package/dist/executor/__tests__/checkpoint-merge-bug.unit.test.d.ts.map +1 -0
- package/dist/executor/__tests__/checkpoint-merge-bug.unit.test.js +164 -0
- package/dist/executor/__tests__/checkpoint-merge-bug.unit.test.js.map +1 -0
- package/dist/executor/__tests__/checkpoint-storage.unit.test.d.ts +7 -0
- package/dist/executor/__tests__/checkpoint-storage.unit.test.d.ts.map +1 -0
- package/dist/executor/__tests__/checkpoint-storage.unit.test.js +490 -0
- package/dist/executor/__tests__/checkpoint-storage.unit.test.js.map +1 -0
- package/dist/executor/__tests__/executor.unit.test.d.ts +7 -0
- package/dist/executor/__tests__/executor.unit.test.d.ts.map +1 -0
- package/dist/executor/__tests__/executor.unit.test.js +202 -0
- package/dist/executor/__tests__/executor.unit.test.js.map +1 -0
- package/dist/executor/__tests__/memory-monitor.unit.test.d.ts +7 -0
- package/dist/executor/__tests__/memory-monitor.unit.test.d.ts.map +1 -0
- package/dist/executor/__tests__/memory-monitor.unit.test.js +285 -0
- package/dist/executor/__tests__/memory-monitor.unit.test.js.map +1 -0
- package/dist/executor/__tests__/parallel-checkpoint-merge.integration.test.d.ts +12 -0
- package/dist/executor/__tests__/parallel-checkpoint-merge.integration.test.d.ts.map +1 -0
- package/dist/executor/__tests__/parallel-checkpoint-merge.integration.test.js +196 -0
- package/dist/executor/__tests__/parallel-checkpoint-merge.integration.test.js.map +1 -0
- package/dist/executor/__tests__/parallel-executor.integration.test.d.ts +7 -0
- package/dist/executor/__tests__/parallel-executor.integration.test.d.ts.map +1 -0
- package/dist/executor/__tests__/parallel-executor.integration.test.js +249 -0
- package/dist/executor/__tests__/parallel-executor.integration.test.js.map +1 -0
- package/dist/executor/__tests__/parallel-executor.unit.test.d.ts +8 -0
- package/dist/executor/__tests__/parallel-executor.unit.test.d.ts.map +1 -0
- package/dist/executor/__tests__/parallel-executor.unit.test.js +473 -0
- package/dist/executor/__tests__/parallel-executor.unit.test.js.map +1 -0
- package/dist/executor/__tests__/run-id.unit.test.d.ts +8 -0
- package/dist/executor/__tests__/run-id.unit.test.d.ts.map +1 -0
- package/dist/executor/__tests__/run-id.unit.test.js +156 -0
- package/dist/executor/__tests__/run-id.unit.test.js.map +1 -0
- package/dist/executor/__tests__/worker-entry.integration.test.d.ts +24 -0
- package/dist/executor/__tests__/worker-entry.integration.test.d.ts.map +1 -0
- package/dist/executor/__tests__/worker-entry.integration.test.js +82 -0
- package/dist/executor/__tests__/worker-entry.integration.test.js.map +1 -0
- package/dist/executor/__tests__/worker-entry.unit.test.d.ts +7 -0
- package/dist/executor/__tests__/worker-entry.unit.test.d.ts.map +1 -0
- package/dist/executor/__tests__/worker-entry.unit.test.js +364 -0
- package/dist/executor/__tests__/worker-entry.unit.test.js.map +1 -0
- package/dist/executor/checkpoint-manager.d.ts +231 -0
- package/dist/executor/checkpoint-manager.d.ts.map +1 -0
- package/dist/executor/checkpoint-manager.js +395 -0
- package/dist/executor/checkpoint-manager.js.map +1 -0
- package/dist/executor/checkpoint-storage.d.ts +230 -0
- package/dist/executor/checkpoint-storage.d.ts.map +1 -0
- package/dist/executor/checkpoint-storage.js +370 -0
- package/dist/executor/checkpoint-storage.js.map +1 -0
- package/dist/executor/checkpoint-types.d.ts +48 -0
- package/dist/executor/checkpoint-types.d.ts.map +1 -0
- package/dist/executor/checkpoint-types.js +8 -0
- package/dist/executor/checkpoint-types.js.map +1 -0
- package/dist/executor/executor.d.ts +164 -0
- package/dist/executor/executor.d.ts.map +1 -0
- package/dist/executor/executor.js +408 -0
- package/dist/executor/executor.js.map +1 -0
- package/dist/executor/index.d.ts +11 -0
- package/dist/executor/index.d.ts.map +1 -0
- package/dist/executor/index.js +11 -0
- package/dist/executor/index.js.map +1 -0
- package/dist/executor/memory-monitor.d.ts +115 -0
- package/dist/executor/memory-monitor.d.ts.map +1 -0
- package/dist/executor/memory-monitor.js +168 -0
- package/dist/executor/memory-monitor.js.map +1 -0
- package/dist/executor/parallel-executor.d.ts +239 -0
- package/dist/executor/parallel-executor.d.ts.map +1 -0
- package/dist/executor/parallel-executor.js +329 -0
- package/dist/executor/parallel-executor.js.map +1 -0
- package/dist/executor/run-id.d.ts +71 -0
- package/dist/executor/run-id.d.ts.map +1 -0
- package/dist/executor/run-id.js +74 -0
- package/dist/executor/run-id.js.map +1 -0
- package/dist/executor/worker-entry.d.ts +10 -0
- package/dist/executor/worker-entry.d.ts.map +1 -0
- package/dist/executor/worker-entry.js +42 -0
- package/dist/executor/worker-entry.js.map +1 -0
- package/dist/executor/worker-executor.d.ts +156 -0
- package/dist/executor/worker-executor.d.ts.map +1 -0
- package/dist/executor/worker-executor.js +88 -0
- package/dist/executor/worker-executor.js.map +1 -0
- package/dist/index.cjs +11 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/registry/case-registry.d.ts +113 -0
- package/dist/registry/case-registry.d.ts.map +1 -0
- package/dist/registry/case-registry.js +160 -0
- package/dist/registry/case-registry.js.map +1 -0
- package/dist/registry/index.d.ts +8 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +8 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/sut-registry.d.ts +96 -0
- package/dist/registry/sut-registry.d.ts.map +1 -0
- package/dist/registry/sut-registry.js +126 -0
- package/dist/registry/sut-registry.js.map +1 -0
- package/dist/renderers/index.d.ts +10 -0
- package/dist/renderers/index.d.ts.map +1 -0
- package/dist/renderers/index.js +9 -0
- package/dist/renderers/index.js.map +1 -0
- package/dist/renderers/latex-renderer.d.ts +84 -0
- package/dist/renderers/latex-renderer.d.ts.map +1 -0
- package/dist/renderers/latex-renderer.js +208 -0
- package/dist/renderers/latex-renderer.js.map +1 -0
- package/dist/renderers/types.d.ts +106 -0
- package/dist/renderers/types.d.ts.map +1 -0
- package/dist/renderers/types.js +23 -0
- package/dist/renderers/types.js.map +1 -0
- package/dist/robustness/__tests__/analyzer.unit.test.d.ts +11 -0
- package/dist/robustness/__tests__/analyzer.unit.test.d.ts.map +1 -0
- package/dist/robustness/__tests__/analyzer.unit.test.js +455 -0
- package/dist/robustness/__tests__/analyzer.unit.test.js.map +1 -0
- package/dist/robustness/__tests__/perturbations.unit.test.d.ts +11 -0
- package/dist/robustness/__tests__/perturbations.unit.test.d.ts.map +1 -0
- package/dist/robustness/__tests__/perturbations.unit.test.js +284 -0
- package/dist/robustness/__tests__/perturbations.unit.test.js.map +1 -0
- package/dist/robustness/analyzer.d.ts +61 -0
- package/dist/robustness/analyzer.d.ts.map +1 -0
- package/dist/robustness/analyzer.js +191 -0
- package/dist/robustness/analyzer.js.map +1 -0
- package/dist/robustness/index.d.ts +8 -0
- package/dist/robustness/index.d.ts.map +1 -0
- package/dist/robustness/index.js +8 -0
- package/dist/robustness/index.js.map +1 -0
- package/dist/robustness/perturbations.d.ts +46 -0
- package/dist/robustness/perturbations.d.ts.map +1 -0
- package/dist/robustness/perturbations.js +184 -0
- package/dist/robustness/perturbations.js.map +1 -0
- package/dist/statistical/__tests__/mann-whitney-u.unit.test.d.ts +7 -0
- package/dist/statistical/__tests__/mann-whitney-u.unit.test.d.ts.map +1 -0
- package/dist/statistical/__tests__/mann-whitney-u.unit.test.js +185 -0
- package/dist/statistical/__tests__/mann-whitney-u.unit.test.js.map +1 -0
- package/dist/statistical/index.d.ts +8 -0
- package/dist/statistical/index.d.ts.map +1 -0
- package/dist/statistical/index.js +8 -0
- package/dist/statistical/index.js.map +1 -0
- package/dist/statistical/mann-whitney-u.d.ts +62 -0
- package/dist/statistical/mann-whitney-u.d.ts.map +1 -0
- package/dist/statistical/mann-whitney-u.js +127 -0
- package/dist/statistical/mann-whitney-u.js.map +1 -0
- package/dist/types/aggregate.d.ts +124 -0
- package/dist/types/aggregate.d.ts.map +1 -0
- package/dist/types/aggregate.js +9 -0
- package/dist/types/aggregate.js.map +1 -0
- package/dist/types/case.d.ts +105 -0
- package/dist/types/case.d.ts.map +1 -0
- package/dist/types/case.js +10 -0
- package/dist/types/case.js.map +1 -0
- package/dist/types/claims.d.ts +122 -0
- package/dist/types/claims.d.ts.map +1 -0
- package/dist/types/claims.js +14 -0
- package/dist/types/claims.js.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/perturbation.d.ts +105 -0
- package/dist/types/perturbation.d.ts.map +1 -0
- package/dist/types/perturbation.js +9 -0
- package/dist/types/perturbation.js.map +1 -0
- package/dist/types/result.d.ts +150 -0
- package/dist/types/result.d.ts.map +1 -0
- package/dist/types/result.js +12 -0
- package/dist/types/result.js.map +1 -0
- package/dist/types/sut.d.ts +128 -0
- package/dist/types/sut.d.ts.map +1 -0
- package/dist/types/sut.js +12 -0
- package/dist/types/sut.js.map +1 -0
- package/package.json +290 -7
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkerExecutor - Core worker logic with dependency injection.
|
|
3
|
+
*
|
|
4
|
+
* This class can be tested by injecting mock dependencies,
|
|
5
|
+
* while worker-entry.ts provides real implementations.
|
|
6
|
+
*/
|
|
7
|
+
import type { EvaluationResult } from "../types/result.js";
|
|
8
|
+
/**
|
|
9
|
+
* Type definition for a single run configuration
|
|
10
|
+
*/
|
|
11
|
+
export interface RunConfig {
|
|
12
|
+
runId: string;
|
|
13
|
+
sutId: string;
|
|
14
|
+
caseId: string;
|
|
15
|
+
repetition: number;
|
|
16
|
+
config: unknown;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Type definition for executor configuration
|
|
20
|
+
*/
|
|
21
|
+
export interface ExecutorConfig {
|
|
22
|
+
repetitions: number;
|
|
23
|
+
seedBase: number;
|
|
24
|
+
continueOnError: boolean;
|
|
25
|
+
timeoutMs: number;
|
|
26
|
+
collectProvenance: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Type definition for message sent to worker
|
|
30
|
+
*/
|
|
31
|
+
export interface WorkerMessage {
|
|
32
|
+
runs: RunConfig[];
|
|
33
|
+
config: ExecutorConfig;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Type definition for worker response
|
|
37
|
+
*/
|
|
38
|
+
export interface WorkerResponse {
|
|
39
|
+
results: EvaluationResult[];
|
|
40
|
+
errors: {
|
|
41
|
+
runId: string;
|
|
42
|
+
error: string;
|
|
43
|
+
}[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Type definition for successful response message
|
|
47
|
+
*/
|
|
48
|
+
export interface WorkerSuccessMessage {
|
|
49
|
+
type: "done";
|
|
50
|
+
results: EvaluationResult[];
|
|
51
|
+
errors: {
|
|
52
|
+
runId: string;
|
|
53
|
+
error: string;
|
|
54
|
+
}[];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Type definition for error response message
|
|
58
|
+
*/
|
|
59
|
+
export interface WorkerErrorMessage {
|
|
60
|
+
type: "error";
|
|
61
|
+
error: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Type definition for any worker message
|
|
65
|
+
*/
|
|
66
|
+
export type WorkerOutputMessage = WorkerSuccessMessage | WorkerErrorMessage;
|
|
67
|
+
/**
|
|
68
|
+
* Interface for parent port communication
|
|
69
|
+
*/
|
|
70
|
+
export interface IParentPort {
|
|
71
|
+
on(event: string, listener: (data: unknown) => void): void;
|
|
72
|
+
postMessage(message: unknown): void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Interface for dynamically loaded executor module
|
|
76
|
+
*/
|
|
77
|
+
export interface IExecutorModule {
|
|
78
|
+
Executor: new (config: ExecutorConfig) => {
|
|
79
|
+
execute(suts: unknown, cases: unknown, callback: () => unknown): Promise<{
|
|
80
|
+
results: EvaluationResult[];
|
|
81
|
+
errors: {
|
|
82
|
+
runId: string;
|
|
83
|
+
error: string;
|
|
84
|
+
}[];
|
|
85
|
+
}>;
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Interface for dynamically loaded evaluate module
|
|
90
|
+
*/
|
|
91
|
+
export interface IEvaluateModule {
|
|
92
|
+
getSutDefinitions(registry: ISutRegistry): unknown;
|
|
93
|
+
getCaseDefinitions(registry: unknown): unknown;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Interface for SUT registry
|
|
97
|
+
*/
|
|
98
|
+
export interface ISutRegistry {
|
|
99
|
+
list(): string[];
|
|
100
|
+
getFactory(id: string): unknown;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Interface for dynamically loaded registry module
|
|
104
|
+
*/
|
|
105
|
+
export interface IRegistryModule {
|
|
106
|
+
registerAllBenchmarkCases(): Promise<unknown>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Interface for dynamically loaded SUTs module
|
|
110
|
+
*/
|
|
111
|
+
export interface ISutsModule {
|
|
112
|
+
registerAllSuts(): void;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Interface for dynamically loaded datasets module
|
|
116
|
+
*/
|
|
117
|
+
export interface IDatasetsModule {
|
|
118
|
+
registerBenchmarkDatasets(): Promise<void>;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Interface for module loader
|
|
122
|
+
*/
|
|
123
|
+
export interface IModuleLoader {
|
|
124
|
+
loadExecutor(): Promise<IExecutorModule>;
|
|
125
|
+
loadEvaluate(): Promise<IEvaluateModule>;
|
|
126
|
+
loadRegistry(): Promise<IRegistryModule>;
|
|
127
|
+
loadSuts(): Promise<ISutsModule>;
|
|
128
|
+
loadDatasets(): Promise<IDatasetsModule>;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* WorkerExecutor - Core worker execution logic with injected dependencies.
|
|
132
|
+
*/
|
|
133
|
+
export declare class WorkerExecutor {
|
|
134
|
+
private readonly parentPort;
|
|
135
|
+
private readonly moduleLoader;
|
|
136
|
+
/**
|
|
137
|
+
* Create a new WorkerExecutor with injected dependencies.
|
|
138
|
+
* @param parentPort - Communication port to parent thread
|
|
139
|
+
* @param moduleLoader - Module loader for dynamic imports
|
|
140
|
+
* @param projectRoot - Root directory for the project (reserved for future use)
|
|
141
|
+
*/
|
|
142
|
+
constructor(parentPort: IParentPort, moduleLoader: IModuleLoader, projectRoot: string);
|
|
143
|
+
/**
|
|
144
|
+
* Start listening for messages from parent thread.
|
|
145
|
+
*/
|
|
146
|
+
start(): void;
|
|
147
|
+
/**
|
|
148
|
+
* Handle an incoming message from the parent thread.
|
|
149
|
+
*/
|
|
150
|
+
handleMessage(data: unknown): Promise<void>;
|
|
151
|
+
/**
|
|
152
|
+
* Execute a batch of runs.
|
|
153
|
+
*/
|
|
154
|
+
executeBatch(message: WorkerMessage): Promise<WorkerResponse>;
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=worker-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-executor.d.ts","sourceRoot":"","sources":["../../src/executor/worker-executor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,SAAS;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,MAAM,EAAE,cAAc,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,gBAAgB,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C,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,eAAe,IAAI,IAAI,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,YAAY,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;IACzC,YAAY,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;IACzC,YAAY,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;IACzC,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACjC,YAAY,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;CACzC;AAED;;GAEG;AACH,qBAAa,cAAc;IAC1B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAc;IACzC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgB;IAE7C;;;;;OAKG;gBACS,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM;IAOrF;;OAEG;IACI,KAAK,IAAI,IAAI;IAMpB;;OAEG;IACU,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAcxD;;OAEG;IACU,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;CAyC1E"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkerExecutor - Core worker logic with dependency injection.
|
|
3
|
+
*
|
|
4
|
+
* This class can be tested by injecting mock dependencies,
|
|
5
|
+
* while worker-entry.ts provides real implementations.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* WorkerExecutor - Core worker execution logic with injected dependencies.
|
|
9
|
+
*/
|
|
10
|
+
export class WorkerExecutor {
|
|
11
|
+
parentPort;
|
|
12
|
+
moduleLoader;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new WorkerExecutor with injected dependencies.
|
|
15
|
+
* @param parentPort - Communication port to parent thread
|
|
16
|
+
* @param moduleLoader - Module loader for dynamic imports
|
|
17
|
+
* @param projectRoot - Root directory for the project (reserved for future use)
|
|
18
|
+
*/
|
|
19
|
+
constructor(parentPort, moduleLoader, projectRoot) {
|
|
20
|
+
this.parentPort = parentPort;
|
|
21
|
+
this.moduleLoader = moduleLoader;
|
|
22
|
+
// projectRoot reserved for future use
|
|
23
|
+
void projectRoot;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Start listening for messages from parent thread.
|
|
27
|
+
*/
|
|
28
|
+
start() {
|
|
29
|
+
this.parentPort.on("message", (data) => {
|
|
30
|
+
void this.handleMessage(data);
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Handle an incoming message from the parent thread.
|
|
35
|
+
*/
|
|
36
|
+
async handleMessage(data) {
|
|
37
|
+
const message = data;
|
|
38
|
+
try {
|
|
39
|
+
const result = await this.executeBatch(message);
|
|
40
|
+
this.parentPort.postMessage({ type: "done", ...result });
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
this.parentPort.postMessage({
|
|
44
|
+
type: "error",
|
|
45
|
+
error: error instanceof Error ? error.message : String(error),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Execute a batch of runs.
|
|
51
|
+
*/
|
|
52
|
+
async executeBatch(message) {
|
|
53
|
+
// Import the executor and other dependencies
|
|
54
|
+
const executorModule = await this.moduleLoader.loadExecutor();
|
|
55
|
+
const evaluateModule = await this.moduleLoader.loadEvaluate();
|
|
56
|
+
const registryModule = await this.moduleLoader.loadRegistry();
|
|
57
|
+
const sutsModule = await this.moduleLoader.loadSuts();
|
|
58
|
+
const datasetsModule = await this.moduleLoader.loadDatasets();
|
|
59
|
+
// Register all datasets and SUTs
|
|
60
|
+
await datasetsModule.registerBenchmarkDatasets();
|
|
61
|
+
sutsModule.registerAllSuts();
|
|
62
|
+
const caseRegistry = await registryModule.registerAllBenchmarkCases();
|
|
63
|
+
const sutRegistry = {
|
|
64
|
+
list: () => ["degree-prioritised", "standard-bfs", "frontier-balanced", "random-priority"],
|
|
65
|
+
getFactory: () => {
|
|
66
|
+
// This would need to be implemented properly
|
|
67
|
+
return null;
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
const suts = evaluateModule.getSutDefinitions(sutRegistry);
|
|
71
|
+
const cases = evaluateModule.getCaseDefinitions(caseRegistry);
|
|
72
|
+
// Create executor with no onResult callback (workers don't save checkpoints)
|
|
73
|
+
const executor = new executorModule.Executor({
|
|
74
|
+
repetitions: message.config.repetitions,
|
|
75
|
+
seedBase: message.config.seedBase,
|
|
76
|
+
continueOnError: message.config.continueOnError,
|
|
77
|
+
timeoutMs: message.config.timeoutMs,
|
|
78
|
+
collectProvenance: message.config.collectProvenance,
|
|
79
|
+
});
|
|
80
|
+
// Execute the runs
|
|
81
|
+
const results = await executor.execute(suts, cases, () => ({}));
|
|
82
|
+
return {
|
|
83
|
+
results: results.results,
|
|
84
|
+
errors: results.errors,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=worker-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker-executor.js","sourceRoot":"","sources":["../../src/executor/worker-executor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwIH;;GAEG;AACH,MAAM,OAAO,cAAc;IACT,UAAU,CAAc;IACxB,YAAY,CAAgB;IAE7C;;;;;OAKG;IACH,YAAY,UAAuB,EAAE,YAA2B,EAAE,WAAmB;QACpF,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,sCAAsC;QACtC,KAAK,WAAW,CAAC;IAClB,CAAC;IAED;;OAEG;IACI,KAAK;QACX,IAAI,CAAC,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,MAAM,YAAY,GAAG,MAAM,cAAc,CAAC,yBAAyB,EAAE,CAAC;QAEtE,MAAM,WAAW,GAAiB;YACjC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,oBAAoB,EAAE,cAAc,EAAE,mBAAmB,EAAE,iBAAiB,CAAC;YAC1F,UAAU,EAAE,GAAG,EAAE;gBAChB,6CAA6C;gBAC7C,OAAO,IAAI,CAAC;YACb,CAAC;SACD,CAAC;QAEF,MAAM,IAAI,GAAG,cAAc,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QAC3D,MAAM,KAAK,GAAG,cAAc,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC;QAE9D,6EAA6E;QAC7E,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,QAAQ,CAAC;YAC5C,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW;YACvC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ;YACjC,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe;YAC/C,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS;YACnC,iBAAiB,EAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB;SACnD,CAAC,CAAC;QAEH,mBAAmB;QACnB,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAEhE,OAAO;YACN,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,MAAM,EAAE,OAAO,CAAC,MAAM;SACtB,CAAC;IACH,CAAC;CACD"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Auto-generated CJS wrapper for ESM module
|
|
2
|
+
// Load the ESM module dynamically for require() callers
|
|
3
|
+
// Generated by scripts/generate-cjs-wrapper.mjs
|
|
4
|
+
|
|
5
|
+
async function loadModule() {
|
|
6
|
+
return await import('./index.js');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Synchronous export of a function that returns a promise
|
|
10
|
+
// This is the standard pattern for CJS wrappers around ESM
|
|
11
|
+
module.exports = loadModule();
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Portable Programmatic Evaluation Framework
|
|
3
|
+
*
|
|
4
|
+
* A claim-driven, deterministic evaluation framework for experiments.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./types/index.js";
|
|
7
|
+
export * from "./registry/index.js";
|
|
8
|
+
export * from "./executor/index.js";
|
|
9
|
+
export * from "./collector/index.js";
|
|
10
|
+
export * from "./statistical/index.js";
|
|
11
|
+
export * from "./aggregation/index.js";
|
|
12
|
+
export * from "./claims/index.js";
|
|
13
|
+
export * from "./robustness/index.js";
|
|
14
|
+
export * from "./renderers/index.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,kBAAkB,CAAC;AAGjC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,wBAAwB,CAAC;AAGvC,cAAc,mBAAmB,CAAC;AAGlC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,sBAAsB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Portable Programmatic Evaluation Framework
|
|
3
|
+
*
|
|
4
|
+
* A claim-driven, deterministic evaluation framework for experiments.
|
|
5
|
+
*/
|
|
6
|
+
// Types
|
|
7
|
+
export * from "./types/index.js";
|
|
8
|
+
// Registry
|
|
9
|
+
export * from "./registry/index.js";
|
|
10
|
+
// Executor
|
|
11
|
+
export * from "./executor/index.js";
|
|
12
|
+
// Collector
|
|
13
|
+
export * from "./collector/index.js";
|
|
14
|
+
// Statistical
|
|
15
|
+
export * from "./statistical/index.js";
|
|
16
|
+
// Aggregation
|
|
17
|
+
export * from "./aggregation/index.js";
|
|
18
|
+
// Claims
|
|
19
|
+
export * from "./claims/index.js";
|
|
20
|
+
// Robustness
|
|
21
|
+
export * from "./robustness/index.js";
|
|
22
|
+
// Renderers
|
|
23
|
+
export * from "./renderers/index.js";
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,QAAQ;AACR,cAAc,kBAAkB,CAAC;AAEjC,WAAW;AACX,cAAc,qBAAqB,CAAC;AAEpC,WAAW;AACX,cAAc,qBAAqB,CAAC;AAEpC,YAAY;AACZ,cAAc,sBAAsB,CAAC;AAErC,cAAc;AACd,cAAc,wBAAwB,CAAC;AAEvC,cAAc;AACd,cAAc,wBAAwB,CAAC;AAEvC,SAAS;AACT,cAAc,mBAAmB,CAAC;AAElC,aAAa;AACb,cAAc,uBAAuB,CAAC;AAEtC,YAAY;AACZ,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Case Registry
|
|
3
|
+
*
|
|
4
|
+
* Central registry for evaluation case definitions. Cases are registered
|
|
5
|
+
* with their factories, enabling lazy loading of resources during
|
|
6
|
+
* experiment execution.
|
|
7
|
+
*/
|
|
8
|
+
import type { CaseDefinition, EvaluationCase } from "../types/case.js";
|
|
9
|
+
/**
|
|
10
|
+
* Registry for evaluation case definitions.
|
|
11
|
+
*
|
|
12
|
+
* @template TInput - The resource type (e.g., Graph, Dataset)
|
|
13
|
+
* @template TInputs - The algorithm inputs type
|
|
14
|
+
*/
|
|
15
|
+
export declare class CaseRegistry<TInput = unknown, TInputs = unknown> {
|
|
16
|
+
private readonly definitions;
|
|
17
|
+
/**
|
|
18
|
+
* Register a new case.
|
|
19
|
+
*
|
|
20
|
+
* @param definition - Case definition including metadata and factories
|
|
21
|
+
* @throws Error if case with same ID already registered
|
|
22
|
+
*/
|
|
23
|
+
register(definition: CaseDefinition<TInput, TInputs>): this;
|
|
24
|
+
/**
|
|
25
|
+
* Register multiple cases at once.
|
|
26
|
+
*
|
|
27
|
+
* @param definitions - Array of case definitions
|
|
28
|
+
*/
|
|
29
|
+
registerAll(definitions: CaseDefinition<TInput, TInputs>[]): this;
|
|
30
|
+
/**
|
|
31
|
+
* Get a case definition by ID.
|
|
32
|
+
*
|
|
33
|
+
* @param caseId - Case identifier
|
|
34
|
+
* @returns Case definition or undefined
|
|
35
|
+
*/
|
|
36
|
+
get(caseId: string): CaseDefinition<TInput, TInputs> | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Get a case definition by ID, throwing if not found.
|
|
39
|
+
*
|
|
40
|
+
* @param caseId - Case identifier
|
|
41
|
+
* @returns Case definition
|
|
42
|
+
* @throws Error if case not found
|
|
43
|
+
*/
|
|
44
|
+
getOrThrow(caseId: string): CaseDefinition<TInput, TInputs>;
|
|
45
|
+
/**
|
|
46
|
+
* Get all cases with a specific class.
|
|
47
|
+
*
|
|
48
|
+
* @param caseClass - Class to filter by
|
|
49
|
+
* @returns Array of matching case definitions
|
|
50
|
+
*/
|
|
51
|
+
getByClass(caseClass: string): CaseDefinition<TInput, TInputs>[];
|
|
52
|
+
/**
|
|
53
|
+
* Get all cases with a specific tag.
|
|
54
|
+
*
|
|
55
|
+
* @param tag - Tag to filter by
|
|
56
|
+
* @returns Array of matching case definitions
|
|
57
|
+
*/
|
|
58
|
+
getByTag(tag: string): CaseDefinition<TInput, TInputs>[];
|
|
59
|
+
/**
|
|
60
|
+
* List all registered case IDs.
|
|
61
|
+
*
|
|
62
|
+
* @returns Array of case identifiers
|
|
63
|
+
*/
|
|
64
|
+
list(): string[];
|
|
65
|
+
/**
|
|
66
|
+
* List all registered case specifications.
|
|
67
|
+
*
|
|
68
|
+
* @returns Array of case specifications
|
|
69
|
+
*/
|
|
70
|
+
listCases(): EvaluationCase[];
|
|
71
|
+
/**
|
|
72
|
+
* List all unique case classes.
|
|
73
|
+
*
|
|
74
|
+
* @returns Array of case class names
|
|
75
|
+
*/
|
|
76
|
+
listClasses(): string[];
|
|
77
|
+
/**
|
|
78
|
+
* Check if a case is registered.
|
|
79
|
+
*
|
|
80
|
+
* @param caseId - Case identifier
|
|
81
|
+
* @returns true if registered
|
|
82
|
+
*/
|
|
83
|
+
has(caseId: string): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Get the number of registered cases.
|
|
86
|
+
*/
|
|
87
|
+
get size(): number;
|
|
88
|
+
/**
|
|
89
|
+
* Clear all registrations.
|
|
90
|
+
*/
|
|
91
|
+
clear(): void;
|
|
92
|
+
/**
|
|
93
|
+
* Load the input resource for a case.
|
|
94
|
+
*
|
|
95
|
+
* @param caseId - Case identifier
|
|
96
|
+
* @returns Promise resolving to the input resource
|
|
97
|
+
*/
|
|
98
|
+
getInput(caseId: string): Promise<TInput>;
|
|
99
|
+
/**
|
|
100
|
+
* Get the algorithm inputs for a case.
|
|
101
|
+
*
|
|
102
|
+
* @param caseId - Case identifier
|
|
103
|
+
* @returns Algorithm inputs
|
|
104
|
+
*/
|
|
105
|
+
getInputs(caseId: string): TInputs;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Global case registry instance.
|
|
109
|
+
*
|
|
110
|
+
* Use this for standard registration, or create instances for isolation.
|
|
111
|
+
*/
|
|
112
|
+
export declare const caseRegistry: CaseRegistry<unknown, unknown>;
|
|
113
|
+
//# sourceMappingURL=case-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"case-registry.d.ts","sourceRoot":"","sources":["../../src/registry/case-registry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EA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AAY,gCAAqB,CAAC"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Case Registry
|
|
3
|
+
*
|
|
4
|
+
* Central registry for evaluation case definitions. Cases are registered
|
|
5
|
+
* with their factories, enabling lazy loading of resources during
|
|
6
|
+
* experiment execution.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Registry for evaluation case definitions.
|
|
10
|
+
*
|
|
11
|
+
* @template TInput - The resource type (e.g., Graph, Dataset)
|
|
12
|
+
* @template TInputs - The algorithm inputs type
|
|
13
|
+
*/
|
|
14
|
+
export class CaseRegistry {
|
|
15
|
+
definitions = new Map();
|
|
16
|
+
/**
|
|
17
|
+
* Register a new case.
|
|
18
|
+
*
|
|
19
|
+
* @param definition - Case definition including metadata and factories
|
|
20
|
+
* @throws Error if case with same ID already registered
|
|
21
|
+
*/
|
|
22
|
+
register(definition) {
|
|
23
|
+
const caseId = definition.case.caseId;
|
|
24
|
+
if (this.definitions.has(caseId)) {
|
|
25
|
+
throw new Error(`Case already registered: ${caseId}`);
|
|
26
|
+
}
|
|
27
|
+
this.definitions.set(caseId, definition);
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Register multiple cases at once.
|
|
32
|
+
*
|
|
33
|
+
* @param definitions - Array of case definitions
|
|
34
|
+
*/
|
|
35
|
+
registerAll(definitions) {
|
|
36
|
+
for (const definition of definitions) {
|
|
37
|
+
this.register(definition);
|
|
38
|
+
}
|
|
39
|
+
return this;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get a case definition by ID.
|
|
43
|
+
*
|
|
44
|
+
* @param caseId - Case identifier
|
|
45
|
+
* @returns Case definition or undefined
|
|
46
|
+
*/
|
|
47
|
+
get(caseId) {
|
|
48
|
+
return this.definitions.get(caseId);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get a case definition by ID, throwing if not found.
|
|
52
|
+
*
|
|
53
|
+
* @param caseId - Case identifier
|
|
54
|
+
* @returns Case definition
|
|
55
|
+
* @throws Error if case not found
|
|
56
|
+
*/
|
|
57
|
+
getOrThrow(caseId) {
|
|
58
|
+
const definition = this.definitions.get(caseId);
|
|
59
|
+
if (!definition) {
|
|
60
|
+
throw new Error(`Case not found: ${caseId}`);
|
|
61
|
+
}
|
|
62
|
+
return definition;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Get all cases with a specific class.
|
|
66
|
+
*
|
|
67
|
+
* @param caseClass - Class to filter by
|
|
68
|
+
* @returns Array of matching case definitions
|
|
69
|
+
*/
|
|
70
|
+
getByClass(caseClass) {
|
|
71
|
+
return [...this.definitions.values()].filter((d) => d.case.caseClass === caseClass);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Get all cases with a specific tag.
|
|
75
|
+
*
|
|
76
|
+
* @param tag - Tag to filter by
|
|
77
|
+
* @returns Array of matching case definitions
|
|
78
|
+
*/
|
|
79
|
+
getByTag(tag) {
|
|
80
|
+
return [...this.definitions.values()].filter((d) => d.case.tags?.includes(tag));
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* List all registered case IDs.
|
|
84
|
+
*
|
|
85
|
+
* @returns Array of case identifiers
|
|
86
|
+
*/
|
|
87
|
+
list() {
|
|
88
|
+
return [...this.definitions.keys()];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* List all registered case specifications.
|
|
92
|
+
*
|
|
93
|
+
* @returns Array of case specifications
|
|
94
|
+
*/
|
|
95
|
+
listCases() {
|
|
96
|
+
return [...this.definitions.values()].map((d) => d.case);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* List all unique case classes.
|
|
100
|
+
*
|
|
101
|
+
* @returns Array of case class names
|
|
102
|
+
*/
|
|
103
|
+
listClasses() {
|
|
104
|
+
const classes = new Set();
|
|
105
|
+
for (const definition of this.definitions.values()) {
|
|
106
|
+
if (definition.case.caseClass) {
|
|
107
|
+
classes.add(definition.case.caseClass);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return [...classes];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Check if a case is registered.
|
|
114
|
+
*
|
|
115
|
+
* @param caseId - Case identifier
|
|
116
|
+
* @returns true if registered
|
|
117
|
+
*/
|
|
118
|
+
has(caseId) {
|
|
119
|
+
return this.definitions.has(caseId);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get the number of registered cases.
|
|
123
|
+
*/
|
|
124
|
+
get size() {
|
|
125
|
+
return this.definitions.size;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Clear all registrations.
|
|
129
|
+
*/
|
|
130
|
+
clear() {
|
|
131
|
+
this.definitions.clear();
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Load the input resource for a case.
|
|
135
|
+
*
|
|
136
|
+
* @param caseId - Case identifier
|
|
137
|
+
* @returns Promise resolving to the input resource
|
|
138
|
+
*/
|
|
139
|
+
async getInput(caseId) {
|
|
140
|
+
const definition = this.getOrThrow(caseId);
|
|
141
|
+
return definition.getInput();
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Get the algorithm inputs for a case.
|
|
145
|
+
*
|
|
146
|
+
* @param caseId - Case identifier
|
|
147
|
+
* @returns Algorithm inputs
|
|
148
|
+
*/
|
|
149
|
+
getInputs(caseId) {
|
|
150
|
+
const definition = this.getOrThrow(caseId);
|
|
151
|
+
return definition.getInputs();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Global case registry instance.
|
|
156
|
+
*
|
|
157
|
+
* Use this for standard registration, or create instances for isolation.
|
|
158
|
+
*/
|
|
159
|
+
export const caseRegistry = new CaseRegistry();
|
|
160
|
+
//# sourceMappingURL=case-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"case-registry.js","sourceRoot":"","sources":["../../src/registry/case-registry.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,QAAQ,CAAC,MAAc;QAC5B,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC3C,OAAO,UAAU,CAAC,QAAQ,EAAE,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,MAAc;QACvB,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC3C,OAAO,UAAU,CAAC,SAAS,EAAE,CAAC;IAC/B,CAAC;CACD;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
|