ppef 1.0.1 → 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.
Files changed (175) hide show
  1. package/bin/ppef.mjs +20 -0
  2. package/dist/__tests__/framework-pipeline.integration.test.js +13 -11
  3. package/dist/__tests__/framework-pipeline.integration.test.js.map +1 -1
  4. package/dist/__tests__/index-exports.unit.test.d.ts +8 -0
  5. package/dist/__tests__/index-exports.unit.test.d.ts.map +1 -0
  6. package/dist/__tests__/index-exports.unit.test.js +127 -0
  7. package/dist/__tests__/index-exports.unit.test.js.map +1 -0
  8. package/dist/__tests__/registry-executor.integration.test.js +12 -9
  9. package/dist/__tests__/registry-executor.integration.test.js.map +1 -1
  10. package/dist/aggregation/__tests__/aggregators.unit.test.d.ts +7 -0
  11. package/dist/aggregation/__tests__/aggregators.unit.test.d.ts.map +1 -0
  12. package/dist/aggregation/__tests__/aggregators.unit.test.js +350 -0
  13. package/dist/aggregation/__tests__/aggregators.unit.test.js.map +1 -0
  14. package/dist/aggregation/__tests__/pipeline.unit.test.d.ts +7 -0
  15. package/dist/aggregation/__tests__/pipeline.unit.test.d.ts.map +1 -0
  16. package/dist/aggregation/__tests__/pipeline.unit.test.js +213 -0
  17. package/dist/aggregation/__tests__/pipeline.unit.test.js.map +1 -0
  18. package/dist/aggregation/aggregators.d.ts +9 -0
  19. package/dist/aggregation/aggregators.d.ts.map +1 -1
  20. package/dist/aggregation/aggregators.js +1 -1
  21. package/dist/aggregation/aggregators.js.map +1 -1
  22. package/dist/aggregation/index.d.ts +1 -1
  23. package/dist/aggregation/index.d.ts.map +1 -1
  24. package/dist/aggregation/index.js +1 -1
  25. package/dist/aggregation/index.js.map +1 -1
  26. package/dist/claims/__tests__/evaluator.unit.test.d.ts +12 -0
  27. package/dist/claims/__tests__/evaluator.unit.test.d.ts.map +1 -0
  28. package/dist/claims/__tests__/evaluator.unit.test.js +801 -0
  29. package/dist/claims/__tests__/evaluator.unit.test.js.map +1 -0
  30. package/dist/cli/__tests__/aggregate.command.unit.test.d.ts +7 -0
  31. package/dist/cli/__tests__/aggregate.command.unit.test.d.ts.map +1 -0
  32. package/dist/cli/__tests__/aggregate.command.unit.test.js +396 -0
  33. package/dist/cli/__tests__/aggregate.command.unit.test.js.map +1 -0
  34. package/dist/cli/__tests__/commands.unit.test.d.ts +10 -0
  35. package/dist/cli/__tests__/commands.unit.test.d.ts.map +1 -0
  36. package/dist/cli/__tests__/commands.unit.test.js +217 -0
  37. package/dist/cli/__tests__/commands.unit.test.js.map +1 -0
  38. package/dist/cli/__tests__/index.unit.test.d.ts +10 -0
  39. package/dist/cli/__tests__/index.unit.test.d.ts.map +1 -0
  40. package/dist/cli/__tests__/index.unit.test.js +65 -0
  41. package/dist/cli/__tests__/index.unit.test.js.map +1 -0
  42. package/dist/cli/__tests__/logger.unit.test.d.ts +11 -0
  43. package/dist/cli/__tests__/logger.unit.test.d.ts.map +1 -0
  44. package/dist/cli/__tests__/logger.unit.test.js +180 -0
  45. package/dist/cli/__tests__/logger.unit.test.js.map +1 -0
  46. package/dist/cli/__tests__/module-loader.unit.test.d.ts +11 -0
  47. package/dist/cli/__tests__/module-loader.unit.test.d.ts.map +1 -0
  48. package/dist/cli/__tests__/module-loader.unit.test.js +262 -0
  49. package/dist/cli/__tests__/module-loader.unit.test.js.map +1 -0
  50. package/dist/cli/__tests__/output-writer.unit.test.d.ts +10 -0
  51. package/dist/cli/__tests__/output-writer.unit.test.d.ts.map +1 -0
  52. package/dist/cli/__tests__/output-writer.unit.test.js +216 -0
  53. package/dist/cli/__tests__/output-writer.unit.test.js.map +1 -0
  54. package/dist/cli/__tests__/plan.command.unit.test.d.ts +7 -0
  55. package/dist/cli/__tests__/plan.command.unit.test.d.ts.map +1 -0
  56. package/dist/cli/__tests__/plan.command.unit.test.js +289 -0
  57. package/dist/cli/__tests__/plan.command.unit.test.js.map +1 -0
  58. package/dist/cli/__tests__/run.command.unit.test.d.ts +7 -0
  59. package/dist/cli/__tests__/run.command.unit.test.d.ts.map +1 -0
  60. package/dist/cli/__tests__/run.command.unit.test.js +422 -0
  61. package/dist/cli/__tests__/run.command.unit.test.js.map +1 -0
  62. package/dist/cli/__tests__/validate.command.unit.test.d.ts +7 -0
  63. package/dist/cli/__tests__/validate.command.unit.test.d.ts.map +1 -0
  64. package/dist/cli/__tests__/validate.command.unit.test.js +226 -0
  65. package/dist/cli/__tests__/validate.command.unit.test.js.map +1 -0
  66. package/dist/cli/command-deps.d.ts +125 -0
  67. package/dist/cli/command-deps.d.ts.map +1 -0
  68. package/dist/cli/command-deps.js +7 -0
  69. package/dist/cli/command-deps.js.map +1 -0
  70. package/dist/cli/commands/aggregate.d.ts +35 -0
  71. package/dist/cli/commands/aggregate.d.ts.map +1 -0
  72. package/dist/cli/commands/aggregate.js +121 -0
  73. package/dist/cli/commands/aggregate.js.map +1 -0
  74. package/dist/cli/commands/plan.d.ts +36 -0
  75. package/dist/cli/commands/plan.d.ts.map +1 -0
  76. package/dist/cli/commands/plan.js +109 -0
  77. package/dist/cli/commands/plan.js.map +1 -0
  78. package/dist/cli/commands/run.d.ts +33 -0
  79. package/dist/cli/commands/run.d.ts.map +1 -0
  80. package/dist/cli/commands/run.js +185 -0
  81. package/dist/cli/commands/run.js.map +1 -0
  82. package/dist/cli/commands/validate.d.ts +27 -0
  83. package/dist/cli/commands/validate.d.ts.map +1 -0
  84. package/dist/cli/commands/validate.js +88 -0
  85. package/dist/cli/commands/validate.js.map +1 -0
  86. package/dist/cli/config-loader.d.ts +30 -0
  87. package/dist/cli/config-loader.d.ts.map +1 -0
  88. package/dist/cli/config-loader.js +181 -0
  89. package/dist/cli/config-loader.js.map +1 -0
  90. package/dist/cli/index.d.ts +26 -0
  91. package/dist/cli/index.d.ts.map +1 -0
  92. package/dist/cli/index.js +58 -0
  93. package/dist/cli/index.js.map +1 -0
  94. package/dist/cli/logger.d.ts +75 -0
  95. package/dist/cli/logger.d.ts.map +1 -0
  96. package/dist/cli/logger.js +131 -0
  97. package/dist/cli/logger.js.map +1 -0
  98. package/dist/cli/module-loader.d.ts +46 -0
  99. package/dist/cli/module-loader.d.ts.map +1 -0
  100. package/dist/cli/module-loader.js +116 -0
  101. package/dist/cli/module-loader.js.map +1 -0
  102. package/dist/cli/output-writer.d.ts +51 -0
  103. package/dist/cli/output-writer.d.ts.map +1 -0
  104. package/dist/cli/output-writer.js +65 -0
  105. package/dist/cli/output-writer.js.map +1 -0
  106. package/dist/cli/types.d.ts +174 -0
  107. package/dist/cli/types.d.ts.map +1 -0
  108. package/dist/cli/types.js +7 -0
  109. package/dist/cli/types.js.map +1 -0
  110. package/dist/collector/__tests__/result-collector.unit.test.d.ts +7 -0
  111. package/dist/collector/__tests__/result-collector.unit.test.d.ts.map +1 -0
  112. package/dist/collector/__tests__/result-collector.unit.test.js +1021 -0
  113. package/dist/collector/__tests__/result-collector.unit.test.js.map +1 -0
  114. package/dist/collector/__tests__/schema.unit.test.d.ts +7 -0
  115. package/dist/collector/__tests__/schema.unit.test.d.ts.map +1 -0
  116. package/dist/collector/__tests__/schema.unit.test.js +360 -0
  117. package/dist/collector/__tests__/schema.unit.test.js.map +1 -0
  118. package/dist/executor/__tests__/checkpoint-manager.unit.test.js +83 -1
  119. package/dist/executor/__tests__/checkpoint-manager.unit.test.js.map +1 -1
  120. package/dist/executor/__tests__/checkpoint-merge-bug.diagnostic.test.d.ts +3 -6
  121. package/dist/executor/__tests__/checkpoint-merge-bug.diagnostic.test.d.ts.map +1 -1
  122. package/dist/executor/__tests__/checkpoint-merge-bug.diagnostic.test.js +428 -159
  123. package/dist/executor/__tests__/checkpoint-merge-bug.diagnostic.test.js.map +1 -1
  124. package/dist/executor/__tests__/checkpoint-storage.unit.test.js +105 -1
  125. package/dist/executor/__tests__/checkpoint-storage.unit.test.js.map +1 -1
  126. package/dist/executor/__tests__/executor.unit.test.js +69 -1
  127. package/dist/executor/__tests__/executor.unit.test.js.map +1 -1
  128. package/dist/executor/__tests__/memory-monitor.unit.test.d.ts +7 -0
  129. package/dist/executor/__tests__/memory-monitor.unit.test.d.ts.map +1 -0
  130. package/dist/executor/__tests__/memory-monitor.unit.test.js +285 -0
  131. package/dist/executor/__tests__/memory-monitor.unit.test.js.map +1 -0
  132. package/dist/executor/__tests__/parallel-executor.unit.test.d.ts +2 -1
  133. package/dist/executor/__tests__/parallel-executor.unit.test.d.ts.map +1 -1
  134. package/dist/executor/__tests__/parallel-executor.unit.test.js +426 -156
  135. package/dist/executor/__tests__/parallel-executor.unit.test.js.map +1 -1
  136. package/dist/executor/__tests__/run-id.unit.test.d.ts +8 -0
  137. package/dist/executor/__tests__/run-id.unit.test.d.ts.map +1 -0
  138. package/dist/executor/__tests__/run-id.unit.test.js +156 -0
  139. package/dist/executor/__tests__/run-id.unit.test.js.map +1 -0
  140. package/dist/executor/__tests__/worker-entry.integration.test.d.ts +24 -0
  141. package/dist/executor/__tests__/worker-entry.integration.test.d.ts.map +1 -0
  142. package/dist/executor/__tests__/worker-entry.integration.test.js +82 -0
  143. package/dist/executor/__tests__/worker-entry.integration.test.js.map +1 -0
  144. package/dist/executor/__tests__/worker-entry.unit.test.d.ts +7 -0
  145. package/dist/executor/__tests__/worker-entry.unit.test.d.ts.map +1 -0
  146. package/dist/executor/__tests__/worker-entry.unit.test.js +364 -0
  147. package/dist/executor/__tests__/worker-entry.unit.test.js.map +1 -0
  148. package/dist/executor/parallel-executor.d.ts +186 -0
  149. package/dist/executor/parallel-executor.d.ts.map +1 -1
  150. package/dist/executor/parallel-executor.js +218 -83
  151. package/dist/executor/parallel-executor.js.map +1 -1
  152. package/dist/executor/run-id.d.ts.map +1 -1
  153. package/dist/executor/run-id.js +8 -1
  154. package/dist/executor/run-id.js.map +1 -1
  155. package/dist/executor/worker-entry.d.ts +2 -0
  156. package/dist/executor/worker-entry.d.ts.map +1 -1
  157. package/dist/executor/worker-entry.js +29 -54
  158. package/dist/executor/worker-entry.js.map +1 -1
  159. package/dist/executor/worker-executor.d.ts +156 -0
  160. package/dist/executor/worker-executor.d.ts.map +1 -0
  161. package/dist/executor/worker-executor.js +88 -0
  162. package/dist/executor/worker-executor.js.map +1 -0
  163. package/dist/robustness/__tests__/analyzer.unit.test.d.ts +11 -0
  164. package/dist/robustness/__tests__/analyzer.unit.test.d.ts.map +1 -0
  165. package/dist/robustness/__tests__/analyzer.unit.test.js +455 -0
  166. package/dist/robustness/__tests__/analyzer.unit.test.js.map +1 -0
  167. package/dist/robustness/__tests__/perturbations.unit.test.d.ts +11 -0
  168. package/dist/robustness/__tests__/perturbations.unit.test.d.ts.map +1 -0
  169. package/dist/robustness/__tests__/perturbations.unit.test.js +284 -0
  170. package/dist/robustness/__tests__/perturbations.unit.test.js.map +1 -0
  171. package/dist/statistical/__tests__/mann-whitney-u.unit.test.d.ts +7 -0
  172. package/dist/statistical/__tests__/mann-whitney-u.unit.test.d.ts.map +1 -0
  173. package/dist/statistical/__tests__/mann-whitney-u.unit.test.js +185 -0
  174. package/dist/statistical/__tests__/mann-whitney-u.unit.test.js.map +1 -0
  175. package/package.json +8 -1
@@ -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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AAC,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,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,IAAa,EAAE,EAAE;YAC/C,KAAK,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACJ,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,aAAa,CAAC,IAAa;QACvC,M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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"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Unit tests for Robustness Analyzer
3
+ *
4
+ * Tests robustness analysis functions including:
5
+ * - analyzeRobustnessForMetric
6
+ * - analyzeRobustnessWithCurve
7
+ * - compareRobustness
8
+ * - createRobustnessAnalysis
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=analyzer.unit.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyzer.unit.test.d.ts","sourceRoot":"","sources":["../../../src/robustness/__tests__/analyzer.unit.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}