agentic-qe 3.8.4 → 3.8.6

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 (198) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +12 -0
  3. package/dist/cli/bundle.js +694 -694
  4. package/dist/cli/commands/hooks-handlers/command-hooks.d.ts +12 -0
  5. package/dist/cli/commands/hooks-handlers/command-hooks.js +253 -0
  6. package/dist/cli/commands/hooks-handlers/editing-hooks.d.ts +12 -0
  7. package/dist/cli/commands/hooks-handlers/editing-hooks.js +161 -0
  8. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.d.ts +57 -0
  9. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +263 -0
  10. package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +52 -0
  11. package/dist/cli/commands/hooks-handlers/hooks-shared.js +223 -0
  12. package/dist/cli/commands/hooks-handlers/routing-hooks.d.ts +12 -0
  13. package/dist/cli/commands/hooks-handlers/routing-hooks.js +107 -0
  14. package/dist/cli/commands/hooks-handlers/session-hooks.d.ts +12 -0
  15. package/dist/cli/commands/hooks-handlers/session-hooks.js +171 -0
  16. package/dist/cli/commands/hooks-handlers/stats-hooks.d.ts +12 -0
  17. package/dist/cli/commands/hooks-handlers/stats-hooks.js +248 -0
  18. package/dist/cli/commands/hooks-handlers/task-hooks.d.ts +12 -0
  19. package/dist/cli/commands/hooks-handlers/task-hooks.js +152 -0
  20. package/dist/cli/commands/hooks.d.ts +3 -23
  21. package/dist/cli/commands/hooks.js +16 -1459
  22. package/dist/coordination/mincut/phase-executor.d.ts +27 -0
  23. package/dist/coordination/mincut/phase-executor.js +70 -0
  24. package/dist/coordination/mincut/time-crystal-analysis.d.ts +35 -0
  25. package/dist/coordination/mincut/time-crystal-analysis.js +237 -0
  26. package/dist/coordination/mincut/time-crystal-persistence.d.ts +35 -0
  27. package/dist/coordination/mincut/time-crystal-persistence.js +81 -0
  28. package/dist/coordination/mincut/time-crystal-scheduling.d.ts +34 -0
  29. package/dist/coordination/mincut/time-crystal-scheduling.js +213 -0
  30. package/dist/coordination/mincut/time-crystal-types.d.ts +278 -0
  31. package/dist/coordination/mincut/time-crystal-types.js +67 -0
  32. package/dist/coordination/mincut/time-crystal.d.ts +8 -438
  33. package/dist/coordination/mincut/time-crystal.js +87 -905
  34. package/dist/domains/base-domain-coordinator.d.ts +0 -15
  35. package/dist/domains/base-domain-coordinator.js +7 -5
  36. package/dist/domains/chaos-resilience/coordinator.d.ts +0 -4
  37. package/dist/domains/chaos-resilience/coordinator.js +24 -22
  38. package/dist/domains/chaos-resilience/services/chaos-engineer.d.ts +0 -4
  39. package/dist/domains/chaos-resilience/services/chaos-engineer.js +47 -45
  40. package/dist/domains/chaos-resilience/services/performance-profiler.d.ts +0 -4
  41. package/dist/domains/chaos-resilience/services/performance-profiler.js +10 -8
  42. package/dist/domains/code-intelligence/coordinator-consensus.d.ts +0 -3
  43. package/dist/domains/code-intelligence/coordinator-consensus.js +8 -6
  44. package/dist/domains/code-intelligence/coordinator-gnn.d.ts +0 -3
  45. package/dist/domains/code-intelligence/coordinator-gnn.js +8 -6
  46. package/dist/domains/code-intelligence/coordinator-hypergraph.d.ts +0 -3
  47. package/dist/domains/code-intelligence/coordinator-hypergraph.js +13 -11
  48. package/dist/domains/code-intelligence/coordinator.d.ts +0 -3
  49. package/dist/domains/code-intelligence/coordinator.js +21 -19
  50. package/dist/domains/code-intelligence/services/c4-model/index.d.ts +0 -3
  51. package/dist/domains/code-intelligence/services/c4-model/index.js +5 -3
  52. package/dist/domains/code-intelligence/services/knowledge-graph.d.ts +0 -6
  53. package/dist/domains/code-intelligence/services/knowledge-graph.js +4 -2
  54. package/dist/domains/code-intelligence/services/product-factors-bridge.d.ts +0 -5
  55. package/dist/domains/code-intelligence/services/product-factors-bridge.js +9 -7
  56. package/dist/domains/contract-testing/coordinator.d.ts +0 -6
  57. package/dist/domains/contract-testing/coordinator.js +25 -23
  58. package/dist/domains/contract-testing/services/contract-validator.d.ts +0 -4
  59. package/dist/domains/contract-testing/services/contract-validator.js +4 -2
  60. package/dist/domains/contract-testing/services/schema-validator.js +1 -1
  61. package/dist/domains/coverage-analysis/coordinator.js +13 -11
  62. package/dist/domains/coverage-analysis/services/coverage-analyzer.js +4 -2
  63. package/dist/domains/coverage-analysis/services/gap-detector.js +3 -1
  64. package/dist/domains/coverage-analysis/services/hnsw-index.d.ts +0 -15
  65. package/dist/domains/coverage-analysis/services/hnsw-index.js +3 -1
  66. package/dist/domains/coverage-analysis/services/sublinear-analyzer.d.ts +0 -26
  67. package/dist/domains/coverage-analysis/services/sublinear-analyzer.js +3 -1
  68. package/dist/domains/defect-intelligence/coordinator.d.ts +1 -10
  69. package/dist/domains/defect-intelligence/coordinator.js +5 -3
  70. package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.d.ts +0 -6
  71. package/dist/domains/defect-intelligence/services/causal-root-cause-analyzer.js +3 -1
  72. package/dist/domains/defect-intelligence/services/defect-predictor.d.ts +0 -6
  73. package/dist/domains/defect-intelligence/services/defect-predictor.js +5 -3
  74. package/dist/domains/defect-intelligence/services/pattern-learner.d.ts +0 -4
  75. package/dist/domains/defect-intelligence/services/pattern-learner.js +3 -1
  76. package/dist/domains/defect-intelligence/services/root-cause-analyzer.d.ts +0 -6
  77. package/dist/domains/defect-intelligence/services/root-cause-analyzer.js +3 -1
  78. package/dist/domains/enterprise-integration/coordinator.js +6 -4
  79. package/dist/domains/learning-optimization/coordinator-consensus.d.ts +0 -3
  80. package/dist/domains/learning-optimization/coordinator-consensus.js +8 -6
  81. package/dist/domains/learning-optimization/coordinator.d.ts +0 -3
  82. package/dist/domains/learning-optimization/coordinator.js +15 -13
  83. package/dist/domains/learning-optimization/services/learning-coordinator.d.ts +0 -4
  84. package/dist/domains/learning-optimization/services/learning-coordinator.js +4 -2
  85. package/dist/domains/quality-assessment/coordinator-claim-verifier.d.ts +0 -3
  86. package/dist/domains/quality-assessment/coordinator-claim-verifier.js +6 -4
  87. package/dist/domains/quality-assessment/coordinator-gate-evaluation.d.ts +0 -4
  88. package/dist/domains/quality-assessment/coordinator-gate-evaluation.js +9 -7
  89. package/dist/domains/quality-assessment/coordinator-rl-integration.d.ts +0 -3
  90. package/dist/domains/quality-assessment/coordinator-rl-integration.js +10 -8
  91. package/dist/domains/quality-assessment/coordinator.d.ts +0 -15
  92. package/dist/domains/quality-assessment/coordinator.js +14 -12
  93. package/dist/domains/quality-assessment/services/deployment-advisor.d.ts +0 -10
  94. package/dist/domains/quality-assessment/services/deployment-advisor.js +4 -2
  95. package/dist/domains/quality-assessment/services/quality-analyzer.d.ts +0 -6
  96. package/dist/domains/quality-assessment/services/quality-analyzer.js +4 -2
  97. package/dist/domains/requirements-validation/coordinator.d.ts +0 -3
  98. package/dist/domains/requirements-validation/coordinator.js +15 -13
  99. package/dist/domains/requirements-validation/services/product-factors-assessment/code-intelligence/codebase-analyzer.d.ts +0 -5
  100. package/dist/domains/requirements-validation/services/product-factors-assessment/code-intelligence/codebase-analyzer.js +15 -13
  101. package/dist/domains/requirements-validation/services/product-factors-assessment/product-factors-service.d.ts +0 -6
  102. package/dist/domains/requirements-validation/services/product-factors-assessment/product-factors-service.js +9 -7
  103. package/dist/domains/requirements-validation/services/requirements-validator.d.ts +0 -6
  104. package/dist/domains/requirements-validation/services/requirements-validator.js +4 -2
  105. package/dist/domains/security-compliance/coordinator.js +24 -22
  106. package/dist/domains/security-compliance/services/scanners/dast-scanner.d.ts +0 -21
  107. package/dist/domains/security-compliance/services/scanners/dast-scanner.js +4 -2
  108. package/dist/domains/security-compliance/services/scanners/sast-scanner.d.ts +0 -4
  109. package/dist/domains/security-compliance/services/scanners/sast-scanner.js +3 -1
  110. package/dist/domains/security-compliance/services/security-auditor-dast.d.ts +0 -4
  111. package/dist/domains/security-compliance/services/security-auditor-dast.js +3 -1
  112. package/dist/domains/security-compliance/services/security-auditor-sast.d.ts +0 -3
  113. package/dist/domains/security-compliance/services/security-auditor-sast.js +3 -1
  114. package/dist/domains/security-compliance/services/security-auditor-secrets.d.ts +0 -3
  115. package/dist/domains/security-compliance/services/security-auditor-secrets.js +3 -1
  116. package/dist/domains/security-compliance/services/security-auditor.js +11 -9
  117. package/dist/domains/test-execution/coordinator.js +11 -9
  118. package/dist/domains/test-execution/services/auth-state-manager.d.ts +0 -3
  119. package/dist/domains/test-execution/services/auth-state-manager.js +4 -2
  120. package/dist/domains/test-execution/services/e2e/e2e-coordinator.d.ts +0 -14
  121. package/dist/domains/test-execution/services/e2e/e2e-coordinator.js +3 -1
  122. package/dist/domains/test-execution/services/flaky-detector.js +4 -2
  123. package/dist/domains/test-execution/services/retry-handler.js +3 -1
  124. package/dist/domains/test-execution/services/test-executor.js +3 -1
  125. package/dist/domains/test-generation/coordinator.d.ts +0 -17
  126. package/dist/domains/test-generation/coordinator.js +33 -31
  127. package/dist/domains/test-generation/pattern-injection/edge-case-injector.d.ts +0 -5
  128. package/dist/domains/test-generation/pattern-injection/edge-case-injector.js +3 -1
  129. package/dist/domains/test-generation/services/code-transform-integration.d.ts +0 -7
  130. package/dist/domains/test-generation/services/code-transform-integration.js +3 -1
  131. package/dist/domains/test-generation/services/coherence-gate-service.d.ts +0 -3
  132. package/dist/domains/test-generation/services/coherence-gate-service.js +3 -1
  133. package/dist/domains/test-generation/services/test-generator.d.ts +0 -8
  134. package/dist/domains/test-generation/services/test-generator.js +5 -3
  135. package/dist/domains/visual-accessibility/coordinator.d.ts +0 -3
  136. package/dist/domains/visual-accessibility/coordinator.js +14 -12
  137. package/dist/domains/visual-accessibility/services/accessibility-tester-browser.d.ts +0 -3
  138. package/dist/domains/visual-accessibility/services/accessibility-tester-browser.js +52 -50
  139. package/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +0 -4
  140. package/dist/domains/visual-accessibility/services/accessibility-tester.js +8 -6
  141. package/dist/domains/visual-accessibility/services/axe-core-integration.d.ts +0 -3
  142. package/dist/domains/visual-accessibility/services/axe-core-integration.js +20 -18
  143. package/dist/domains/visual-accessibility/services/browser-security-scanner.d.ts +0 -4
  144. package/dist/domains/visual-accessibility/services/browser-security-scanner.js +6 -4
  145. package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.d.ts +0 -30
  146. package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.js +5 -3
  147. package/dist/domains/visual-accessibility/services/viewport-capture.d.ts +0 -27
  148. package/dist/domains/visual-accessibility/services/viewport-capture.js +6 -4
  149. package/dist/domains/visual-accessibility/services/visual-regression.d.ts +0 -26
  150. package/dist/domains/visual-accessibility/services/visual-regression.js +4 -2
  151. package/dist/domains/visual-accessibility/services/visual-tester.d.ts +0 -4
  152. package/dist/domains/visual-accessibility/services/visual-tester.js +4 -2
  153. package/dist/governance/deterministic-gateway-integration.js +1 -1
  154. package/dist/learning/agent-routing.d.ts +53 -0
  155. package/dist/learning/agent-routing.js +142 -0
  156. package/dist/learning/embedding-utils.d.ts +34 -0
  157. package/dist/learning/embedding-utils.js +95 -0
  158. package/dist/learning/pattern-promotion.d.ts +63 -0
  159. package/dist/learning/pattern-promotion.js +187 -0
  160. package/dist/learning/pretrained-patterns.d.ts +14 -0
  161. package/dist/learning/pretrained-patterns.js +726 -0
  162. package/dist/learning/qe-reasoning-bank-types.d.ts +174 -0
  163. package/dist/learning/qe-reasoning-bank-types.js +24 -0
  164. package/dist/learning/qe-reasoning-bank.d.ts +9 -192
  165. package/dist/learning/qe-reasoning-bank.js +48 -1093
  166. package/dist/mcp/bundle.js +335 -335
  167. package/dist/mcp/security/validators/command-validator.d.ts +1 -40
  168. package/dist/mcp/security/validators/command-validator.js +2 -122
  169. package/dist/mcp/security/validators/crypto-validator.d.ts +1 -39
  170. package/dist/mcp/security/validators/crypto-validator.js +2 -71
  171. package/dist/mcp/security/validators/input-sanitizer.d.ts +1 -55
  172. package/dist/mcp/security/validators/input-sanitizer.js +2 -156
  173. package/dist/mcp/security/validators/interfaces.d.ts +1 -163
  174. package/dist/mcp/security/validators/interfaces.js +2 -5
  175. package/dist/mcp/security/validators/path-traversal-validator.d.ts +1 -49
  176. package/dist/mcp/security/validators/path-traversal-validator.js +2 -241
  177. package/dist/mcp/security/validators/regex-safety-validator.d.ts +1 -49
  178. package/dist/mcp/security/validators/regex-safety-validator.js +2 -182
  179. package/dist/mcp/security/validators/validation-orchestrator.d.ts +1 -65
  180. package/dist/mcp/security/validators/validation-orchestrator.js +2 -145
  181. package/dist/shared/io/file-reader.js +1 -1
  182. package/dist/shared/security/command-validator.d.ts +44 -0
  183. package/dist/shared/security/command-validator.js +126 -0
  184. package/dist/shared/security/crypto-validator.d.ts +43 -0
  185. package/dist/shared/security/crypto-validator.js +75 -0
  186. package/dist/shared/security/index.d.ts +7 -0
  187. package/dist/shared/security/index.js +15 -0
  188. package/dist/shared/security/input-sanitizer.d.ts +59 -0
  189. package/dist/shared/security/input-sanitizer.js +160 -0
  190. package/dist/shared/security/path-traversal-validator.d.ts +53 -0
  191. package/dist/shared/security/path-traversal-validator.js +245 -0
  192. package/dist/shared/security/regex-safety-validator.d.ts +53 -0
  193. package/dist/shared/security/regex-safety-validator.js +186 -0
  194. package/dist/shared/security/validation-orchestrator.d.ts +69 -0
  195. package/dist/shared/security/validation-orchestrator.js +149 -0
  196. package/dist/shared/security/validators-interfaces.d.ts +167 -0
  197. package/dist/shared/security/validators-interfaces.js +9 -0
  198. package/package.json +1 -1
@@ -1,307 +1,16 @@
1
1
  /**
2
- * Agentic QE v3 - Time Crystal CI/CD Coordination
2
+ * Agentic QE v3 - Time Crystal CI/CD Coordination Controller
3
3
  * ADR-047: MinCut Self-Organizing QE Integration - Phase 4
4
- * ADR-032: Kuramoto CPG oscillators for self-sustaining scheduling (INTEGRATED)
5
- *
6
- * Implements temporal patterns for CI/CD optimization using time crystal concepts.
7
- * The system identifies periodic patterns in build/test execution, predicts optimal
8
- * execution windows, and coordinates scheduling for maximum throughput.
9
- *
10
- * Key Concepts:
11
- * - TemporalAttractor: Stable states the system evolves toward (stable, degraded, chaotic)
12
- * - TimeCrystalPhase: Periodic patterns in CI/CD execution
13
- * - CrystalLattice: Network of temporal dependencies between tests
14
- * - TimeCrystalController: Orchestrates temporal coordination
15
- * - KuramotoCPG: Self-sustaining oscillator-based scheduler (from kuramoto-cpg.ts)
16
- *
17
- * Integration Points:
18
- * - StrangeLoopController: Feedback for self-healing decisions
19
- * - MinCutHealthMonitor: Health metrics for stability assessment
20
- * - TestFailureCausalGraph: Failure prediction and prevention
21
- * - KuramotoCPG: Self-sustaining phase transitions without external timers
22
- *
23
- * Reference: RuVector Time Crystal Pattern (time_crystal.rs)
4
+ * ADR-032: Kuramoto CPG oscillators for self-sustaining scheduling
24
5
  */
25
6
  import { EventBus } from '../../kernel/interfaces';
26
7
  import type { StrangeLoopController } from './strange-loop';
27
8
  import type { MinCutHealthMonitor } from './mincut-health-monitor';
28
9
  import type { TestFailureCausalGraph } from './causal-discovery';
29
- import { KuramotoCPG, type CPGTestPhase, type CPGPhaseResult, type CPGConfig } from './kuramoto-cpg';
30
- /**
31
- * Temporal attractors - states the CI/CD system naturally evolves toward
32
- */
33
- export type TemporalAttractor = 'stable' | 'degraded' | 'chaotic';
34
- /**
35
- * Phase state in the time crystal
36
- */
37
- export type PhaseState = 'dormant' | 'activating' | 'active' | 'completing' | 'cooldown';
38
- /**
39
- * CI/CD execution metrics for a time window
40
- */
41
- export interface ExecutionMetrics {
42
- /** Timestamp of the metrics */
43
- readonly timestamp: Date;
44
- /** Number of builds executed */
45
- readonly buildCount: number;
46
- /** Number of successful builds */
47
- readonly successfulBuilds: number;
48
- /** Number of tests executed */
49
- readonly testCount: number;
50
- /** Number of tests passed */
51
- readonly testsPassed: number;
52
- /** Number of tests failed */
53
- readonly testsFailed: number;
54
- /** Average build duration (ms) */
55
- readonly avgBuildDuration: number;
56
- /** Average test duration (ms) */
57
- readonly avgTestDuration: number;
58
- /** Resource utilization (0-1) */
59
- readonly resourceUtilization: number;
60
- /** Queue depth (pending items) */
61
- readonly queueDepth: number;
62
- /** Throughput (items/minute) */
63
- readonly throughput: number;
64
- }
65
- /**
66
- * Time crystal phase representing a periodic CI/CD pattern
67
- */
68
- export interface TimeCrystalPhase {
69
- /** Phase ID */
70
- readonly id: string;
71
- /** Phase name */
72
- readonly name: string;
73
- /** Phase state */
74
- state: PhaseState;
75
- /** Phase period (ms) - how long a complete cycle takes */
76
- readonly periodMs: number;
77
- /** Phase offset (ms) - when this phase starts within a cycle */
78
- readonly offsetMs: number;
79
- /** Expected duration (ms) */
80
- readonly expectedDuration: number;
81
- /** Optimal parallelism for this phase */
82
- readonly optimalParallelism: number;
83
- /** Test types typically run in this phase */
84
- readonly testTypes: string[];
85
- /** Historical success rate (0-1) */
86
- successRate: number;
87
- /** Average actual duration (ms) */
88
- avgActualDuration: number;
89
- /** Execution count */
90
- executionCount: number;
91
- /** Last activation timestamp */
92
- lastActivation?: Date;
93
- }
94
- /**
95
- * Temporal dependency between execution units
96
- */
97
- export interface TemporalDependency {
98
- /** Source execution unit ID */
99
- readonly sourceId: string;
100
- /** Target execution unit ID */
101
- readonly targetId: string;
102
- /** Dependency type */
103
- readonly type: 'must-precede' | 'should-precede' | 'independent' | 'conflicts';
104
- /** Dependency strength (0-1) */
105
- readonly strength: number;
106
- /** Historical latency between executions (ms) */
107
- readonly latencyMs: number;
108
- /** Observation count */
109
- observationCount: number;
110
- }
111
- /**
112
- * Crystal lattice - network of temporal dependencies
113
- */
114
- export interface CrystalLattice {
115
- /** All execution units in the lattice */
116
- readonly nodes: Map<string, LatticeNode>;
117
- /** Dependencies between nodes */
118
- readonly dependencies: TemporalDependency[];
119
- /** Computed execution order (mutable for optimization) */
120
- executionOrder: string[];
121
- /** Parallel execution groups (mutable for optimization) */
122
- parallelGroups: string[][];
123
- /** Last optimization timestamp */
124
- lastOptimized: Date;
125
- }
126
- /**
127
- * Node in the crystal lattice
128
- */
129
- export interface LatticeNode {
130
- /** Node ID (test or build unit) */
131
- readonly id: string;
132
- /** Node type */
133
- readonly type: 'test' | 'build' | 'deploy' | 'validate';
134
- /** Average execution time (ms) */
135
- avgExecutionTime: number;
136
- /** Failure probability (0-1) */
137
- failureProbability: number;
138
- /** Priority (higher = execute earlier) */
139
- priority: number;
140
- /** Resource requirements */
141
- readonly resources: {
142
- cpu: number;
143
- memory: number;
144
- io: number;
145
- };
146
- }
147
- /**
148
- * Observation from CI/CD execution
149
- */
150
- export interface CrystalObservation {
151
- /** Observation ID */
152
- readonly id: string;
153
- /** Timestamp */
154
- readonly timestamp: Date;
155
- /** Current attractor state */
156
- readonly attractor: TemporalAttractor;
157
- /** Execution metrics */
158
- readonly metrics: ExecutionMetrics;
159
- /** Active phases */
160
- readonly activePhases: string[];
161
- /** Detected anomalies */
162
- readonly anomalies: CrystalAnomaly[];
163
- /** Predicted next phase */
164
- readonly predictedNextPhase?: string;
165
- /** Confidence in prediction */
166
- readonly predictionConfidence: number;
167
- }
168
- /**
169
- * Anomaly detected in CI/CD patterns
170
- */
171
- export interface CrystalAnomaly {
172
- /** Anomaly type */
173
- readonly type: 'phase-drift' | 'cascade-failure' | 'resource-contention' | 'timeout-spike' | 'throughput-drop';
174
- /** Severity (0-1) */
175
- readonly severity: number;
176
- /** Affected phase/node IDs */
177
- readonly affected: string[];
178
- /** Description */
179
- readonly description: string;
180
- /** Suggested action */
181
- readonly suggestion: string;
182
- }
183
- /**
184
- * Optimization action for the scheduler
185
- */
186
- export type ScheduleOptimization = {
187
- readonly type: 'reorder';
188
- readonly newOrder: string[];
189
- } | {
190
- readonly type: 'parallelize';
191
- readonly groups: string[][];
192
- } | {
193
- readonly type: 'delay';
194
- readonly nodeId: string;
195
- readonly delayMs: number;
196
- } | {
197
- readonly type: 'skip';
198
- readonly nodeId: string;
199
- readonly reason: string;
200
- } | {
201
- readonly type: 'retry';
202
- readonly nodeId: string;
203
- readonly maxAttempts: number;
204
- } | {
205
- readonly type: 'no_change';
206
- readonly reason: string;
207
- };
208
- /**
209
- * Stabilization action to move toward stable attractor
210
- */
211
- export type StabilizationAction = {
212
- readonly type: 'reduce_parallelism';
213
- readonly by: number;
214
- } | {
215
- readonly type: 'increase_parallelism';
216
- readonly by: number;
217
- } | {
218
- readonly type: 'isolate_flaky';
219
- readonly testIds: string[];
220
- } | {
221
- readonly type: 'warm_cache';
222
- readonly cacheKeys: string[];
223
- } | {
224
- readonly type: 'clear_queue';
225
- readonly reason: string;
226
- } | {
227
- readonly type: 'throttle';
228
- readonly durationMs: number;
229
- } | {
230
- readonly type: 'no_action';
231
- readonly reason: string;
232
- };
233
- /**
234
- * Interface for executing test phases
235
- * Allows dependency injection of test execution strategy
236
- */
237
- export interface PhaseExecutor {
238
- /**
239
- * Execute tests for a given phase
240
- * @param phase - The CPG test phase to execute
241
- * @returns Promise resolving to phase execution result
242
- */
243
- execute(phase: CPGTestPhase): Promise<CPGPhaseResult>;
244
- /**
245
- * Check if executor is ready to run tests
246
- */
247
- isReady(): boolean;
248
- /**
249
- * Get executor name for logging
250
- */
251
- getName(): string;
252
- }
253
- /**
254
- * Default phase executor that simulates test execution
255
- * Replace with real test runner integration in production
256
- */
257
- export declare class DefaultPhaseExecutor implements PhaseExecutor {
258
- private readonly name;
259
- private ready;
260
- constructor(name?: string);
261
- execute(phase: CPGTestPhase): Promise<CPGPhaseResult>;
262
- isReady(): boolean;
263
- getName(): string;
264
- setReady(ready: boolean): void;
265
- }
266
- /**
267
- * Time crystal controller configuration
268
- */
269
- export interface TimeCrystalConfig {
270
- /** Enable time crystal coordination */
271
- enabled: boolean;
272
- /** Observation interval (ms) */
273
- observationIntervalMs: number;
274
- /** Phase detection window (ms) */
275
- phaseDetectionWindowMs: number;
276
- /** Minimum observations for pattern detection */
277
- minObservationsForPattern: number;
278
- /** Anomaly detection sensitivity (0-1, higher = more sensitive) */
279
- anomalySensitivity: number;
280
- /** Stability threshold for attractor detection */
281
- stabilityThreshold: number;
282
- /** Maximum parallel execution groups */
283
- maxParallelGroups: number;
284
- /** Prediction horizon (ms) */
285
- predictionHorizonMs: number;
286
- /** Enable automatic optimization */
287
- autoOptimize: boolean;
288
- /** Enable automatic stabilization */
289
- autoStabilize: boolean;
290
- /** Enable Kuramoto CPG-driven phase scheduling */
291
- useCPGScheduling: boolean;
292
- /** CPG configuration override (uses DEFAULT_CPG_CONFIG if not provided) */
293
- cpgConfig?: Partial<CPGConfig>;
294
- /** CPG test phases override (uses DEFAULT_CPG_TEST_PHASES if not provided) */
295
- cpgPhases?: CPGTestPhase[];
296
- }
297
- /**
298
- * Default time crystal configuration
299
- */
300
- export declare const DEFAULT_TIME_CRYSTAL_CONFIG: TimeCrystalConfig;
301
- /**
302
- * Time crystal event types
303
- */
304
- export type TimeCrystalEventType = 'crystal.observation' | 'crystal.phase.activated' | 'crystal.phase.completed' | 'crystal.attractor.changed' | 'crystal.anomaly.detected' | 'crystal.optimization.applied' | 'crystal.stabilization.applied' | 'crystal.cpg.tick' | 'crystal.cpg.transition' | 'crystal.cpg.started' | 'crystal.cpg.stopped' | 'crystal.cpg.repair';
10
+ import { KuramotoCPG } from './kuramoto-cpg';
11
+ export { TIME_CRYSTAL_SOURCE, type TemporalAttractor, type PhaseState, type ExecutionMetrics, type TimeCrystalPhase, type TemporalDependency, type CrystalLattice, type LatticeNode, type CrystalObservation, type CrystalAnomaly, type ScheduleOptimization, type StabilizationAction, type PhaseExecutor, type TimeCrystalConfig, type TimeCrystalEventType, DEFAULT_TIME_CRYSTAL_CONFIG, } from './time-crystal-types';
12
+ export { DefaultPhaseExecutor, createDefaultPhaseExecutor } from './phase-executor';
13
+ import { type TemporalAttractor, type TimeCrystalPhase, type TemporalDependency, type CrystalLattice, type LatticeNode, type CrystalObservation, type ScheduleOptimization, type StabilizationAction, type PhaseExecutor, type TimeCrystalConfig } from './time-crystal-types';
305
14
  /**
306
15
  * Time Crystal Controller - Orchestrates temporal CI/CD coordination
307
16
  *
@@ -319,10 +28,6 @@ export declare class TimeCrystalController {
319
28
  private cpgStartPromise;
320
29
  private db;
321
30
  private persistCount;
322
- private static readonly KV_NAMESPACE;
323
- private static readonly KV_KEY;
324
- private static readonly KV_TTL;
325
- private static readonly PERSIST_INTERVAL;
326
31
  private running;
327
32
  private observationTimer;
328
33
  private observations;
@@ -332,176 +37,41 @@ export declare class TimeCrystalController {
332
37
  private metricsHistory;
333
38
  private stats;
334
39
  constructor(config?: Partial<TimeCrystalConfig>, eventBus?: EventBus, strangeLoop?: StrangeLoopController, healthMonitor?: MinCutHealthMonitor, causalGraph?: TestFailureCausalGraph, phaseExecutor?: PhaseExecutor);
335
- /**
336
- * Handle CPG phase transition - execute tests and feed results back
337
- * This is the REAL integration point between oscillators and test execution
338
- */
339
40
  private handleCPGTransition;
340
- /**
341
- * Start the time crystal controller
342
- *
343
- * When useCPGScheduling is enabled, the Kuramoto CPG drives phase transitions
344
- * through coupled oscillator dynamics rather than external timers.
345
- */
346
41
  start(): void;
347
- /**
348
- * Stop the time crystal controller
349
- */
350
42
  stop(): void;
351
- /**
352
- * Pause CPG scheduling (observation continues)
353
- */
354
43
  pauseCPG(): void;
355
- /**
356
- * Resume CPG scheduling
357
- */
358
44
  resumeCPG(): void;
359
- /**
360
- * Get the Kuramoto CPG instance for direct access
361
- */
362
45
  getCPG(): KuramotoCPG;
363
- /**
364
- * Get the phase executor instance
365
- */
366
46
  getPhaseExecutor(): PhaseExecutor;
367
- /**
368
- * Check if running
369
- */
370
47
  isRunning(): boolean;
371
- /**
372
- * Run one complete time crystal cycle
373
- */
374
48
  runCycle(): Promise<CrystalObservation>;
375
- /**
376
- * OBSERVE phase: Collect current CI/CD execution metrics
377
- */
378
49
  observe(): Promise<CrystalObservation>;
379
- /**
380
- * Collect current execution metrics
381
- */
382
- private collectMetrics;
383
- /**
384
- * Detect the current attractor state
385
- */
386
- private detectAttractor;
387
- /**
388
- * Identify currently active phases
389
- */
390
50
  private identifyActivePhases;
391
- /**
392
- * Detect anomalies in the metrics
393
- */
394
- private detectAnomalies;
395
- /**
396
- * PREDICT phase: Forecast the next phase based on history
397
- */
398
51
  predictPhase(): {
399
52
  phase: string | undefined;
400
53
  confidence: number;
401
54
  };
402
- /**
403
- * OPTIMIZE phase: Adjust scheduling for optimal throughput
404
- */
405
55
  optimize(): Promise<ScheduleOptimization>;
406
- /**
407
- * Compute optimal execution order
408
- */
409
- private computeOptimalOrder;
410
- /**
411
- * Topological sort respecting dependencies
412
- */
413
- private topologicalSort;
414
- /**
415
- * Compute parallel execution groups
416
- */
417
- private computeParallelGroups;
418
- /**
419
- * Check if two execution orders differ significantly
420
- */
421
- private ordersDiffer;
422
- /**
423
- * STABILIZE phase: Apply actions to move toward stable attractor
424
- */
425
56
  stabilize(): Promise<StabilizationAction>;
426
- /**
427
- * Initialize default CI/CD phases
428
- */
429
57
  private initializeDefaultPhases;
430
- /**
431
- * Activate a phase
432
- */
433
58
  activatePhase(phaseId: string): boolean;
434
- /**
435
- * Complete a phase
436
- */
437
59
  completePhase(phaseId: string, success: boolean, actualDuration: number): boolean;
438
- /**
439
- * Get a phase by ID
440
- */
441
60
  getPhase(phaseId: string): TimeCrystalPhase | undefined;
442
- /**
443
- * Get all phases
444
- */
445
61
  getAllPhases(): TimeCrystalPhase[];
446
- /**
447
- * Add a node to the lattice
448
- */
449
62
  addLatticeNode(node: LatticeNode): void;
450
- /**
451
- * Add a dependency to the lattice
452
- */
453
63
  addDependency(dependency: TemporalDependency): void;
454
- /**
455
- * Get the current lattice
456
- */
457
64
  getLattice(): CrystalLattice;
458
- /**
459
- * Rebuild the lattice from causal graph
460
- */
461
65
  rebuildLatticeFromTestFailureCausalGraph(): void;
462
- /**
463
- * Get current attractor state
464
- */
465
66
  getCurrentAttractor(): TemporalAttractor;
466
- /**
467
- * Get recent observations
468
- */
469
67
  getObservations(limit?: number): CrystalObservation[];
470
- /**
471
- * Get statistics
472
- */
473
68
  getStats(): typeof this.stats;
474
- /**
475
- * Get configuration
476
- */
477
69
  getConfig(): TimeCrystalConfig;
478
- /**
479
- * Initialize kv_store persistence and restore snapshot if available
480
- */
481
70
  initializeDb(): Promise<void>;
482
- /**
483
- * Persist current state snapshot to kv_store
484
- */
485
- private persistToKv;
486
- /**
487
- * Load state snapshot from kv_store
488
- */
489
- private loadFromKv;
490
- /**
491
- * Track state changes and persist periodically
492
- */
71
+ private applySnapshot;
493
72
  private maybePeristToKv;
494
- /**
495
- * Emit a time crystal event
496
- */
497
73
  private emitEvent;
498
74
  }
499
- /**
500
- * Create a Time Crystal controller
501
- */
75
+ /** Create a Time Crystal controller */
502
76
  export declare function createTimeCrystalController(config?: Partial<TimeCrystalConfig>, eventBus?: EventBus, strangeLoop?: StrangeLoopController, healthMonitor?: MinCutHealthMonitor, causalGraph?: TestFailureCausalGraph, phaseExecutor?: PhaseExecutor): TimeCrystalController;
503
- /**
504
- * Create a default phase executor
505
- */
506
- export declare function createDefaultPhaseExecutor(name?: string): DefaultPhaseExecutor;
507
77
  //# sourceMappingURL=time-crystal.d.ts.map