agentic-qe 3.8.5 → 3.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +26 -0
- package/assets/governance/constitution.md +1 -1
- package/assets/governance/shards/chaos-resilience.shard.md +1 -1
- package/assets/governance/shards/code-intelligence.shard.md +1 -1
- package/assets/governance/shards/contract-testing.shard.md +1 -1
- package/assets/governance/shards/coverage-analysis.shard.md +1 -1
- package/assets/governance/shards/defect-intelligence.shard.md +1 -1
- package/assets/governance/shards/learning-optimization.shard.md +1 -1
- package/assets/governance/shards/quality-assessment.shard.md +1 -1
- package/assets/governance/shards/requirements-validation.shard.md +1 -1
- package/assets/governance/shards/security-compliance.shard.md +1 -1
- package/assets/governance/shards/test-execution.shard.md +1 -1
- package/assets/governance/shards/test-generation.shard.md +1 -1
- package/assets/governance/shards/visual-accessibility.shard.md +1 -1
- package/dist/cli/bundle.js +715 -643
- package/dist/cli/command-registry.js +3 -1
- package/dist/cli/completions/index.d.ts +17 -0
- package/dist/cli/completions/index.js +49 -1
- package/dist/cli/handlers/hypergraph-handler.d.ts +27 -0
- package/dist/cli/handlers/hypergraph-handler.js +248 -0
- package/dist/cli/handlers/index.d.ts +1 -0
- package/dist/cli/handlers/index.js +1 -0
- package/dist/coordination/mincut/phase-executor.d.ts +27 -0
- package/dist/coordination/mincut/phase-executor.js +70 -0
- package/dist/coordination/mincut/time-crystal-analysis.d.ts +35 -0
- package/dist/coordination/mincut/time-crystal-analysis.js +237 -0
- package/dist/coordination/mincut/time-crystal-persistence.d.ts +35 -0
- package/dist/coordination/mincut/time-crystal-persistence.js +81 -0
- package/dist/coordination/mincut/time-crystal-scheduling.d.ts +34 -0
- package/dist/coordination/mincut/time-crystal-scheduling.js +213 -0
- package/dist/coordination/mincut/time-crystal-types.d.ts +278 -0
- package/dist/coordination/mincut/time-crystal-types.js +67 -0
- package/dist/coordination/mincut/time-crystal.d.ts +8 -438
- package/dist/coordination/mincut/time-crystal.js +87 -905
- package/dist/coordination/protocols/code-intelligence-index.js +2 -11
- package/dist/domains/code-intelligence/coordinator-hypergraph.js +1 -1
- package/dist/domains/code-intelligence/coordinator.d.ts +5 -0
- package/dist/domains/code-intelligence/coordinator.js +35 -3
- package/dist/init/phases/06-code-intelligence.d.ts +8 -3
- package/dist/init/phases/06-code-intelligence.js +70 -32
- package/dist/learning/agent-routing.d.ts +53 -0
- package/dist/learning/agent-routing.js +142 -0
- package/dist/learning/embedding-utils.d.ts +34 -0
- package/dist/learning/embedding-utils.js +95 -0
- package/dist/learning/pattern-promotion.d.ts +63 -0
- package/dist/learning/pattern-promotion.js +187 -0
- package/dist/learning/pretrained-patterns.d.ts +14 -0
- package/dist/learning/pretrained-patterns.js +726 -0
- package/dist/learning/qe-reasoning-bank-types.d.ts +174 -0
- package/dist/learning/qe-reasoning-bank-types.js +24 -0
- package/dist/learning/qe-reasoning-bank.d.ts +9 -192
- package/dist/learning/qe-reasoning-bank.js +48 -1093
- package/dist/mcp/bundle.js +1084 -1083
- package/dist/mcp/handlers/hypergraph-handler.d.ts +27 -0
- package/dist/mcp/handlers/hypergraph-handler.js +140 -0
- package/dist/mcp/handlers/index.d.ts +1 -0
- package/dist/mcp/handlers/index.js +2 -0
- package/dist/mcp/server.js +19 -0
- package/dist/mcp/tool-scoping.js +5 -0
- package/dist/shared/code-index-extractor.d.ts +23 -0
- package/dist/shared/code-index-extractor.js +101 -0
- package/dist/shared/security/command-validator.js +2 -2
- package/dist/shared/security/input-sanitizer.js +1 -1
- package/dist/shared/security/path-traversal-validator.js +1 -1
- package/dist/shared/security/regex-safety-validator.js +7 -7
- package/package.json +1 -1
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - QE ReasoningBank Types
|
|
3
|
+
* ADR-021: QE ReasoningBank for Pattern Learning
|
|
4
|
+
*
|
|
5
|
+
* Type definitions, configuration, and interfaces for the QE ReasoningBank.
|
|
6
|
+
*/
|
|
7
|
+
import type { QEPattern, QEPatternContext, QEDomain, ProgrammingLanguage, TestFramework, CreateQEPatternOptions } from './qe-patterns.js';
|
|
8
|
+
import type { QEGuidance } from './qe-guidance.js';
|
|
9
|
+
import { checkAntiPatterns } from './qe-guidance.js';
|
|
10
|
+
import type { PatternSearchOptions, PatternSearchResult } from './pattern-store.js';
|
|
11
|
+
import type { Result } from '../shared/types/index.js';
|
|
12
|
+
import type { RvfDualWriter } from '../integrations/ruvector/rvf-dual-writer.js';
|
|
13
|
+
/**
|
|
14
|
+
* QEReasoningBank configuration
|
|
15
|
+
*/
|
|
16
|
+
export interface QEReasoningBankConfig {
|
|
17
|
+
/** Enable pattern learning */
|
|
18
|
+
enableLearning: boolean;
|
|
19
|
+
/** Enable guidance generation */
|
|
20
|
+
enableGuidance: boolean;
|
|
21
|
+
/** Enable task routing */
|
|
22
|
+
enableRouting: boolean;
|
|
23
|
+
/** Embedding dimension (must match HNSW config) */
|
|
24
|
+
embeddingDimension: number;
|
|
25
|
+
/** Use ONNX embeddings (when available) */
|
|
26
|
+
useONNXEmbeddings: boolean;
|
|
27
|
+
/** Maximum patterns to consider for routing */
|
|
28
|
+
maxRoutingCandidates: number;
|
|
29
|
+
/** Weights for routing score calculation */
|
|
30
|
+
routingWeights: {
|
|
31
|
+
similarity: number;
|
|
32
|
+
performance: number;
|
|
33
|
+
capabilities: number;
|
|
34
|
+
};
|
|
35
|
+
/** Pattern store configuration */
|
|
36
|
+
patternStore?: Partial<import('./pattern-store.js').PatternStoreConfig>;
|
|
37
|
+
/** Coherence energy threshold for pattern promotion (ADR-052) */
|
|
38
|
+
coherenceThreshold?: number;
|
|
39
|
+
/** Optional RVF dual-writer for vector replication (Phase 3) */
|
|
40
|
+
rvfDualWriter?: RvfDualWriter;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Default configuration
|
|
44
|
+
*/
|
|
45
|
+
export declare const DEFAULT_QE_REASONING_BANK_CONFIG: QEReasoningBankConfig;
|
|
46
|
+
/**
|
|
47
|
+
* Task routing request
|
|
48
|
+
*/
|
|
49
|
+
export interface QERoutingRequest {
|
|
50
|
+
/** Task description */
|
|
51
|
+
task: string;
|
|
52
|
+
/** Task type hint */
|
|
53
|
+
taskType?: 'test-generation' | 'analysis' | 'debugging' | 'optimization';
|
|
54
|
+
/** Target domain hint */
|
|
55
|
+
domain?: QEDomain;
|
|
56
|
+
/** Required capabilities */
|
|
57
|
+
capabilities?: string[];
|
|
58
|
+
/** Context for matching */
|
|
59
|
+
context?: Partial<QEPatternContext>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Task routing result
|
|
63
|
+
*/
|
|
64
|
+
export interface QERoutingResult {
|
|
65
|
+
/** Recommended agent type */
|
|
66
|
+
recommendedAgent: string;
|
|
67
|
+
/** Confidence in recommendation (0-1) */
|
|
68
|
+
confidence: number;
|
|
69
|
+
/** Alternative agent recommendations */
|
|
70
|
+
alternatives: Array<{
|
|
71
|
+
agent: string;
|
|
72
|
+
score: number;
|
|
73
|
+
}>;
|
|
74
|
+
/** Detected QE domains */
|
|
75
|
+
domains: QEDomain[];
|
|
76
|
+
/** Relevant patterns found */
|
|
77
|
+
patterns: QEPattern[];
|
|
78
|
+
/** Generated guidance */
|
|
79
|
+
guidance: string[];
|
|
80
|
+
/** Reasoning for the recommendation */
|
|
81
|
+
reasoning: string;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Pattern learning outcome
|
|
85
|
+
*/
|
|
86
|
+
export interface LearningOutcome {
|
|
87
|
+
/** Pattern ID that was used */
|
|
88
|
+
patternId: string;
|
|
89
|
+
/** Whether the application was successful */
|
|
90
|
+
success: boolean;
|
|
91
|
+
/** Quality metrics from the outcome */
|
|
92
|
+
metrics?: {
|
|
93
|
+
testsPassed?: number;
|
|
94
|
+
testsFailed?: number;
|
|
95
|
+
coverageImprovement?: number;
|
|
96
|
+
executionTimeMs?: number;
|
|
97
|
+
};
|
|
98
|
+
/** Feedback from the agent or user */
|
|
99
|
+
feedback?: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Pattern promotion blocked event (ADR-052)
|
|
103
|
+
*/
|
|
104
|
+
export interface PromotionBlockedEvent {
|
|
105
|
+
patternId: string;
|
|
106
|
+
patternName: string;
|
|
107
|
+
reason: 'coherence_violation' | 'insufficient_usage' | 'low_quality';
|
|
108
|
+
energy?: number;
|
|
109
|
+
existingPatternConflicts?: string[];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* QEReasoningBank interface
|
|
113
|
+
*/
|
|
114
|
+
export interface IQEReasoningBank {
|
|
115
|
+
/** Initialize the reasoning bank */
|
|
116
|
+
initialize(): Promise<void>;
|
|
117
|
+
/** Store a new pattern */
|
|
118
|
+
storePattern(options: CreateQEPatternOptions): Promise<Result<QEPattern>>;
|
|
119
|
+
/** Search for patterns */
|
|
120
|
+
searchPatterns(query: string | number[], options?: PatternSearchOptions): Promise<Result<PatternSearchResult[]>>;
|
|
121
|
+
/** Get pattern by ID */
|
|
122
|
+
getPattern(id: string): Promise<QEPattern | null>;
|
|
123
|
+
/** Record pattern usage outcome */
|
|
124
|
+
recordOutcome(outcome: LearningOutcome): Promise<Result<void>>;
|
|
125
|
+
/** Route a task to optimal agent */
|
|
126
|
+
routeTask(request: QERoutingRequest): Promise<Result<QERoutingResult>>;
|
|
127
|
+
/** Get guidance for a domain */
|
|
128
|
+
getGuidance(domain: QEDomain, context?: Partial<QEPatternContext>): QEGuidance;
|
|
129
|
+
/** Generate guidance context for Claude */
|
|
130
|
+
generateContext(domain: QEDomain, context?: {
|
|
131
|
+
framework?: TestFramework;
|
|
132
|
+
language?: ProgrammingLanguage;
|
|
133
|
+
}): string;
|
|
134
|
+
/** Check for anti-patterns in content */
|
|
135
|
+
checkAntiPatterns(domain: QEDomain, content: string): ReturnType<typeof checkAntiPatterns>;
|
|
136
|
+
/** Get embedding for text */
|
|
137
|
+
embed(text: string): Promise<number[]>;
|
|
138
|
+
/** Seed cross-domain patterns by transferring from populated domains to related ones */
|
|
139
|
+
seedCrossDomainPatterns(): Promise<{
|
|
140
|
+
transferred: number;
|
|
141
|
+
skipped: number;
|
|
142
|
+
}>;
|
|
143
|
+
/** Get statistics */
|
|
144
|
+
getStats(): Promise<QEReasoningBankStats>;
|
|
145
|
+
/** Dispose the reasoning bank */
|
|
146
|
+
dispose(): Promise<void>;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* QEReasoningBank statistics
|
|
150
|
+
*/
|
|
151
|
+
export interface QEReasoningBankStats {
|
|
152
|
+
/** Total patterns */
|
|
153
|
+
totalPatterns: number;
|
|
154
|
+
/** Patterns by domain */
|
|
155
|
+
byDomain: Record<QEDomain, number>;
|
|
156
|
+
/** Routing requests served */
|
|
157
|
+
routingRequests: number;
|
|
158
|
+
/** Average routing confidence */
|
|
159
|
+
avgRoutingConfidence: number;
|
|
160
|
+
/** Learning outcomes recorded */
|
|
161
|
+
learningOutcomes: number;
|
|
162
|
+
/** Pattern success rate */
|
|
163
|
+
patternSuccessRate: number;
|
|
164
|
+
/** Pattern store stats */
|
|
165
|
+
patternStoreStats: import('./pattern-store.js').PatternStoreStats;
|
|
166
|
+
/** ADR-061: Asymmetric learning metrics (optional, available in RealQEReasoningBank) */
|
|
167
|
+
asymmetricLearning?: {
|
|
168
|
+
failurePenaltyRatio: string;
|
|
169
|
+
quarantinedPatterns: number;
|
|
170
|
+
rehabilitatedPatterns: number;
|
|
171
|
+
avgConfidenceDelta: number;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=qe-reasoning-bank-types.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - QE ReasoningBank Types
|
|
3
|
+
* ADR-021: QE ReasoningBank for Pattern Learning
|
|
4
|
+
*
|
|
5
|
+
* Type definitions, configuration, and interfaces for the QE ReasoningBank.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Default configuration
|
|
9
|
+
*/
|
|
10
|
+
export const DEFAULT_QE_REASONING_BANK_CONFIG = {
|
|
11
|
+
enableLearning: true,
|
|
12
|
+
enableGuidance: true,
|
|
13
|
+
enableRouting: true,
|
|
14
|
+
embeddingDimension: 384, // Native all-MiniLM-L6-v2 dimension — no interpolation needed
|
|
15
|
+
useONNXEmbeddings: true, // ADR-051: Enable ONNX embeddings by default
|
|
16
|
+
maxRoutingCandidates: 10,
|
|
17
|
+
routingWeights: {
|
|
18
|
+
similarity: 0.3,
|
|
19
|
+
performance: 0.4,
|
|
20
|
+
capabilities: 0.3,
|
|
21
|
+
},
|
|
22
|
+
coherenceThreshold: 0.4, // ADR-052: Coherence gate threshold
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=qe-reasoning-bank-types.js.map
|
|
@@ -16,170 +16,10 @@
|
|
|
16
16
|
import type { MemoryBackend, EventBus } from '../kernel/interfaces.js';
|
|
17
17
|
import type { Result } from '../shared/types/index.js';
|
|
18
18
|
import { QEPattern, QEPatternContext, QEDomain, ProgrammingLanguage, TestFramework, CreateQEPatternOptions } from './qe-patterns.js';
|
|
19
|
-
import { QEGuidance
|
|
19
|
+
import { QEGuidance } from './qe-guidance.js';
|
|
20
20
|
import { PatternSearchOptions, PatternSearchResult } from './pattern-store.js';
|
|
21
21
|
import type { RvfDualWriter } from '../integrations/ruvector/rvf-dual-writer.js';
|
|
22
|
-
|
|
23
|
-
* QEReasoningBank configuration
|
|
24
|
-
*/
|
|
25
|
-
export interface QEReasoningBankConfig {
|
|
26
|
-
/** Enable pattern learning */
|
|
27
|
-
enableLearning: boolean;
|
|
28
|
-
/** Enable guidance generation */
|
|
29
|
-
enableGuidance: boolean;
|
|
30
|
-
/** Enable task routing */
|
|
31
|
-
enableRouting: boolean;
|
|
32
|
-
/** Embedding dimension (must match HNSW config) */
|
|
33
|
-
embeddingDimension: number;
|
|
34
|
-
/** Use ONNX embeddings (when available) */
|
|
35
|
-
useONNXEmbeddings: boolean;
|
|
36
|
-
/** Maximum patterns to consider for routing */
|
|
37
|
-
maxRoutingCandidates: number;
|
|
38
|
-
/** Weights for routing score calculation */
|
|
39
|
-
routingWeights: {
|
|
40
|
-
similarity: number;
|
|
41
|
-
performance: number;
|
|
42
|
-
capabilities: number;
|
|
43
|
-
};
|
|
44
|
-
/** Pattern store configuration */
|
|
45
|
-
patternStore?: Partial<import('./pattern-store.js').PatternStoreConfig>;
|
|
46
|
-
/** Coherence energy threshold for pattern promotion (ADR-052) */
|
|
47
|
-
coherenceThreshold?: number;
|
|
48
|
-
/** Optional RVF dual-writer for vector replication (Phase 3) */
|
|
49
|
-
rvfDualWriter?: RvfDualWriter;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Default configuration
|
|
53
|
-
*/
|
|
54
|
-
export declare const DEFAULT_QE_REASONING_BANK_CONFIG: QEReasoningBankConfig;
|
|
55
|
-
/**
|
|
56
|
-
* Task routing request
|
|
57
|
-
*/
|
|
58
|
-
export interface QERoutingRequest {
|
|
59
|
-
/** Task description */
|
|
60
|
-
task: string;
|
|
61
|
-
/** Task type hint */
|
|
62
|
-
taskType?: 'test-generation' | 'analysis' | 'debugging' | 'optimization';
|
|
63
|
-
/** Target domain hint */
|
|
64
|
-
domain?: QEDomain;
|
|
65
|
-
/** Required capabilities */
|
|
66
|
-
capabilities?: string[];
|
|
67
|
-
/** Context for matching */
|
|
68
|
-
context?: Partial<QEPatternContext>;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Task routing result
|
|
72
|
-
*/
|
|
73
|
-
export interface QERoutingResult {
|
|
74
|
-
/** Recommended agent type */
|
|
75
|
-
recommendedAgent: string;
|
|
76
|
-
/** Confidence in recommendation (0-1) */
|
|
77
|
-
confidence: number;
|
|
78
|
-
/** Alternative agent recommendations */
|
|
79
|
-
alternatives: Array<{
|
|
80
|
-
agent: string;
|
|
81
|
-
score: number;
|
|
82
|
-
}>;
|
|
83
|
-
/** Detected QE domains */
|
|
84
|
-
domains: QEDomain[];
|
|
85
|
-
/** Relevant patterns found */
|
|
86
|
-
patterns: QEPattern[];
|
|
87
|
-
/** Generated guidance */
|
|
88
|
-
guidance: string[];
|
|
89
|
-
/** Reasoning for the recommendation */
|
|
90
|
-
reasoning: string;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Pattern learning outcome
|
|
94
|
-
*/
|
|
95
|
-
export interface LearningOutcome {
|
|
96
|
-
/** Pattern ID that was used */
|
|
97
|
-
patternId: string;
|
|
98
|
-
/** Whether the application was successful */
|
|
99
|
-
success: boolean;
|
|
100
|
-
/** Quality metrics from the outcome */
|
|
101
|
-
metrics?: {
|
|
102
|
-
testsPassed?: number;
|
|
103
|
-
testsFailed?: number;
|
|
104
|
-
coverageImprovement?: number;
|
|
105
|
-
executionTimeMs?: number;
|
|
106
|
-
};
|
|
107
|
-
/** Feedback from the agent or user */
|
|
108
|
-
feedback?: string;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Pattern promotion blocked event (ADR-052)
|
|
112
|
-
*/
|
|
113
|
-
export interface PromotionBlockedEvent {
|
|
114
|
-
patternId: string;
|
|
115
|
-
patternName: string;
|
|
116
|
-
reason: 'coherence_violation' | 'insufficient_usage' | 'low_quality';
|
|
117
|
-
energy?: number;
|
|
118
|
-
existingPatternConflicts?: string[];
|
|
119
|
-
}
|
|
120
|
-
/**
|
|
121
|
-
* QEReasoningBank interface
|
|
122
|
-
*/
|
|
123
|
-
export interface IQEReasoningBank {
|
|
124
|
-
/** Initialize the reasoning bank */
|
|
125
|
-
initialize(): Promise<void>;
|
|
126
|
-
/** Store a new pattern */
|
|
127
|
-
storePattern(options: CreateQEPatternOptions): Promise<Result<QEPattern>>;
|
|
128
|
-
/** Search for patterns */
|
|
129
|
-
searchPatterns(query: string | number[], options?: PatternSearchOptions): Promise<Result<PatternSearchResult[]>>;
|
|
130
|
-
/** Get pattern by ID */
|
|
131
|
-
getPattern(id: string): Promise<QEPattern | null>;
|
|
132
|
-
/** Record pattern usage outcome */
|
|
133
|
-
recordOutcome(outcome: LearningOutcome): Promise<Result<void>>;
|
|
134
|
-
/** Route a task to optimal agent */
|
|
135
|
-
routeTask(request: QERoutingRequest): Promise<Result<QERoutingResult>>;
|
|
136
|
-
/** Get guidance for a domain */
|
|
137
|
-
getGuidance(domain: QEDomain, context?: Partial<QEPatternContext>): QEGuidance;
|
|
138
|
-
/** Generate guidance context for Claude */
|
|
139
|
-
generateContext(domain: QEDomain, context?: {
|
|
140
|
-
framework?: TestFramework;
|
|
141
|
-
language?: ProgrammingLanguage;
|
|
142
|
-
}): string;
|
|
143
|
-
/** Check for anti-patterns in content */
|
|
144
|
-
checkAntiPatterns(domain: QEDomain, content: string): ReturnType<typeof checkAntiPatterns>;
|
|
145
|
-
/** Get embedding for text */
|
|
146
|
-
embed(text: string): Promise<number[]>;
|
|
147
|
-
/** Seed cross-domain patterns by transferring from populated domains to related ones */
|
|
148
|
-
seedCrossDomainPatterns(): Promise<{
|
|
149
|
-
transferred: number;
|
|
150
|
-
skipped: number;
|
|
151
|
-
}>;
|
|
152
|
-
/** Get statistics */
|
|
153
|
-
getStats(): Promise<QEReasoningBankStats>;
|
|
154
|
-
/** Dispose the reasoning bank */
|
|
155
|
-
dispose(): Promise<void>;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* QEReasoningBank statistics
|
|
159
|
-
*/
|
|
160
|
-
export interface QEReasoningBankStats {
|
|
161
|
-
/** Total patterns */
|
|
162
|
-
totalPatterns: number;
|
|
163
|
-
/** Patterns by domain */
|
|
164
|
-
byDomain: Record<QEDomain, number>;
|
|
165
|
-
/** Routing requests served */
|
|
166
|
-
routingRequests: number;
|
|
167
|
-
/** Average routing confidence */
|
|
168
|
-
avgRoutingConfidence: number;
|
|
169
|
-
/** Learning outcomes recorded */
|
|
170
|
-
learningOutcomes: number;
|
|
171
|
-
/** Pattern success rate */
|
|
172
|
-
patternSuccessRate: number;
|
|
173
|
-
/** Pattern store stats */
|
|
174
|
-
patternStoreStats: import('./pattern-store.js').PatternStoreStats;
|
|
175
|
-
/** ADR-061: Asymmetric learning metrics (optional, available in RealQEReasoningBank) */
|
|
176
|
-
asymmetricLearning?: {
|
|
177
|
-
failurePenaltyRatio: string;
|
|
178
|
-
quarantinedPatterns: number;
|
|
179
|
-
rehabilitatedPatterns: number;
|
|
180
|
-
avgConfidenceDelta: number;
|
|
181
|
-
};
|
|
182
|
-
}
|
|
22
|
+
import type { QEReasoningBankConfig, QERoutingRequest, QERoutingResult, LearningOutcome, IQEReasoningBank, QEReasoningBankStats } from './qe-reasoning-bank-types.js';
|
|
183
23
|
/**
|
|
184
24
|
* QE ReasoningBank - Pattern learning for quality engineering
|
|
185
25
|
*
|
|
@@ -223,7 +63,6 @@ export declare class QEReasoningBank implements IQEReasoningBank {
|
|
|
223
63
|
*/
|
|
224
64
|
setRvfDualWriter(writer: RvfDualWriter): void;
|
|
225
65
|
private stats;
|
|
226
|
-
private readonly agentCapabilities;
|
|
227
66
|
constructor(memory: MemoryBackend, eventBus?: EventBus | undefined, config?: Partial<QEReasoningBankConfig>, coherenceService?: import("../integrations/coherence/coherence-service.js").ICoherenceService | undefined);
|
|
228
67
|
/**
|
|
229
68
|
* Initialize the reasoning bank
|
|
@@ -265,28 +104,9 @@ export declare class QEReasoningBank implements IQEReasoningBank {
|
|
|
265
104
|
*/
|
|
266
105
|
recordOutcome(outcome: LearningOutcome): Promise<Result<void>>;
|
|
267
106
|
/**
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
* This method implements a two-stage promotion check:
|
|
271
|
-
* 1. Basic criteria (usage and quality) - cheap to check
|
|
272
|
-
* 2. Coherence criteria (only if basic passes) - expensive, requires coherence service
|
|
273
|
-
*
|
|
274
|
-
* @param pattern - Pattern to evaluate for promotion
|
|
275
|
-
* @returns true if pattern should be promoted, false otherwise
|
|
107
|
+
* Get promotion dependencies for the extracted promotion module
|
|
276
108
|
*/
|
|
277
|
-
private
|
|
278
|
-
/**
|
|
279
|
-
* Get all long-term patterns for coherence checking
|
|
280
|
-
*
|
|
281
|
-
* @returns Array of long-term patterns
|
|
282
|
-
*/
|
|
283
|
-
private getLongTermPatterns;
|
|
284
|
-
/**
|
|
285
|
-
* Promote a pattern to long-term storage
|
|
286
|
-
*
|
|
287
|
-
* @param patternId - Pattern ID to promote
|
|
288
|
-
*/
|
|
289
|
-
private promotePattern;
|
|
109
|
+
private getPromotionDeps;
|
|
290
110
|
/**
|
|
291
111
|
* Route a task to optimal agent
|
|
292
112
|
*/
|
|
@@ -313,14 +133,6 @@ export declare class QEReasoningBank implements IQEReasoningBank {
|
|
|
313
133
|
* for ARM64 or when transformers module cannot be loaded.
|
|
314
134
|
*/
|
|
315
135
|
embed(text: string): Promise<number[]>;
|
|
316
|
-
/**
|
|
317
|
-
* Resize embedding to target dimension using averaging or truncation
|
|
318
|
-
*/
|
|
319
|
-
private resizeEmbedding;
|
|
320
|
-
/**
|
|
321
|
-
* Simple hash-based embedding fallback
|
|
322
|
-
*/
|
|
323
|
-
private hashEmbedding;
|
|
324
136
|
/**
|
|
325
137
|
* Get statistics
|
|
326
138
|
*/
|
|
@@ -334,6 +146,11 @@ export declare class QEReasoningBank implements IQEReasoningBank {
|
|
|
334
146
|
* Create a new QEReasoningBank instance
|
|
335
147
|
*/
|
|
336
148
|
export declare function createQEReasoningBank(memory: MemoryBackend, eventBus?: EventBus, config?: Partial<QEReasoningBankConfig>, coherenceService?: import('../integrations/coherence/coherence-service.js').ICoherenceService): QEReasoningBank;
|
|
149
|
+
export { DEFAULT_QE_REASONING_BANK_CONFIG } from './qe-reasoning-bank-types.js';
|
|
150
|
+
export type { QEReasoningBankConfig, QERoutingRequest, QERoutingResult, LearningOutcome, PromotionBlockedEvent, IQEReasoningBank, QEReasoningBankStats, } from './qe-reasoning-bank-types.js';
|
|
151
|
+
export { PRETRAINED_PATTERNS } from './pretrained-patterns.js';
|
|
152
|
+
export { AGENT_CAPABILITIES, RELATED_DOMAINS, calculateAgentScores, } from './agent-routing.js';
|
|
153
|
+
export type { AgentCapabilityProfile, ScoredAgent, RoutingWeights, } from './agent-routing.js';
|
|
337
154
|
export { detectQEDomain, detectQEDomains, mapQEDomainToAQE, applyPatternTemplate, } from './qe-patterns.js';
|
|
338
155
|
export type { QEPattern, QEPatternType, QEDomain, QEPatternContext, ProgrammingLanguage, TestFramework, CreateQEPatternOptions, } from './qe-patterns.js';
|
|
339
156
|
export { getGuidance, getCombinedGuidance, generateGuidanceContext, } from './qe-guidance.js';
|