agentic-qe 3.6.0 → 3.6.2

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 (204) hide show
  1. package/.claude/agents/v3/qe-devils-advocate.md +218 -0
  2. package/.claude/agents/v3/qe-quality-criteria-recommender.md +2 -2
  3. package/.claude/skills/qe-iterative-loop/SKILL.md +1 -1
  4. package/.claude/skills/release/SKILL.md +17 -31
  5. package/.claude/skills/skills-manifest.json +1 -1
  6. package/README.md +38 -35
  7. package/package.json +1 -1
  8. package/scripts/cloud-db-config.json +1 -1
  9. package/v3/CHANGELOG.md +44 -0
  10. package/v3/README.md +7 -7
  11. package/v3/assets/agents/v3/qe-devils-advocate.md +218 -0
  12. package/v3/assets/agents/v3/qe-quality-criteria-recommender.md +2 -2
  13. package/v3/assets/skills/qe-iterative-loop/SKILL.md +1 -1
  14. package/v3/dist/agents/devils-advocate/agent.d.ts +103 -0
  15. package/v3/dist/agents/devils-advocate/agent.d.ts.map +1 -0
  16. package/v3/dist/agents/devils-advocate/agent.js +240 -0
  17. package/v3/dist/agents/devils-advocate/agent.js.map +1 -0
  18. package/v3/dist/agents/devils-advocate/index.d.ts +60 -0
  19. package/v3/dist/agents/devils-advocate/index.d.ts.map +1 -0
  20. package/v3/dist/agents/devils-advocate/index.js +72 -0
  21. package/v3/dist/agents/devils-advocate/index.js.map +1 -0
  22. package/v3/dist/agents/devils-advocate/strategies.d.ts +59 -0
  23. package/v3/dist/agents/devils-advocate/strategies.d.ts.map +1 -0
  24. package/v3/dist/agents/devils-advocate/strategies.js +438 -0
  25. package/v3/dist/agents/devils-advocate/strategies.js.map +1 -0
  26. package/v3/dist/agents/devils-advocate/types.d.ts +182 -0
  27. package/v3/dist/agents/devils-advocate/types.d.ts.map +1 -0
  28. package/v3/dist/agents/devils-advocate/types.js +96 -0
  29. package/v3/dist/agents/devils-advocate/types.js.map +1 -0
  30. package/v3/dist/agents/index.d.ts +20 -0
  31. package/v3/dist/agents/index.d.ts.map +1 -0
  32. package/v3/dist/agents/index.js +20 -0
  33. package/v3/dist/agents/index.js.map +1 -0
  34. package/v3/dist/cli/bundle.js +4489 -119
  35. package/v3/dist/coordination/agent-teams/adapter.d.ts +108 -0
  36. package/v3/dist/coordination/agent-teams/adapter.d.ts.map +1 -0
  37. package/v3/dist/coordination/agent-teams/adapter.js +316 -0
  38. package/v3/dist/coordination/agent-teams/adapter.js.map +1 -0
  39. package/v3/dist/coordination/agent-teams/domain-team-manager.d.ts +164 -0
  40. package/v3/dist/coordination/agent-teams/domain-team-manager.d.ts.map +1 -0
  41. package/v3/dist/coordination/agent-teams/domain-team-manager.js +342 -0
  42. package/v3/dist/coordination/agent-teams/domain-team-manager.js.map +1 -0
  43. package/v3/dist/coordination/agent-teams/index.d.ts +53 -0
  44. package/v3/dist/coordination/agent-teams/index.d.ts.map +1 -0
  45. package/v3/dist/coordination/agent-teams/index.js +61 -0
  46. package/v3/dist/coordination/agent-teams/index.js.map +1 -0
  47. package/v3/dist/coordination/agent-teams/mailbox.d.ts +142 -0
  48. package/v3/dist/coordination/agent-teams/mailbox.d.ts.map +1 -0
  49. package/v3/dist/coordination/agent-teams/mailbox.js +395 -0
  50. package/v3/dist/coordination/agent-teams/mailbox.js.map +1 -0
  51. package/v3/dist/coordination/agent-teams/tracing.d.ts +199 -0
  52. package/v3/dist/coordination/agent-teams/tracing.d.ts.map +1 -0
  53. package/v3/dist/coordination/agent-teams/tracing.js +308 -0
  54. package/v3/dist/coordination/agent-teams/tracing.js.map +1 -0
  55. package/v3/dist/coordination/agent-teams/types.d.ts +121 -0
  56. package/v3/dist/coordination/agent-teams/types.d.ts.map +1 -0
  57. package/v3/dist/coordination/agent-teams/types.js +17 -0
  58. package/v3/dist/coordination/agent-teams/types.js.map +1 -0
  59. package/v3/dist/coordination/circuit-breaker/breaker-registry.d.ts +146 -0
  60. package/v3/dist/coordination/circuit-breaker/breaker-registry.d.ts.map +1 -0
  61. package/v3/dist/coordination/circuit-breaker/breaker-registry.js +368 -0
  62. package/v3/dist/coordination/circuit-breaker/breaker-registry.js.map +1 -0
  63. package/v3/dist/coordination/circuit-breaker/domain-circuit-breaker.d.ts +134 -0
  64. package/v3/dist/coordination/circuit-breaker/domain-circuit-breaker.d.ts.map +1 -0
  65. package/v3/dist/coordination/circuit-breaker/domain-circuit-breaker.js +337 -0
  66. package/v3/dist/coordination/circuit-breaker/domain-circuit-breaker.js.map +1 -0
  67. package/v3/dist/coordination/circuit-breaker/index.d.ts +46 -0
  68. package/v3/dist/coordination/circuit-breaker/index.d.ts.map +1 -0
  69. package/v3/dist/coordination/circuit-breaker/index.js +51 -0
  70. package/v3/dist/coordination/circuit-breaker/index.js.map +1 -0
  71. package/v3/dist/coordination/circuit-breaker/types.d.ts +112 -0
  72. package/v3/dist/coordination/circuit-breaker/types.d.ts.map +1 -0
  73. package/v3/dist/coordination/circuit-breaker/types.js +10 -0
  74. package/v3/dist/coordination/circuit-breaker/types.js.map +1 -0
  75. package/v3/dist/coordination/competing-hypotheses/hypothesis-manager.d.ts +122 -0
  76. package/v3/dist/coordination/competing-hypotheses/hypothesis-manager.d.ts.map +1 -0
  77. package/v3/dist/coordination/competing-hypotheses/hypothesis-manager.js +377 -0
  78. package/v3/dist/coordination/competing-hypotheses/hypothesis-manager.js.map +1 -0
  79. package/v3/dist/coordination/competing-hypotheses/index.d.ts +34 -0
  80. package/v3/dist/coordination/competing-hypotheses/index.d.ts.map +1 -0
  81. package/v3/dist/coordination/competing-hypotheses/index.js +39 -0
  82. package/v3/dist/coordination/competing-hypotheses/index.js.map +1 -0
  83. package/v3/dist/coordination/competing-hypotheses/types.d.ts +134 -0
  84. package/v3/dist/coordination/competing-hypotheses/types.d.ts.map +1 -0
  85. package/v3/dist/coordination/competing-hypotheses/types.js +20 -0
  86. package/v3/dist/coordination/competing-hypotheses/types.js.map +1 -0
  87. package/v3/dist/coordination/dynamic-scaling/dynamic-scaler.d.ts +173 -0
  88. package/v3/dist/coordination/dynamic-scaling/dynamic-scaler.d.ts.map +1 -0
  89. package/v3/dist/coordination/dynamic-scaling/dynamic-scaler.js +368 -0
  90. package/v3/dist/coordination/dynamic-scaling/dynamic-scaler.js.map +1 -0
  91. package/v3/dist/coordination/dynamic-scaling/index.d.ts +38 -0
  92. package/v3/dist/coordination/dynamic-scaling/index.d.ts.map +1 -0
  93. package/v3/dist/coordination/dynamic-scaling/index.js +39 -0
  94. package/v3/dist/coordination/dynamic-scaling/index.js.map +1 -0
  95. package/v3/dist/coordination/dynamic-scaling/types.d.ts +147 -0
  96. package/v3/dist/coordination/dynamic-scaling/types.d.ts.map +1 -0
  97. package/v3/dist/coordination/dynamic-scaling/types.js +40 -0
  98. package/v3/dist/coordination/dynamic-scaling/types.js.map +1 -0
  99. package/v3/dist/coordination/federation/federation-mailbox.d.ts +215 -0
  100. package/v3/dist/coordination/federation/federation-mailbox.d.ts.map +1 -0
  101. package/v3/dist/coordination/federation/federation-mailbox.js +442 -0
  102. package/v3/dist/coordination/federation/federation-mailbox.js.map +1 -0
  103. package/v3/dist/coordination/federation/index.d.ts +38 -0
  104. package/v3/dist/coordination/federation/index.d.ts.map +1 -0
  105. package/v3/dist/coordination/federation/index.js +39 -0
  106. package/v3/dist/coordination/federation/index.js.map +1 -0
  107. package/v3/dist/coordination/federation/types.d.ts +103 -0
  108. package/v3/dist/coordination/federation/types.d.ts.map +1 -0
  109. package/v3/dist/coordination/federation/types.js +20 -0
  110. package/v3/dist/coordination/federation/types.js.map +1 -0
  111. package/v3/dist/coordination/fleet-tiers/index.d.ts +39 -0
  112. package/v3/dist/coordination/fleet-tiers/index.d.ts.map +1 -0
  113. package/v3/dist/coordination/fleet-tiers/index.js +44 -0
  114. package/v3/dist/coordination/fleet-tiers/index.js.map +1 -0
  115. package/v3/dist/coordination/fleet-tiers/tier-config.d.ts +60 -0
  116. package/v3/dist/coordination/fleet-tiers/tier-config.d.ts.map +1 -0
  117. package/v3/dist/coordination/fleet-tiers/tier-config.js +242 -0
  118. package/v3/dist/coordination/fleet-tiers/tier-config.js.map +1 -0
  119. package/v3/dist/coordination/fleet-tiers/tier-selector.d.ts +134 -0
  120. package/v3/dist/coordination/fleet-tiers/tier-selector.d.ts.map +1 -0
  121. package/v3/dist/coordination/fleet-tiers/tier-selector.js +373 -0
  122. package/v3/dist/coordination/fleet-tiers/tier-selector.js.map +1 -0
  123. package/v3/dist/coordination/fleet-tiers/types.d.ts +137 -0
  124. package/v3/dist/coordination/fleet-tiers/types.d.ts.map +1 -0
  125. package/v3/dist/coordination/fleet-tiers/types.js +20 -0
  126. package/v3/dist/coordination/fleet-tiers/types.js.map +1 -0
  127. package/v3/dist/coordination/index.d.ts +16 -0
  128. package/v3/dist/coordination/index.d.ts.map +1 -1
  129. package/v3/dist/coordination/index.js +29 -0
  130. package/v3/dist/coordination/index.js.map +1 -1
  131. package/v3/dist/coordination/queen-coordinator.d.ts +79 -0
  132. package/v3/dist/coordination/queen-coordinator.d.ts.map +1 -1
  133. package/v3/dist/coordination/queen-coordinator.js +363 -0
  134. package/v3/dist/coordination/queen-coordinator.js.map +1 -1
  135. package/v3/dist/coordination/task-dag/dag.d.ts +93 -0
  136. package/v3/dist/coordination/task-dag/dag.d.ts.map +1 -0
  137. package/v3/dist/coordination/task-dag/dag.js +496 -0
  138. package/v3/dist/coordination/task-dag/dag.js.map +1 -0
  139. package/v3/dist/coordination/task-dag/index.d.ts +54 -0
  140. package/v3/dist/coordination/task-dag/index.d.ts.map +1 -0
  141. package/v3/dist/coordination/task-dag/index.js +62 -0
  142. package/v3/dist/coordination/task-dag/index.js.map +1 -0
  143. package/v3/dist/coordination/task-dag/scheduler.d.ts +123 -0
  144. package/v3/dist/coordination/task-dag/scheduler.d.ts.map +1 -0
  145. package/v3/dist/coordination/task-dag/scheduler.js +262 -0
  146. package/v3/dist/coordination/task-dag/scheduler.js.map +1 -0
  147. package/v3/dist/coordination/task-dag/types.d.ts +103 -0
  148. package/v3/dist/coordination/task-dag/types.d.ts.map +1 -0
  149. package/v3/dist/coordination/task-dag/types.js +9 -0
  150. package/v3/dist/coordination/task-dag/types.js.map +1 -0
  151. package/v3/dist/domains/enterprise-integration/services/odata-service.js +3 -3
  152. package/v3/dist/domains/enterprise-integration/services/odata-service.js.map +1 -1
  153. package/v3/dist/domains/enterprise-integration/services/soap-wsdl-service.d.ts.map +1 -1
  154. package/v3/dist/domains/enterprise-integration/services/soap-wsdl-service.js +9 -4
  155. package/v3/dist/domains/enterprise-integration/services/soap-wsdl-service.js.map +1 -1
  156. package/v3/dist/domains/requirements-validation/services/quality-criteria/quality-criteria-service.js +1 -1
  157. package/v3/dist/domains/requirements-validation/services/quality-criteria/quality-criteria-service.js.map +1 -1
  158. package/v3/dist/hooks/index.d.ts +8 -1
  159. package/v3/dist/hooks/index.d.ts.map +1 -1
  160. package/v3/dist/hooks/index.js +8 -1
  161. package/v3/dist/hooks/index.js.map +1 -1
  162. package/v3/dist/hooks/quality-gate-enforcer.d.ts +134 -0
  163. package/v3/dist/hooks/quality-gate-enforcer.d.ts.map +1 -0
  164. package/v3/dist/hooks/quality-gate-enforcer.js +265 -0
  165. package/v3/dist/hooks/quality-gate-enforcer.js.map +1 -0
  166. package/v3/dist/hooks/reasoning-bank-pattern-store.d.ts +60 -0
  167. package/v3/dist/hooks/reasoning-bank-pattern-store.d.ts.map +1 -0
  168. package/v3/dist/hooks/reasoning-bank-pattern-store.js +179 -0
  169. package/v3/dist/hooks/reasoning-bank-pattern-store.js.map +1 -0
  170. package/v3/dist/hooks/task-completed-hook.d.ts +174 -0
  171. package/v3/dist/hooks/task-completed-hook.d.ts.map +1 -0
  172. package/v3/dist/hooks/task-completed-hook.js +330 -0
  173. package/v3/dist/hooks/task-completed-hook.js.map +1 -0
  174. package/v3/dist/hooks/teammate-idle-hook.d.ts +167 -0
  175. package/v3/dist/hooks/teammate-idle-hook.d.ts.map +1 -0
  176. package/v3/dist/hooks/teammate-idle-hook.js +332 -0
  177. package/v3/dist/hooks/teammate-idle-hook.js.map +1 -0
  178. package/v3/dist/index.d.ts +3 -0
  179. package/v3/dist/index.d.ts.map +1 -1
  180. package/v3/dist/index.js +4 -0
  181. package/v3/dist/index.js.map +1 -1
  182. package/v3/dist/init/agents-installer.d.ts +5 -1
  183. package/v3/dist/init/agents-installer.d.ts.map +1 -1
  184. package/v3/dist/init/agents-installer.js +13 -5
  185. package/v3/dist/init/agents-installer.js.map +1 -1
  186. package/v3/dist/init/phases/12-verification.d.ts.map +1 -1
  187. package/v3/dist/init/phases/12-verification.js +13 -1
  188. package/v3/dist/init/phases/12-verification.js.map +1 -1
  189. package/v3/dist/kernel/unified-memory.d.ts.map +1 -1
  190. package/v3/dist/kernel/unified-memory.js +303 -18
  191. package/v3/dist/kernel/unified-memory.js.map +1 -1
  192. package/v3/dist/learning/pattern-store.js +1 -1
  193. package/v3/dist/learning/pattern-store.js.map +1 -1
  194. package/v3/dist/learning/qe-patterns.d.ts +2 -0
  195. package/v3/dist/learning/qe-patterns.d.ts.map +1 -1
  196. package/v3/dist/learning/qe-patterns.js.map +1 -1
  197. package/v3/dist/learning/qe-reasoning-bank.d.ts.map +1 -1
  198. package/v3/dist/learning/qe-reasoning-bank.js +16 -3
  199. package/v3/dist/learning/qe-reasoning-bank.js.map +1 -1
  200. package/v3/dist/mcp/bundle.js +4473 -133
  201. package/v3/dist/sync/cloud/tunnel-manager.d.ts.map +1 -1
  202. package/v3/dist/sync/cloud/tunnel-manager.js +11 -0
  203. package/v3/dist/sync/cloud/tunnel-manager.js.map +1 -1
  204. package/v3/package.json +1 -1
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Agentic QE v3 - Competing Hypotheses Types
3
+ * ADR-064 Phase 4A: Multi-Agent Investigation via Competing Hypotheses
4
+ *
5
+ * Defines types for the competing hypotheses pattern where N agents
6
+ * investigate a defect from different angles in parallel, collect
7
+ * evidence, and the system converges on the strongest hypothesis
8
+ * via evidence scoring.
9
+ */
10
+ /**
11
+ * A hypothesis to investigate.
12
+ * Each hypothesis is assigned to an agent that investigates from a specific angle.
13
+ */
14
+ export interface Hypothesis {
15
+ readonly id: string;
16
+ readonly description: string;
17
+ readonly investigatorAgentId?: string;
18
+ readonly strategy: InvestigationStrategy;
19
+ readonly status: HypothesisStatus;
20
+ readonly evidence: Evidence[];
21
+ readonly confidenceScore: number;
22
+ readonly createdAt: number;
23
+ readonly updatedAt: number;
24
+ }
25
+ /**
26
+ * Lifecycle status of a hypothesis.
27
+ * - pending: Awaiting investigation start
28
+ * - investigating: Agent actively gathering evidence
29
+ * - completed: Agent finished investigation
30
+ * - rejected: Auto-rejected due to low confidence
31
+ */
32
+ export type HypothesisStatus = 'pending' | 'investigating' | 'completed' | 'rejected';
33
+ /**
34
+ * Strategy an agent uses to investigate a hypothesis.
35
+ * Each strategy represents a different investigation angle.
36
+ */
37
+ export type InvestigationStrategy = 'code-analysis' | 'test-execution' | 'log-analysis' | 'dependency-tracing' | 'historical-pattern' | 'adversarial';
38
+ /**
39
+ * Evidence gathered during hypothesis investigation.
40
+ * Each piece of evidence either supports or refutes the hypothesis,
41
+ * with a weight indicating how strongly it does so.
42
+ */
43
+ export interface Evidence {
44
+ readonly id: string;
45
+ readonly hypothesisId: string;
46
+ readonly type: EvidenceType;
47
+ readonly description: string;
48
+ /** Weight from 0 to 1 indicating strength of this evidence */
49
+ readonly weight: number;
50
+ /** Whether this evidence supports (true) or refutes (false) the hypothesis */
51
+ readonly supports: boolean;
52
+ /** Agent or tool that produced this evidence */
53
+ readonly source: string;
54
+ /** Raw evidence data, if any */
55
+ readonly data?: unknown;
56
+ readonly timestamp: number;
57
+ }
58
+ /**
59
+ * Classification of evidence by origin.
60
+ */
61
+ export type EvidenceType = 'test-result' | 'code-match' | 'log-entry' | 'dependency-chain' | 'pattern-match' | 'counter-example';
62
+ /**
63
+ * An investigation session grouping multiple competing hypotheses.
64
+ * Created when a defect or issue needs root cause analysis from
65
+ * multiple angles.
66
+ */
67
+ export interface Investigation {
68
+ readonly id: string;
69
+ readonly taskId: string;
70
+ readonly domain: string;
71
+ readonly description: string;
72
+ readonly hypotheses: Hypothesis[];
73
+ readonly status: InvestigationStatus;
74
+ readonly convergenceResult?: ConvergenceResult;
75
+ readonly maxHypotheses: number;
76
+ readonly convergenceThreshold: number;
77
+ readonly createdAt: number;
78
+ readonly updatedAt: number;
79
+ }
80
+ /**
81
+ * Lifecycle status of an investigation session.
82
+ * - open: Accepting new hypotheses
83
+ * - investigating: Agents actively collecting evidence
84
+ * - converging: Convergence in progress
85
+ * - converged: A winning hypothesis was determined
86
+ * - inconclusive: No clear winner could be determined
87
+ */
88
+ export type InvestigationStatus = 'open' | 'investigating' | 'converging' | 'converged' | 'inconclusive';
89
+ /**
90
+ * Result of hypothesis convergence.
91
+ * Produced when the system evaluates all hypotheses and evidence
92
+ * to determine the most likely root cause.
93
+ */
94
+ export interface ConvergenceResult {
95
+ /** ID of the winning hypothesis, or null if inconclusive */
96
+ readonly winningHypothesisId: string | null;
97
+ /** Confidence score of the winning hypothesis */
98
+ readonly confidence: number;
99
+ /** Human-readable summary of evidence across all hypotheses */
100
+ readonly evidenceSummary: string;
101
+ /** IDs of hypotheses that were rejected */
102
+ readonly rejectedHypotheses: string[];
103
+ /** Method used for convergence */
104
+ readonly method: ConvergenceMethod;
105
+ }
106
+ /**
107
+ * Method used to converge on a winning hypothesis.
108
+ * - evidence-scoring: Winner determined by confidence gap between top two
109
+ * - unanimous: Only one non-rejected hypothesis remained
110
+ * - majority: Multiple hypotheses, but one has clear majority evidence
111
+ * - timeout: Investigation timed out, best available selected
112
+ */
113
+ export type ConvergenceMethod = 'evidence-scoring' | 'unanimous' | 'majority' | 'timeout';
114
+ /**
115
+ * Configuration for the HypothesisManager.
116
+ * Controls how investigations are run and when convergence is triggered.
117
+ */
118
+ export interface CompetingHypothesesConfig {
119
+ /** Maximum number of hypotheses per investigation (default: 5) */
120
+ readonly maxHypothesesPerInvestigation: number;
121
+ /** Minimum confidence gap between top two hypotheses to declare a winner (default: 0.2) */
122
+ readonly convergenceThreshold: number;
123
+ /** Maximum time in ms for an investigation before timeout (default: 300000) */
124
+ readonly investigationTimeoutMs: number;
125
+ /** Minimum evidence pieces needed before convergence can succeed (default: 3) */
126
+ readonly minEvidenceForConvergence: number;
127
+ /** Confidence score below which a hypothesis is auto-rejected (default: 0.15) */
128
+ readonly autoRejectThreshold: number;
129
+ }
130
+ /**
131
+ * Default configuration for the competing hypotheses system.
132
+ */
133
+ export declare const DEFAULT_COMPETING_HYPOTHESES_CONFIG: CompetingHypothesesConfig;
134
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/coordination/competing-hypotheses/types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Agentic QE v3 - Competing Hypotheses Types
3
+ * ADR-064 Phase 4A: Multi-Agent Investigation via Competing Hypotheses
4
+ *
5
+ * Defines types for the competing hypotheses pattern where N agents
6
+ * investigate a defect from different angles in parallel, collect
7
+ * evidence, and the system converges on the strongest hypothesis
8
+ * via evidence scoring.
9
+ */
10
+ /**
11
+ * Default configuration for the competing hypotheses system.
12
+ */
13
+ export const DEFAULT_COMPETING_HYPOTHESES_CONFIG = {
14
+ maxHypothesesPerInvestigation: 5,
15
+ convergenceThreshold: 0.2,
16
+ investigationTimeoutMs: 300_000, // 5 minutes
17
+ minEvidenceForConvergence: 3,
18
+ autoRejectThreshold: 0.15,
19
+ };
20
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/coordination/competing-hypotheses/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA6KH;;GAEG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAA8B;IAC5E,6BAA6B,EAAE,CAAC;IAChC,oBAAoB,EAAE,GAAG;IACzB,sBAAsB,EAAE,OAAO,EAAE,YAAY;IAC7C,yBAAyB,EAAE,CAAC;IAC5B,mBAAmB,EAAE,IAAI;CAC1B,CAAC"}
@@ -0,0 +1,173 @@
1
+ /**
2
+ * Agentic QE v3 - Dynamic Scaler
3
+ * ADR-064 Phase 4C: Reactive Auto-Scaling Based on Workload Metrics
4
+ *
5
+ * Monitors workload metrics (queue depth, agent utilization, error rates)
6
+ * and produces scaling decisions to adjust agent count within policy bounds.
7
+ * Supports pluggable ScaleExecutor callbacks for integration with the
8
+ * Queen Coordinator or any other agent lifecycle manager.
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * import { createDynamicScaler } from './coordination/dynamic-scaling';
13
+ *
14
+ * const scaler = createDynamicScaler(4); // start with 4 agents
15
+ *
16
+ * // Feed metrics periodically
17
+ * scaler.recordMetrics({
18
+ * queueDepth: 15,
19
+ * activeAgents: 4,
20
+ * idleAgents: 0,
21
+ * avgTaskDurationMs: 2000,
22
+ * errorRate: 0.05,
23
+ * throughput: 12,
24
+ * timestamp: Date.now(),
25
+ * });
26
+ *
27
+ * // Evaluate and optionally execute
28
+ * const decision = scaler.evaluate();
29
+ * if (decision.action !== 'maintain') {
30
+ * await scaler.execute(decision, async (current, target) => {
31
+ * // Integrate with Queen Coordinator to spawn/terminate agents
32
+ * return true;
33
+ * });
34
+ * }
35
+ * ```
36
+ */
37
+ import type { WorkloadMetrics, ScalingDecision, ScalingPolicy, ScalingEvent, ScalerStats, DynamicScalingConfig } from './types';
38
+ /**
39
+ * Callback invoked to execute a scaling action.
40
+ * Returns `true` if the scaling was successful, `false` otherwise.
41
+ *
42
+ * @param currentAgents - Current number of active agents
43
+ * @param targetAgents - Desired number of agents after scaling
44
+ */
45
+ export type ScaleExecutor = (currentAgents: number, targetAgents: number) => Promise<boolean>;
46
+ /**
47
+ * Reactive auto-scaler that evaluates workload metrics against a configurable
48
+ * policy and produces scaling decisions with cooldown protection.
49
+ *
50
+ * Lifecycle:
51
+ * 1. Feed metrics via {@link recordMetrics}
52
+ * 2. Call {@link evaluate} to get a scaling decision
53
+ * 3. Optionally call {@link execute} to apply the decision
54
+ *
55
+ * The scaler maintains sliding-window metric averages and enforces cooldown
56
+ * between scaling actions to prevent oscillation.
57
+ */
58
+ export declare class DynamicScaler {
59
+ private readonly config;
60
+ private policy;
61
+ private readonly metricsHistory;
62
+ private readonly events;
63
+ private lastScaleTime;
64
+ private scaleUpCount;
65
+ private scaleDownCount;
66
+ private totalDecisions;
67
+ private currentAgents;
68
+ private lastDecision?;
69
+ /**
70
+ * Create a new DynamicScaler.
71
+ *
72
+ * @param initialAgents - Starting agent count (defaults to policy minAgents)
73
+ * @param config - Optional partial config to override defaults
74
+ */
75
+ constructor(initialAgents?: number, config?: Partial<DynamicScalingConfig>);
76
+ /**
77
+ * Record a workload metrics sample.
78
+ * Oldest samples are evicted when the history exceeds the configured limit.
79
+ *
80
+ * @param metrics - The metrics snapshot to record
81
+ */
82
+ recordMetrics(metrics: WorkloadMetrics): void;
83
+ /**
84
+ * Evaluate current averaged metrics against the active policy and produce
85
+ * a scaling decision.
86
+ *
87
+ * Decision priority:
88
+ * 1. If cooldown is active, return `maintain`
89
+ * 2. If error rate exceeds threshold, scale up by 2
90
+ * 3. If queue-to-agent ratio exceeds threshold, scale up to meet demand
91
+ * 4. If idle ratio exceeds threshold, scale down by removing half the idle
92
+ * 5. Otherwise, maintain current count
93
+ *
94
+ * Target agent count is always clamped to `[minAgents, maxAgents]`.
95
+ *
96
+ * @returns The scaling decision (does not execute it)
97
+ */
98
+ evaluate(): ScalingDecision;
99
+ /**
100
+ * Execute a scaling decision, optionally delegating to an external executor.
101
+ *
102
+ * If the decision is `maintain`, the event is recorded but no executor is
103
+ * called. For `scale-up` or `scale-down`, the executor is called (if
104
+ * provided) and the internal agent count is updated on success.
105
+ *
106
+ * @param decision - The decision to execute
107
+ * @param executor - Optional callback to perform the actual scaling
108
+ * @returns The scaling event recording the outcome
109
+ */
110
+ execute(decision: ScalingDecision, executor?: ScaleExecutor): Promise<ScalingEvent>;
111
+ /**
112
+ * Replace the active scaling policy.
113
+ * Takes effect on the next {@link evaluate} call.
114
+ *
115
+ * @param policy - The new policy to apply
116
+ */
117
+ setPolicy(policy: ScalingPolicy): void;
118
+ /**
119
+ * Get a snapshot of the current scaling policy.
120
+ *
121
+ * @returns A copy of the active policy
122
+ */
123
+ getPolicy(): ScalingPolicy;
124
+ /**
125
+ * Get the current agent count tracked by this scaler.
126
+ */
127
+ getCurrentAgents(): number;
128
+ /**
129
+ * Get aggregated scaler statistics.
130
+ *
131
+ * @returns Current stats including counts, recent events, and last decision
132
+ */
133
+ getStats(): ScalerStats;
134
+ /**
135
+ * Get a copy of the full metrics history.
136
+ *
137
+ * @returns Array of recorded WorkloadMetrics snapshots
138
+ */
139
+ getMetricsHistory(): readonly WorkloadMetrics[];
140
+ /**
141
+ * Release internal buffers. The scaler should not be used after disposal.
142
+ */
143
+ dispose(): void;
144
+ /**
145
+ * Compute averaged metrics over the most recent `sampleWindowSize` samples.
146
+ * Returns zero-valued metrics if no samples have been recorded.
147
+ */
148
+ private getAverageMetrics;
149
+ /**
150
+ * Record a scaling event, evicting the oldest when the history cap is hit.
151
+ */
152
+ private recordEvent;
153
+ }
154
+ /**
155
+ * Create a new DynamicScaler instance.
156
+ *
157
+ * @param initialAgents - Starting agent count (defaults to 2)
158
+ * @param config - Optional partial config to override defaults
159
+ * @returns A new DynamicScaler instance
160
+ *
161
+ * @example
162
+ * ```typescript
163
+ * // Use all defaults
164
+ * const scaler = createDynamicScaler();
165
+ *
166
+ * // Start with 6 agents, custom history size
167
+ * const customScaler = createDynamicScaler(6, {
168
+ * metricsHistorySize: 200,
169
+ * });
170
+ * ```
171
+ */
172
+ export declare function createDynamicScaler(initialAgents?: number, config?: Partial<DynamicScalingConfig>): DynamicScaler;
173
+ //# sourceMappingURL=dynamic-scaler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-scaler.d.ts","sourceRoot":"","sources":["../../../src/coordination/dynamic-scaling/dynamic-scaler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EAEf,aAAa,EACb,YAAY,EACZ,WAAW,EACX,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAOjB;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,KACjB,OAAO,CAAC,OAAO,CAAC,CAAC;AAMtB;;;;;;;;;;;GAWG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAC9C,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAyB;IACxD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAC7C,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,cAAc,CAAK;IAC3B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,YAAY,CAAC,CAAkB;IAEvC;;;;;OAKG;gBAED,aAAa,GAAE,MAAU,EACzB,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC;IAWxC;;;;;OAKG;IACH,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAW7C;;;;;;;;;;;;;;OAcG;IACH,QAAQ,IAAI,eAAe;IAgG3B;;;;;;;;;;OAUG;IACG,OAAO,CACX,QAAQ,EAAE,eAAe,EACzB,QAAQ,CAAC,EAAE,aAAa,GACvB,OAAO,CAAC,YAAY,CAAC;IA0DxB;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAItC;;;;OAIG;IACH,SAAS,IAAI,aAAa;IAQ1B;;OAEG;IACH,gBAAgB,IAAI,MAAM;IAI1B;;;;OAIG;IACH,QAAQ,IAAI,WAAW;IAYvB;;;;OAIG;IACH,iBAAiB,IAAI,SAAS,eAAe,EAAE;IAQ/C;;OAEG;IACH,OAAO,IAAI,IAAI;IASf;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IA6BzB;;OAEG;IACH,OAAO,CAAC,WAAW;CAMpB;AAMD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,CAAC,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,GACrC,aAAa,CAEf"}