agentic-qe 3.7.21 → 3.8.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 (164) hide show
  1. package/.claude/helpers/brain-checkpoint.cjs +4 -1
  2. package/.claude/helpers/statusline-v3.cjs +3 -1
  3. package/.claude/skills/skills-manifest.json +1 -1
  4. package/CHANGELOG.md +45 -0
  5. package/README.md +2 -14
  6. package/assets/helpers/statusline-v3.cjs +3 -1
  7. package/dist/cli/brain-commands.js +6 -10
  8. package/dist/cli/bundle.js +7441 -4327
  9. package/dist/cli/commands/audit.d.ts +43 -0
  10. package/dist/cli/commands/audit.js +125 -0
  11. package/dist/cli/commands/hooks.js +29 -6
  12. package/dist/cli/commands/init.js +1 -73
  13. package/dist/cli/commands/learning.js +270 -13
  14. package/dist/cli/commands/ruvector-commands.d.ts +15 -0
  15. package/dist/cli/commands/ruvector-commands.js +271 -0
  16. package/dist/cli/handlers/init-handler.d.ts +0 -1
  17. package/dist/cli/handlers/init-handler.js +0 -6
  18. package/dist/cli/index.js +4 -2
  19. package/dist/context/sources/defect-source.js +2 -2
  20. package/dist/context/sources/memory-source.js +2 -2
  21. package/dist/context/sources/requirements-source.js +2 -2
  22. package/dist/coordination/behavior-tree/decorators.d.ts +108 -0
  23. package/dist/coordination/behavior-tree/decorators.js +251 -0
  24. package/dist/coordination/behavior-tree/index.d.ts +12 -0
  25. package/dist/coordination/behavior-tree/index.js +15 -0
  26. package/dist/coordination/behavior-tree/nodes.d.ts +165 -0
  27. package/dist/coordination/behavior-tree/nodes.js +338 -0
  28. package/dist/coordination/behavior-tree/qe-trees.d.ts +105 -0
  29. package/dist/coordination/behavior-tree/qe-trees.js +181 -0
  30. package/dist/coordination/coherence-action-gate.d.ts +284 -0
  31. package/dist/coordination/coherence-action-gate.js +512 -0
  32. package/dist/coordination/index.d.ts +4 -0
  33. package/dist/coordination/index.js +8 -0
  34. package/dist/coordination/reasoning-qec.d.ts +315 -0
  35. package/dist/coordination/reasoning-qec.js +585 -0
  36. package/dist/coordination/task-executor.d.ts +16 -0
  37. package/dist/coordination/task-executor.js +99 -0
  38. package/dist/coordination/workflow-orchestrator.d.ts +29 -0
  39. package/dist/coordination/workflow-orchestrator.js +42 -0
  40. package/dist/domains/visual-accessibility/cnn-visual-regression.d.ts +135 -0
  41. package/dist/domains/visual-accessibility/cnn-visual-regression.js +327 -0
  42. package/dist/domains/visual-accessibility/index.d.ts +1 -0
  43. package/dist/domains/visual-accessibility/index.js +4 -0
  44. package/dist/governance/coherence-validator.d.ts +112 -0
  45. package/dist/governance/coherence-validator.js +180 -0
  46. package/dist/governance/index.d.ts +1 -0
  47. package/dist/governance/index.js +2 -0
  48. package/dist/governance/witness-chain.d.ts +311 -0
  49. package/dist/governance/witness-chain.js +509 -0
  50. package/dist/init/index.d.ts +0 -2
  51. package/dist/init/index.js +0 -1
  52. package/dist/init/init-wizard-steps.d.ts +10 -0
  53. package/dist/init/init-wizard-steps.js +87 -1
  54. package/dist/init/init-wizard.d.ts +1 -9
  55. package/dist/init/init-wizard.js +3 -69
  56. package/dist/init/orchestrator.js +0 -1
  57. package/dist/init/phases/01-detection.js +0 -27
  58. package/dist/init/phases/07-hooks.js +6 -4
  59. package/dist/init/phases/phase-interface.d.ts +0 -1
  60. package/dist/init/settings-merge.js +1 -1
  61. package/dist/integrations/browser/qe-dashboard/clustering.d.ts +48 -0
  62. package/dist/integrations/browser/qe-dashboard/clustering.js +183 -0
  63. package/dist/integrations/browser/qe-dashboard/index.d.ts +12 -0
  64. package/dist/integrations/browser/qe-dashboard/index.js +15 -0
  65. package/dist/integrations/browser/qe-dashboard/pattern-explorer.d.ts +165 -0
  66. package/dist/integrations/browser/qe-dashboard/pattern-explorer.js +260 -0
  67. package/dist/integrations/browser/qe-dashboard/wasm-vector-store.d.ts +144 -0
  68. package/dist/integrations/browser/qe-dashboard/wasm-vector-store.js +277 -0
  69. package/dist/integrations/ruvector/cognitive-container-codec.d.ts +51 -0
  70. package/dist/integrations/ruvector/cognitive-container-codec.js +180 -0
  71. package/dist/integrations/ruvector/cognitive-container.d.ts +125 -0
  72. package/dist/integrations/ruvector/cognitive-container.js +306 -0
  73. package/dist/integrations/ruvector/coherence-gate.d.ts +309 -0
  74. package/dist/integrations/ruvector/coherence-gate.js +631 -0
  75. package/dist/integrations/ruvector/compressed-hnsw-integration.d.ts +176 -0
  76. package/dist/integrations/ruvector/compressed-hnsw-integration.js +301 -0
  77. package/dist/integrations/ruvector/dither-adapter.d.ts +122 -0
  78. package/dist/integrations/ruvector/dither-adapter.js +295 -0
  79. package/dist/integrations/ruvector/domain-transfer.d.ts +129 -0
  80. package/dist/integrations/ruvector/domain-transfer.js +220 -0
  81. package/dist/integrations/ruvector/feature-flags.d.ts +214 -2
  82. package/dist/integrations/ruvector/feature-flags.js +167 -2
  83. package/dist/integrations/ruvector/filter-adapter.d.ts +71 -0
  84. package/dist/integrations/ruvector/filter-adapter.js +285 -0
  85. package/dist/integrations/ruvector/gnn-wrapper.d.ts +20 -0
  86. package/dist/integrations/ruvector/gnn-wrapper.js +40 -0
  87. package/dist/integrations/ruvector/hnsw-health-monitor.d.ts +237 -0
  88. package/dist/integrations/ruvector/hnsw-health-monitor.js +394 -0
  89. package/dist/integrations/ruvector/index.d.ts +8 -2
  90. package/dist/integrations/ruvector/index.js +18 -2
  91. package/dist/integrations/ruvector/interfaces.d.ts +40 -0
  92. package/dist/integrations/ruvector/sona-persistence.d.ts +54 -0
  93. package/dist/integrations/ruvector/sona-persistence.js +162 -0
  94. package/dist/integrations/ruvector/sona-three-loop.d.ts +392 -0
  95. package/dist/integrations/ruvector/sona-three-loop.js +814 -0
  96. package/dist/integrations/ruvector/sona-wrapper.d.ts +97 -0
  97. package/dist/integrations/ruvector/sona-wrapper.js +147 -3
  98. package/dist/integrations/ruvector/spectral-math.d.ts +101 -0
  99. package/dist/integrations/ruvector/spectral-math.js +254 -0
  100. package/dist/integrations/ruvector/temporal-compression.d.ts +163 -0
  101. package/dist/integrations/ruvector/temporal-compression.js +318 -0
  102. package/dist/integrations/ruvector/thompson-sampler.d.ts +61 -0
  103. package/dist/integrations/ruvector/thompson-sampler.js +118 -0
  104. package/dist/integrations/ruvector/transfer-coherence-stub.d.ts +80 -0
  105. package/dist/integrations/ruvector/transfer-coherence-stub.js +63 -0
  106. package/dist/integrations/ruvector/transfer-verification.d.ts +119 -0
  107. package/dist/integrations/ruvector/transfer-verification.js +115 -0
  108. package/dist/kernel/hnsw-adapter.d.ts +52 -1
  109. package/dist/kernel/hnsw-adapter.js +139 -4
  110. package/dist/kernel/hnsw-index-provider.d.ts +5 -0
  111. package/dist/kernel/native-hnsw-backend.d.ts +110 -0
  112. package/dist/kernel/native-hnsw-backend.js +408 -0
  113. package/dist/kernel/unified-memory.js +5 -6
  114. package/dist/learning/aqe-learning-engine.d.ts +2 -0
  115. package/dist/learning/aqe-learning-engine.js +65 -0
  116. package/dist/learning/experience-capture-middleware.js +20 -0
  117. package/dist/learning/experience-capture.d.ts +10 -0
  118. package/dist/learning/experience-capture.js +34 -0
  119. package/dist/learning/index.d.ts +2 -2
  120. package/dist/learning/index.js +4 -4
  121. package/dist/learning/metrics-tracker.d.ts +11 -0
  122. package/dist/learning/metrics-tracker.js +29 -13
  123. package/dist/learning/pattern-lifecycle.d.ts +30 -1
  124. package/dist/learning/pattern-lifecycle.js +92 -20
  125. package/dist/learning/pattern-store.d.ts +8 -0
  126. package/dist/learning/pattern-store.js +8 -2
  127. package/dist/learning/qe-unified-memory.js +1 -28
  128. package/dist/learning/regret-tracker.d.ts +201 -0
  129. package/dist/learning/regret-tracker.js +361 -0
  130. package/dist/mcp/bundle.js +5915 -474
  131. package/dist/routing/index.d.ts +4 -2
  132. package/dist/routing/index.js +3 -1
  133. package/dist/routing/neural-tiny-dancer-router.d.ts +268 -0
  134. package/dist/routing/neural-tiny-dancer-router.js +514 -0
  135. package/dist/routing/queen-integration.js +5 -5
  136. package/dist/routing/routing-config.d.ts +6 -0
  137. package/dist/routing/routing-config.js +1 -0
  138. package/dist/routing/simple-neural-router.d.ts +76 -0
  139. package/dist/routing/simple-neural-router.js +202 -0
  140. package/dist/routing/tiny-dancer-router.d.ts +20 -1
  141. package/dist/routing/tiny-dancer-router.js +21 -2
  142. package/dist/test-scheduling/dag-attention-scheduler.d.ts +81 -0
  143. package/dist/test-scheduling/dag-attention-scheduler.js +358 -0
  144. package/dist/test-scheduling/dag-attention-types.d.ts +81 -0
  145. package/dist/test-scheduling/dag-attention-types.js +10 -0
  146. package/dist/test-scheduling/index.d.ts +1 -0
  147. package/dist/test-scheduling/index.js +4 -0
  148. package/dist/test-scheduling/pipeline.d.ts +8 -0
  149. package/dist/test-scheduling/pipeline.js +28 -0
  150. package/package.json +6 -2
  151. package/dist/cli/commands/migrate.d.ts +0 -9
  152. package/dist/cli/commands/migrate.js +0 -566
  153. package/dist/init/init-wizard-migration.d.ts +0 -52
  154. package/dist/init/init-wizard-migration.js +0 -345
  155. package/dist/init/migration/config-migrator.d.ts +0 -31
  156. package/dist/init/migration/config-migrator.js +0 -149
  157. package/dist/init/migration/data-migrator.d.ts +0 -72
  158. package/dist/init/migration/data-migrator.js +0 -232
  159. package/dist/init/migration/detector.d.ts +0 -44
  160. package/dist/init/migration/detector.js +0 -105
  161. package/dist/init/migration/index.d.ts +0 -8
  162. package/dist/init/migration/index.js +0 -8
  163. package/dist/learning/v2-to-v3-migration.d.ts +0 -86
  164. package/dist/learning/v2-to-v3-migration.js +0 -529
@@ -18,8 +18,10 @@ export type { SignalSource, RoutingSignal, MergedAgentScore, SignalMergerConfig,
18
18
  export { RoutingFeedbackCollector, createRoutingFeedbackCollector, } from './routing-feedback.js';
19
19
  export { classifyTask, isSimpleTask, requiresOpus, getRecommendedModel, getComplexityScore, COMPLEX_DOMAINS, MODERATE_DOMAINS, COMPLEX_CAPABILITIES, COMPLEXITY_THRESHOLDS, COMPLEXITY_TO_MODEL, } from './task-classifier.js';
20
20
  export type { TaskComplexity, ClaudeModel, ComplexityFactor, ClassificationResult, ClassifiableTask, } from './task-classifier.js';
21
- export { TinyDancerRouter, createTinyDancerRouter, } from './tiny-dancer-router.js';
22
- export type { RouteResult, TinyDancerConfig, RoutingOutcome as TinyDancerRoutingOutcome, RouterStats, } from './tiny-dancer-router.js';
21
+ export { TinyDancerRouter, createTinyDancerRouter, createSmartTinyDancerRouter, } from './tiny-dancer-router.js';
22
+ export type { ITaskRouter, RouteResult, TinyDancerConfig, RoutingOutcome as TinyDancerRoutingOutcome, RouterStats, } from './tiny-dancer-router.js';
23
+ export { NeuralTinyDancerRouter, SimpleNeuralRouter, createNeuralTinyDancerRouter, } from './neural-tiny-dancer-router.js';
24
+ export type { NeuralTinyDancerConfig, ShadowDecisionLog, NeuralRouterStats, EmpiricalConfidenceBounds, ConformalBounds, } from './neural-tiny-dancer-router.js';
23
25
  export { DEFAULT_ROUTING_CONFIG, DEFAULT_CONFIDENCE_THRESHOLDS, DEFAULT_TIER_MAPPING, DEFAULT_COST_OPTIMIZATION, DEFAULT_FALLBACK_CONFIG, loadRoutingConfigFromEnv, mapComplexityToTier, getNextFallbackTier, tierToModel, estimateTaskCost, validateRoutingConfig, } from './routing-config.js';
24
26
  export type { AgentTier, ConfidenceThresholds, ComplexityTierMapping, CostOptimizationConfig, FallbackConfig, RoutingConfig, } from './routing-config.js';
25
27
  export { parseDependenciesFromFrontmatter, buildDependencyGraph, createSpawnPlan, getAgentDependencies, } from './agent-dependency-graph.js';
@@ -21,7 +21,9 @@ export { RoutingFeedbackCollector, createRoutingFeedbackCollector, } from './rou
21
21
  // Task Classifier (TD-002)
22
22
  export { classifyTask, isSimpleTask, requiresOpus, getRecommendedModel, getComplexityScore, COMPLEX_DOMAINS, MODERATE_DOMAINS, COMPLEX_CAPABILITIES, COMPLEXITY_THRESHOLDS, COMPLEXITY_TO_MODEL, } from './task-classifier.js';
23
23
  // TinyDancer Router (TD-003)
24
- export { TinyDancerRouter, createTinyDancerRouter, } from './tiny-dancer-router.js';
24
+ export { TinyDancerRouter, createTinyDancerRouter, createSmartTinyDancerRouter, } from './tiny-dancer-router.js';
25
+ // Neural TinyDancer Router (ADR-082)
26
+ export { NeuralTinyDancerRouter, SimpleNeuralRouter, createNeuralTinyDancerRouter, } from './neural-tiny-dancer-router.js';
25
27
  // Routing Configuration (TD-004)
26
28
  export { DEFAULT_ROUTING_CONFIG, DEFAULT_CONFIDENCE_THRESHOLDS, DEFAULT_TIER_MAPPING, DEFAULT_COST_OPTIMIZATION, DEFAULT_FALLBACK_CONFIG, loadRoutingConfigFromEnv, mapComplexityToTier, getNextFallbackTier, tierToModel, estimateTaskCost, validateRoutingConfig, } from './routing-config.js';
27
29
  // Agent Dependency Graph (Issue #342 Item 2)
@@ -0,0 +1,268 @@
1
+ /**
2
+ * Neural TinyDancer Router - ADR-082
3
+ * Neural Model Routing via FastGRNN-style Network
4
+ *
5
+ * Replaces rule-based complexity thresholds with a lightweight neural network
6
+ * for routing decisions. Implements shadow mode for safe rollout, circuit
7
+ * breaker for reliability, and online learning from outcome feedback.
8
+ *
9
+ * Design:
10
+ * - Input features: [complexityScore, tokenEstimate, domainIndex, historicalSuccessRate]
11
+ * - Hidden layer: 32 units with ReLU activation
12
+ * - Output: softmax probability distribution over [Tier1/haiku, Tier2/sonnet, Tier3/opus]
13
+ * - Shadow mode: first 1000 decisions run both routers, tracks disagreement
14
+ * - Circuit breaker: falls back to rule-based if error rate exceeds threshold
15
+ *
16
+ * @module routing/neural-tiny-dancer-router
17
+ */
18
+ import type { QETask } from './types.js';
19
+ import { type ClassifiableTask, type ClaudeModel, type ClassificationResult } from './task-classifier.js';
20
+ import { TinyDancerRouter, type RouteResult, type TinyDancerConfig } from './tiny-dancer-router.js';
21
+ export { SimpleNeuralRouter } from './simple-neural-router.js';
22
+ import { SimpleNeuralRouter } from './simple-neural-router.js';
23
+ /**
24
+ * Neural router configuration extending TinyDancerConfig
25
+ */
26
+ export interface NeuralTinyDancerConfig extends TinyDancerConfig {
27
+ /** Circuit breaker error rate threshold (default: 0.20) */
28
+ circuitBreakerThreshold?: number;
29
+ /** Learning rate for weight updates (default: 0.01) */
30
+ learningRate?: number;
31
+ /** Force shadow mode on/off (undefined = auto) */
32
+ forceShadowMode?: boolean;
33
+ /** Number of decisions for shadow mode (default: 1000) */
34
+ shadowModeDecisions?: number;
35
+ /** Max disagreement rate to exit shadow mode (default: 0.10) */
36
+ shadowModeMaxDisagreement?: number;
37
+ }
38
+ /**
39
+ * Shadow mode decision log entry
40
+ */
41
+ export interface ShadowDecisionLog {
42
+ /** Task description (truncated) */
43
+ readonly taskDescription: string;
44
+ /** Rule-based router decision */
45
+ readonly ruleDecision: ClaudeModel;
46
+ /** Neural router decision */
47
+ readonly neuralDecision: ClaudeModel;
48
+ /** Whether both routers agreed */
49
+ readonly agreed: boolean;
50
+ /** Neural network confidence for chosen tier */
51
+ readonly neuralConfidence: number;
52
+ /** Timestamp */
53
+ readonly timestamp: Date;
54
+ }
55
+ /**
56
+ * Neural router statistics
57
+ */
58
+ export interface NeuralRouterStats {
59
+ /** Whether shadow mode is active */
60
+ readonly shadowModeActive: boolean;
61
+ /** Total shadow mode decisions made */
62
+ readonly shadowDecisions: number;
63
+ /** Disagreement rate in shadow mode */
64
+ readonly disagreementRate: number;
65
+ /** Whether circuit breaker is tripped */
66
+ readonly circuitBreakerTripped: boolean;
67
+ /** Recent error rate (last N decisions) */
68
+ readonly recentErrorRate: number;
69
+ /** Total neural routing decisions */
70
+ readonly totalNeuralDecisions: number;
71
+ /** Total weight updates from feedback */
72
+ readonly totalWeightUpdates: number;
73
+ /** Whether neural routing is primary */
74
+ readonly neuralPrimary: boolean;
75
+ }
76
+ /**
77
+ * Empirical confidence bounds from historical calibration scores.
78
+ *
79
+ * Note: This is NOT proper conformal prediction (which requires exchangeability
80
+ * guarantees and per-class nonconformity scoring). These are quantile-based
81
+ * intervals from historical routing outcomes.
82
+ */
83
+ export interface EmpiricalConfidenceBounds {
84
+ /** Lower bound of prediction interval */
85
+ readonly lower: number;
86
+ /** Upper bound of prediction interval */
87
+ readonly upper: number;
88
+ /** Coverage level (e.g. 0.90 = 90% prediction interval) */
89
+ readonly coverageLevel: number;
90
+ /** Calibration score (1 - max probability) */
91
+ readonly calibrationScore: number;
92
+ }
93
+ /** Backward-compatible alias */
94
+ export type ConformalBounds = EmpiricalConfidenceBounds;
95
+ /**
96
+ * Neural-enhanced TinyDancer Router
97
+ *
98
+ * Wraps the rule-based TinyDancerRouter with a lightweight neural network
99
+ * that learns optimal routing decisions from outcomes. Operates in shadow
100
+ * mode initially, then transitions to neural-primary when proven reliable.
101
+ *
102
+ * @example
103
+ * ```typescript
104
+ * const router = new NeuralTinyDancerRouter({ learningRate: 0.01 });
105
+ * const result = await router.route(task);
106
+ * // Later, record outcome for learning
107
+ * router.recordNeuralOutcome(task, result, true, 0.95);
108
+ * ```
109
+ */
110
+ export declare class NeuralTinyDancerRouter {
111
+ /** Rule-based fallback router (always available) */
112
+ private readonly ruleRouter;
113
+ /** Neural network for routing decisions */
114
+ private readonly neuralNet;
115
+ /** Configuration */
116
+ private readonly circuitBreakerThreshold;
117
+ private readonly shadowModeDecisionLimit;
118
+ private readonly shadowModeMaxDisagreement;
119
+ /** Shadow mode state */
120
+ private shadowModeActive;
121
+ private shadowDecisions;
122
+ private shadowDisagreements;
123
+ /** Circuit breaker state */
124
+ private circuitBreakerTripped;
125
+ private recentOutcomes;
126
+ /** Tracking */
127
+ private totalNeuralDecisions;
128
+ private totalWeightUpdates;
129
+ private neuralPrimary;
130
+ /** Calibration scores for empirical confidence bounds */
131
+ private calibrationScores;
132
+ private readonly maxCalibrationScores;
133
+ /** Historical success rates by domain for feature extraction */
134
+ private domainSuccessRates;
135
+ /** Config passthrough */
136
+ private readonly config;
137
+ /** Whether native ruvector module is available */
138
+ private nativeRouterAvailable;
139
+ constructor(config?: NeuralTinyDancerConfig);
140
+ /**
141
+ * Check for native router availability.
142
+ *
143
+ * The `@ruvector/tiny-dancer` NAPI package exists but the ARM64 binary
144
+ * is missing from the published package (packaging bug upstream).
145
+ * The TypeScript `SimpleNeuralRouter` IS the production implementation —
146
+ * its 4→32→3 network is too small to benefit from native acceleration.
147
+ */
148
+ private tryLoadNativeRouter;
149
+ /**
150
+ * Route a task to the optimal Claude model.
151
+ *
152
+ * Behavior depends on current mode:
153
+ * - Shadow mode: uses rule-based result, logs neural decision alongside
154
+ * - Neural primary: uses neural decision with rule-based as validation
155
+ * - Circuit breaker tripped: uses rule-based only
156
+ *
157
+ * @param task - The task to route
158
+ * @returns Routing result with model recommendation and confidence
159
+ */
160
+ route(task: QETask | ClassifiableTask): Promise<RouteResult>;
161
+ /**
162
+ * Extract feature vector from a task for neural network input.
163
+ *
164
+ * Features:
165
+ * [0] complexityScore: normalized classification score (0-1)
166
+ * [1] tokenEstimate: estimated token count, normalized (0-1)
167
+ * [2] domainIndex: domain-based complexity signal (0-1)
168
+ * [3] historicalSuccessRate: domain success rate (0-1)
169
+ */
170
+ extractFeatures(task: QETask | ClassifiableTask, classification: ClassificationResult): number[];
171
+ /**
172
+ * Record the outcome of a routing decision for neural learning.
173
+ *
174
+ * Updates both the rule-based router (for stats) and the neural network
175
+ * weights (via policy gradient).
176
+ */
177
+ recordNeuralOutcome(task: QETask | ClassifiableTask, routeResult: RouteResult, success: boolean, qualityScore?: number, actualModelUsed?: ClaudeModel, durationMs?: number): void;
178
+ /**
179
+ * Compute empirical confidence bounds from historical calibration scores.
180
+ *
181
+ * Note: This is NOT proper conformal prediction (which requires exchangeability
182
+ * guarantees and per-class nonconformity scoring). These are quantile-based
183
+ * intervals from historical routing outcomes.
184
+ */
185
+ computeEmpiricalConfidenceBounds(probs: number[]): EmpiricalConfidenceBounds;
186
+ /**
187
+ * Backward-compatible alias for computeEmpiricalConfidenceBounds.
188
+ * @deprecated Use computeEmpiricalConfidenceBounds instead.
189
+ */
190
+ computeConformalBounds(probs: number[]): EmpiricalConfidenceBounds;
191
+ /**
192
+ * Check whether shadow mode should end.
193
+ * Exits when enough decisions made AND disagreement rate is acceptable.
194
+ */
195
+ private evaluateShadowModeExit;
196
+ /**
197
+ * Check circuit breaker and trip if error rate exceeds threshold.
198
+ */
199
+ private checkCircuitBreaker;
200
+ /**
201
+ * Trip the circuit breaker, falling back to rule-based routing.
202
+ */
203
+ private tripCircuitBreaker;
204
+ /**
205
+ * Build reasoning string for neural routing decision
206
+ */
207
+ private buildNeuralReasoning;
208
+ /**
209
+ * Get the index of the maximum value in an array.
210
+ */
211
+ private argmax;
212
+ /**
213
+ * Get neural router statistics
214
+ */
215
+ getNeuralStats(): NeuralRouterStats;
216
+ /**
217
+ * Get shadow mode decision logs
218
+ */
219
+ getShadowDecisionLogs(): readonly ShadowDecisionLog[];
220
+ /**
221
+ * Get the underlying rule-based router (for direct access if needed)
222
+ */
223
+ getRuleRouter(): TinyDancerRouter;
224
+ /**
225
+ * Get the underlying neural network (for serialization/deserialization)
226
+ */
227
+ getNeuralNet(): SimpleNeuralRouter;
228
+ /**
229
+ * Check if native ruvector router is available
230
+ */
231
+ isNativeRouterAvailable(): boolean;
232
+ /**
233
+ * Check if shadow mode is active
234
+ */
235
+ isShadowModeActive(): boolean;
236
+ /**
237
+ * Check if neural routing is primary
238
+ */
239
+ isNeuralPrimary(): boolean;
240
+ /**
241
+ * Check if circuit breaker is tripped
242
+ */
243
+ isCircuitBreakerTripped(): boolean;
244
+ /**
245
+ * Manually reset the circuit breaker
246
+ */
247
+ resetCircuitBreaker(): void;
248
+ /**
249
+ * Get the rule-based router's stats (delegates)
250
+ */
251
+ getStats(): import("./tiny-dancer-router.js").RouterStats;
252
+ /**
253
+ * Get the rule-based router's config (delegates)
254
+ */
255
+ getConfig(): TinyDancerConfig;
256
+ /**
257
+ * Reset all state (both rule-based and neural)
258
+ */
259
+ reset(): void;
260
+ }
261
+ /**
262
+ * Create a new Neural TinyDancer router instance
263
+ *
264
+ * @param config - Neural router configuration
265
+ * @returns Configured Neural TinyDancer router
266
+ */
267
+ export declare function createNeuralTinyDancerRouter(config?: NeuralTinyDancerConfig): NeuralTinyDancerRouter;
268
+ //# sourceMappingURL=neural-tiny-dancer-router.d.ts.map