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.
- package/.claude/helpers/brain-checkpoint.cjs +4 -1
- package/.claude/helpers/statusline-v3.cjs +3 -1
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +45 -0
- package/README.md +2 -14
- package/assets/helpers/statusline-v3.cjs +3 -1
- package/dist/cli/brain-commands.js +6 -10
- package/dist/cli/bundle.js +7441 -4327
- package/dist/cli/commands/audit.d.ts +43 -0
- package/dist/cli/commands/audit.js +125 -0
- package/dist/cli/commands/hooks.js +29 -6
- package/dist/cli/commands/init.js +1 -73
- package/dist/cli/commands/learning.js +270 -13
- package/dist/cli/commands/ruvector-commands.d.ts +15 -0
- package/dist/cli/commands/ruvector-commands.js +271 -0
- package/dist/cli/handlers/init-handler.d.ts +0 -1
- package/dist/cli/handlers/init-handler.js +0 -6
- package/dist/cli/index.js +4 -2
- package/dist/context/sources/defect-source.js +2 -2
- package/dist/context/sources/memory-source.js +2 -2
- package/dist/context/sources/requirements-source.js +2 -2
- package/dist/coordination/behavior-tree/decorators.d.ts +108 -0
- package/dist/coordination/behavior-tree/decorators.js +251 -0
- package/dist/coordination/behavior-tree/index.d.ts +12 -0
- package/dist/coordination/behavior-tree/index.js +15 -0
- package/dist/coordination/behavior-tree/nodes.d.ts +165 -0
- package/dist/coordination/behavior-tree/nodes.js +338 -0
- package/dist/coordination/behavior-tree/qe-trees.d.ts +105 -0
- package/dist/coordination/behavior-tree/qe-trees.js +181 -0
- package/dist/coordination/coherence-action-gate.d.ts +284 -0
- package/dist/coordination/coherence-action-gate.js +512 -0
- package/dist/coordination/index.d.ts +4 -0
- package/dist/coordination/index.js +8 -0
- package/dist/coordination/reasoning-qec.d.ts +315 -0
- package/dist/coordination/reasoning-qec.js +585 -0
- package/dist/coordination/task-executor.d.ts +16 -0
- package/dist/coordination/task-executor.js +99 -0
- package/dist/coordination/workflow-orchestrator.d.ts +29 -0
- package/dist/coordination/workflow-orchestrator.js +42 -0
- package/dist/domains/visual-accessibility/cnn-visual-regression.d.ts +135 -0
- package/dist/domains/visual-accessibility/cnn-visual-regression.js +327 -0
- package/dist/domains/visual-accessibility/index.d.ts +1 -0
- package/dist/domains/visual-accessibility/index.js +4 -0
- package/dist/governance/coherence-validator.d.ts +112 -0
- package/dist/governance/coherence-validator.js +180 -0
- package/dist/governance/index.d.ts +1 -0
- package/dist/governance/index.js +2 -0
- package/dist/governance/witness-chain.d.ts +311 -0
- package/dist/governance/witness-chain.js +509 -0
- package/dist/init/index.d.ts +0 -2
- package/dist/init/index.js +0 -1
- package/dist/init/init-wizard-steps.d.ts +10 -0
- package/dist/init/init-wizard-steps.js +87 -1
- package/dist/init/init-wizard.d.ts +1 -9
- package/dist/init/init-wizard.js +3 -69
- package/dist/init/orchestrator.js +0 -1
- package/dist/init/phases/01-detection.js +0 -27
- package/dist/init/phases/07-hooks.js +6 -4
- package/dist/init/phases/phase-interface.d.ts +0 -1
- package/dist/init/settings-merge.js +1 -1
- package/dist/integrations/browser/qe-dashboard/clustering.d.ts +48 -0
- package/dist/integrations/browser/qe-dashboard/clustering.js +183 -0
- package/dist/integrations/browser/qe-dashboard/index.d.ts +12 -0
- package/dist/integrations/browser/qe-dashboard/index.js +15 -0
- package/dist/integrations/browser/qe-dashboard/pattern-explorer.d.ts +165 -0
- package/dist/integrations/browser/qe-dashboard/pattern-explorer.js +260 -0
- package/dist/integrations/browser/qe-dashboard/wasm-vector-store.d.ts +144 -0
- package/dist/integrations/browser/qe-dashboard/wasm-vector-store.js +277 -0
- package/dist/integrations/ruvector/cognitive-container-codec.d.ts +51 -0
- package/dist/integrations/ruvector/cognitive-container-codec.js +180 -0
- package/dist/integrations/ruvector/cognitive-container.d.ts +125 -0
- package/dist/integrations/ruvector/cognitive-container.js +306 -0
- package/dist/integrations/ruvector/coherence-gate.d.ts +309 -0
- package/dist/integrations/ruvector/coherence-gate.js +631 -0
- package/dist/integrations/ruvector/compressed-hnsw-integration.d.ts +176 -0
- package/dist/integrations/ruvector/compressed-hnsw-integration.js +301 -0
- package/dist/integrations/ruvector/dither-adapter.d.ts +122 -0
- package/dist/integrations/ruvector/dither-adapter.js +295 -0
- package/dist/integrations/ruvector/domain-transfer.d.ts +129 -0
- package/dist/integrations/ruvector/domain-transfer.js +220 -0
- package/dist/integrations/ruvector/feature-flags.d.ts +214 -2
- package/dist/integrations/ruvector/feature-flags.js +167 -2
- package/dist/integrations/ruvector/filter-adapter.d.ts +71 -0
- package/dist/integrations/ruvector/filter-adapter.js +285 -0
- package/dist/integrations/ruvector/gnn-wrapper.d.ts +20 -0
- package/dist/integrations/ruvector/gnn-wrapper.js +40 -0
- package/dist/integrations/ruvector/hnsw-health-monitor.d.ts +237 -0
- package/dist/integrations/ruvector/hnsw-health-monitor.js +394 -0
- package/dist/integrations/ruvector/index.d.ts +8 -2
- package/dist/integrations/ruvector/index.js +18 -2
- package/dist/integrations/ruvector/interfaces.d.ts +40 -0
- package/dist/integrations/ruvector/sona-persistence.d.ts +54 -0
- package/dist/integrations/ruvector/sona-persistence.js +162 -0
- package/dist/integrations/ruvector/sona-three-loop.d.ts +392 -0
- package/dist/integrations/ruvector/sona-three-loop.js +814 -0
- package/dist/integrations/ruvector/sona-wrapper.d.ts +97 -0
- package/dist/integrations/ruvector/sona-wrapper.js +147 -3
- package/dist/integrations/ruvector/spectral-math.d.ts +101 -0
- package/dist/integrations/ruvector/spectral-math.js +254 -0
- package/dist/integrations/ruvector/temporal-compression.d.ts +163 -0
- package/dist/integrations/ruvector/temporal-compression.js +318 -0
- package/dist/integrations/ruvector/thompson-sampler.d.ts +61 -0
- package/dist/integrations/ruvector/thompson-sampler.js +118 -0
- package/dist/integrations/ruvector/transfer-coherence-stub.d.ts +80 -0
- package/dist/integrations/ruvector/transfer-coherence-stub.js +63 -0
- package/dist/integrations/ruvector/transfer-verification.d.ts +119 -0
- package/dist/integrations/ruvector/transfer-verification.js +115 -0
- package/dist/kernel/hnsw-adapter.d.ts +52 -1
- package/dist/kernel/hnsw-adapter.js +139 -4
- package/dist/kernel/hnsw-index-provider.d.ts +5 -0
- package/dist/kernel/native-hnsw-backend.d.ts +110 -0
- package/dist/kernel/native-hnsw-backend.js +408 -0
- package/dist/kernel/unified-memory.js +5 -6
- package/dist/learning/aqe-learning-engine.d.ts +2 -0
- package/dist/learning/aqe-learning-engine.js +65 -0
- package/dist/learning/experience-capture-middleware.js +20 -0
- package/dist/learning/experience-capture.d.ts +10 -0
- package/dist/learning/experience-capture.js +34 -0
- package/dist/learning/index.d.ts +2 -2
- package/dist/learning/index.js +4 -4
- package/dist/learning/metrics-tracker.d.ts +11 -0
- package/dist/learning/metrics-tracker.js +29 -13
- package/dist/learning/pattern-lifecycle.d.ts +30 -1
- package/dist/learning/pattern-lifecycle.js +92 -20
- package/dist/learning/pattern-store.d.ts +8 -0
- package/dist/learning/pattern-store.js +8 -2
- package/dist/learning/qe-unified-memory.js +1 -28
- package/dist/learning/regret-tracker.d.ts +201 -0
- package/dist/learning/regret-tracker.js +361 -0
- package/dist/mcp/bundle.js +5915 -474
- package/dist/routing/index.d.ts +4 -2
- package/dist/routing/index.js +3 -1
- package/dist/routing/neural-tiny-dancer-router.d.ts +268 -0
- package/dist/routing/neural-tiny-dancer-router.js +514 -0
- package/dist/routing/queen-integration.js +5 -5
- package/dist/routing/routing-config.d.ts +6 -0
- package/dist/routing/routing-config.js +1 -0
- package/dist/routing/simple-neural-router.d.ts +76 -0
- package/dist/routing/simple-neural-router.js +202 -0
- package/dist/routing/tiny-dancer-router.d.ts +20 -1
- package/dist/routing/tiny-dancer-router.js +21 -2
- package/dist/test-scheduling/dag-attention-scheduler.d.ts +81 -0
- package/dist/test-scheduling/dag-attention-scheduler.js +358 -0
- package/dist/test-scheduling/dag-attention-types.d.ts +81 -0
- package/dist/test-scheduling/dag-attention-types.js +10 -0
- package/dist/test-scheduling/index.d.ts +1 -0
- package/dist/test-scheduling/index.js +4 -0
- package/dist/test-scheduling/pipeline.d.ts +8 -0
- package/dist/test-scheduling/pipeline.js +28 -0
- package/package.json +6 -2
- package/dist/cli/commands/migrate.d.ts +0 -9
- package/dist/cli/commands/migrate.js +0 -566
- package/dist/init/init-wizard-migration.d.ts +0 -52
- package/dist/init/init-wizard-migration.js +0 -345
- package/dist/init/migration/config-migrator.d.ts +0 -31
- package/dist/init/migration/config-migrator.js +0 -149
- package/dist/init/migration/data-migrator.d.ts +0 -72
- package/dist/init/migration/data-migrator.js +0 -232
- package/dist/init/migration/detector.d.ts +0 -44
- package/dist/init/migration/detector.js +0 -105
- package/dist/init/migration/index.d.ts +0 -8
- package/dist/init/migration/index.js +0 -8
- package/dist/learning/v2-to-v3-migration.d.ts +0 -86
- package/dist/learning/v2-to-v3-migration.js +0 -529
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* V2 Data Migrator
|
|
3
|
-
* Migrates patterns and experiences from v2 to v3 format
|
|
4
|
-
*/
|
|
5
|
-
import { existsSync, copyFileSync, mkdirSync } from 'fs';
|
|
6
|
-
import { join, dirname } from 'path';
|
|
7
|
-
import { toErrorMessage } from '../../shared/error-utils.js';
|
|
8
|
-
import { safeJsonParse } from '../../shared/safe-json.js';
|
|
9
|
-
import { openDatabase } from '../../shared/safe-db.js';
|
|
10
|
-
/**
|
|
11
|
-
* V2 Data Migrator
|
|
12
|
-
*/
|
|
13
|
-
export class V2DataMigrator {
|
|
14
|
-
v2DbPath;
|
|
15
|
-
v3PatternsDbPath;
|
|
16
|
-
onProgress;
|
|
17
|
-
constructor(options) {
|
|
18
|
-
this.v2DbPath = options.v2DbPath;
|
|
19
|
-
this.v3PatternsDbPath = options.v3PatternsDbPath;
|
|
20
|
-
this.onProgress = options.onProgress;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Run migration
|
|
24
|
-
*/
|
|
25
|
-
async migrate() {
|
|
26
|
-
const result = {
|
|
27
|
-
success: false,
|
|
28
|
-
tablesMigrated: [],
|
|
29
|
-
counts: {},
|
|
30
|
-
errors: [],
|
|
31
|
-
};
|
|
32
|
-
// Check source exists
|
|
33
|
-
if (!existsSync(this.v2DbPath)) {
|
|
34
|
-
result.errors.push('V2 database not found');
|
|
35
|
-
return result;
|
|
36
|
-
}
|
|
37
|
-
try {
|
|
38
|
-
// Create backup
|
|
39
|
-
this.report('backup', 'Creating backup of v2 database...');
|
|
40
|
-
const backupPath = await this.createBackup();
|
|
41
|
-
result.backupPath = backupPath;
|
|
42
|
-
// Initialize v3 database
|
|
43
|
-
this.report('init', 'Initializing v3 patterns database...');
|
|
44
|
-
await this.initializeV3Database();
|
|
45
|
-
// Migrate patterns
|
|
46
|
-
this.report('patterns', 'Migrating patterns...');
|
|
47
|
-
const patternsCount = await this.migratePatterns();
|
|
48
|
-
if (patternsCount > 0) {
|
|
49
|
-
result.tablesMigrated.push('patterns');
|
|
50
|
-
result.counts.patterns = patternsCount;
|
|
51
|
-
}
|
|
52
|
-
// Migrate experiences
|
|
53
|
-
this.report('experiences', 'Migrating experiences...');
|
|
54
|
-
const experiencesCount = await this.migrateExperiences();
|
|
55
|
-
if (experiencesCount > 0) {
|
|
56
|
-
result.tablesMigrated.push('experiences');
|
|
57
|
-
result.counts.experiences = experiencesCount;
|
|
58
|
-
}
|
|
59
|
-
// Migrate concept graph
|
|
60
|
-
this.report('concepts', 'Migrating concept graph...');
|
|
61
|
-
const conceptsCount = await this.migrateConceptGraph();
|
|
62
|
-
if (conceptsCount > 0) {
|
|
63
|
-
result.tablesMigrated.push('concept_graph');
|
|
64
|
-
result.counts.concepts = conceptsCount;
|
|
65
|
-
}
|
|
66
|
-
result.success = true;
|
|
67
|
-
this.report('complete', 'Migration completed successfully');
|
|
68
|
-
}
|
|
69
|
-
catch (error) {
|
|
70
|
-
result.errors.push(toErrorMessage(error));
|
|
71
|
-
}
|
|
72
|
-
return result;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Report progress
|
|
76
|
-
*/
|
|
77
|
-
report(stage, message, progress) {
|
|
78
|
-
this.onProgress?.({ stage, message, progress });
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Create backup of v2 database
|
|
82
|
-
*/
|
|
83
|
-
async createBackup() {
|
|
84
|
-
const backupDir = join(dirname(this.v2DbPath), 'backup');
|
|
85
|
-
if (!existsSync(backupDir)) {
|
|
86
|
-
mkdirSync(backupDir, { recursive: true });
|
|
87
|
-
}
|
|
88
|
-
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
89
|
-
const backupPath = join(backupDir, `memory-v2-${timestamp}.db`);
|
|
90
|
-
copyFileSync(this.v2DbPath, backupPath);
|
|
91
|
-
return backupPath;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Initialize v3 patterns database
|
|
95
|
-
*/
|
|
96
|
-
async initializeV3Database() {
|
|
97
|
-
const dir = dirname(this.v3PatternsDbPath);
|
|
98
|
-
if (!existsSync(dir)) {
|
|
99
|
-
mkdirSync(dir, { recursive: true });
|
|
100
|
-
}
|
|
101
|
-
const db = openDatabase(this.v3PatternsDbPath);
|
|
102
|
-
db.exec(`
|
|
103
|
-
CREATE TABLE IF NOT EXISTS patterns (
|
|
104
|
-
id TEXT PRIMARY KEY,
|
|
105
|
-
type TEXT NOT NULL,
|
|
106
|
-
content TEXT NOT NULL,
|
|
107
|
-
embedding BLOB,
|
|
108
|
-
confidence REAL DEFAULT 0.5,
|
|
109
|
-
usage_count INTEGER DEFAULT 0,
|
|
110
|
-
quality_score REAL DEFAULT 0.5,
|
|
111
|
-
domain TEXT,
|
|
112
|
-
metadata TEXT,
|
|
113
|
-
created_at INTEGER DEFAULT (strftime('%s', 'now') * 1000),
|
|
114
|
-
updated_at INTEGER DEFAULT (strftime('%s', 'now') * 1000),
|
|
115
|
-
migrated_from TEXT
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
CREATE TABLE IF NOT EXISTS experiences (
|
|
119
|
-
id TEXT PRIMARY KEY,
|
|
120
|
-
task_type TEXT NOT NULL,
|
|
121
|
-
task_description TEXT,
|
|
122
|
-
agent TEXT,
|
|
123
|
-
outcome TEXT,
|
|
124
|
-
success INTEGER,
|
|
125
|
-
quality_score REAL,
|
|
126
|
-
patterns_used TEXT,
|
|
127
|
-
created_at INTEGER DEFAULT (strftime('%s', 'now') * 1000),
|
|
128
|
-
migrated_from TEXT
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
CREATE INDEX IF NOT EXISTS idx_patterns_domain ON patterns(domain);
|
|
132
|
-
CREATE INDEX IF NOT EXISTS idx_patterns_type ON patterns(type);
|
|
133
|
-
CREATE INDEX IF NOT EXISTS idx_experiences_task_type ON experiences(task_type);
|
|
134
|
-
`);
|
|
135
|
-
db.close();
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Migrate patterns from v2 kv_store
|
|
139
|
-
*/
|
|
140
|
-
async migratePatterns() {
|
|
141
|
-
const v2Db = openDatabase(this.v2DbPath, { readonly: true });
|
|
142
|
-
const v3Db = openDatabase(this.v3PatternsDbPath);
|
|
143
|
-
try {
|
|
144
|
-
// Find patterns in v2 database
|
|
145
|
-
const v2Patterns = v2Db.prepare(`
|
|
146
|
-
SELECT key, namespace, value FROM kv_store
|
|
147
|
-
WHERE namespace LIKE '%pattern%' OR key LIKE '%pattern%'
|
|
148
|
-
`).all();
|
|
149
|
-
let count = 0;
|
|
150
|
-
const insertStmt = v3Db.prepare(`
|
|
151
|
-
INSERT OR IGNORE INTO patterns (id, type, content, domain, metadata, migrated_from)
|
|
152
|
-
VALUES (?, ?, ?, ?, ?, ?)
|
|
153
|
-
`);
|
|
154
|
-
for (const row of v2Patterns) {
|
|
155
|
-
try {
|
|
156
|
-
const data = safeJsonParse(row.value);
|
|
157
|
-
const id = `migrated-${row.namespace}-${row.key}`;
|
|
158
|
-
const type = data.type || 'unknown';
|
|
159
|
-
const content = JSON.stringify(data);
|
|
160
|
-
const domain = row.namespace.replace(':patterns', '') || 'general';
|
|
161
|
-
insertStmt.run(id, type, content, domain, null, `v2:${row.namespace}:${row.key}`);
|
|
162
|
-
count++;
|
|
163
|
-
}
|
|
164
|
-
catch (error) {
|
|
165
|
-
// Non-critical: skip invalid entries during migration
|
|
166
|
-
console.debug('[DataMigrator] Skipped invalid pattern entry:', error instanceof Error ? error.message : error);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
return count;
|
|
170
|
-
}
|
|
171
|
-
finally {
|
|
172
|
-
v2Db.close();
|
|
173
|
-
v3Db.close();
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Migrate experiences from v2
|
|
178
|
-
*/
|
|
179
|
-
async migrateExperiences() {
|
|
180
|
-
const v2Db = openDatabase(this.v2DbPath, { readonly: true });
|
|
181
|
-
const v3Db = openDatabase(this.v3PatternsDbPath);
|
|
182
|
-
try {
|
|
183
|
-
// Find experiences in v2 database
|
|
184
|
-
const v2Experiences = v2Db.prepare(`
|
|
185
|
-
SELECT key, namespace, value FROM kv_store
|
|
186
|
-
WHERE namespace LIKE '%experience%' OR key LIKE '%experience%'
|
|
187
|
-
`).all();
|
|
188
|
-
let count = 0;
|
|
189
|
-
const insertStmt = v3Db.prepare(`
|
|
190
|
-
INSERT OR IGNORE INTO captured_experiences (id, task, agent, domain, success, quality, source)
|
|
191
|
-
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
192
|
-
`);
|
|
193
|
-
for (const row of v2Experiences) {
|
|
194
|
-
try {
|
|
195
|
-
const data = safeJsonParse(row.value);
|
|
196
|
-
const id = `migrated-${row.namespace}-${row.key}`;
|
|
197
|
-
const taskDescription = data.description || data.task || '';
|
|
198
|
-
const agent = data.agent || 'unknown';
|
|
199
|
-
const domain = data.domain || data.taskType || data.task_type || '';
|
|
200
|
-
const success = data.success ? 1 : 0;
|
|
201
|
-
const qualityScore = data.quality || data.qualityScore || 0.5;
|
|
202
|
-
insertStmt.run(id, taskDescription, agent, domain, success, qualityScore, `v2-migration:${row.namespace}:${row.key}`);
|
|
203
|
-
count++;
|
|
204
|
-
}
|
|
205
|
-
catch (error) {
|
|
206
|
-
// Non-critical: skip invalid entries during migration
|
|
207
|
-
console.debug('[DataMigrator] Skipped invalid experience entry:', error instanceof Error ? error.message : error);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
return count;
|
|
211
|
-
}
|
|
212
|
-
finally {
|
|
213
|
-
v2Db.close();
|
|
214
|
-
v3Db.close();
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Migrate concept graph from v2
|
|
219
|
-
*/
|
|
220
|
-
async migrateConceptGraph() {
|
|
221
|
-
// Concept graph migration would be more complex
|
|
222
|
-
// For now, return 0 to indicate no concepts migrated
|
|
223
|
-
return 0;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Create V2 data migrator
|
|
228
|
-
*/
|
|
229
|
-
export function createV2DataMigrator(options) {
|
|
230
|
-
return new V2DataMigrator(options);
|
|
231
|
-
}
|
|
232
|
-
//# sourceMappingURL=data-migrator.js.map
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* V2 Detector
|
|
3
|
-
* Detects existing v2 AQE installations
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* V2 detection information
|
|
7
|
-
*/
|
|
8
|
-
export interface V2DetectionInfo {
|
|
9
|
-
detected: boolean;
|
|
10
|
-
version: string | undefined;
|
|
11
|
-
paths: {
|
|
12
|
-
memoryDb: string | undefined;
|
|
13
|
-
configDir: string | undefined;
|
|
14
|
-
agentsDir: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
assets: {
|
|
17
|
-
hasMemoryDb: boolean;
|
|
18
|
-
hasConfig: boolean;
|
|
19
|
-
hasAgents: boolean;
|
|
20
|
-
hasV2ConfigFiles: boolean;
|
|
21
|
-
hasV3ConfigYaml: boolean;
|
|
22
|
-
};
|
|
23
|
-
isV3Installation: boolean;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* V2 Detector class
|
|
27
|
-
*/
|
|
28
|
-
export declare class V2Detector {
|
|
29
|
-
private projectRoot;
|
|
30
|
-
constructor(projectRoot: string);
|
|
31
|
-
/**
|
|
32
|
-
* Detect v2 installation
|
|
33
|
-
*/
|
|
34
|
-
detect(): Promise<V2DetectionInfo>;
|
|
35
|
-
/**
|
|
36
|
-
* Read version from memory.db
|
|
37
|
-
*/
|
|
38
|
-
private readVersionFromDb;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Create V2 detector
|
|
42
|
-
*/
|
|
43
|
-
export declare function createV2Detector(projectRoot: string): V2Detector;
|
|
44
|
-
//# sourceMappingURL=detector.d.ts.map
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* V2 Detector
|
|
3
|
-
* Detects existing v2 AQE installations
|
|
4
|
-
*/
|
|
5
|
-
import { existsSync } from 'fs';
|
|
6
|
-
import { join } from 'path';
|
|
7
|
-
import { safeJsonParse } from '../../shared/safe-json.js';
|
|
8
|
-
import { openDatabase } from '../../shared/safe-db.js';
|
|
9
|
-
/**
|
|
10
|
-
* V2 Detector class
|
|
11
|
-
*/
|
|
12
|
-
export class V2Detector {
|
|
13
|
-
projectRoot;
|
|
14
|
-
constructor(projectRoot) {
|
|
15
|
-
this.projectRoot = projectRoot;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Detect v2 installation
|
|
19
|
-
*/
|
|
20
|
-
async detect() {
|
|
21
|
-
const memoryDbPath = join(this.projectRoot, '.agentic-qe', 'memory.db');
|
|
22
|
-
const configDir = join(this.projectRoot, '.agentic-qe', 'config');
|
|
23
|
-
const agentsDir = join(this.projectRoot, '.claude', 'agents');
|
|
24
|
-
const v2ConfigFile = join(this.projectRoot, '.agentic-qe', 'config', 'learning.json');
|
|
25
|
-
const v3ConfigYaml = join(this.projectRoot, '.agentic-qe', 'config.yaml');
|
|
26
|
-
const hasMemoryDb = existsSync(memoryDbPath);
|
|
27
|
-
const hasConfig = existsSync(configDir);
|
|
28
|
-
const hasAgents = existsSync(agentsDir);
|
|
29
|
-
const hasV2ConfigFiles = existsSync(v2ConfigFile);
|
|
30
|
-
const hasV3ConfigYaml = existsSync(v3ConfigYaml);
|
|
31
|
-
// Read version from database
|
|
32
|
-
let version;
|
|
33
|
-
let isV3Installation = false;
|
|
34
|
-
if (hasMemoryDb) {
|
|
35
|
-
version = this.readVersionFromDb(memoryDbPath);
|
|
36
|
-
if (version) {
|
|
37
|
-
isV3Installation = version.startsWith('3.');
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
version = '2.x.x';
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
// Determine if v2 detected
|
|
44
|
-
const detected = !isV3Installation && hasMemoryDb && (!version?.startsWith('3.') ||
|
|
45
|
-
(hasV2ConfigFiles && !hasV3ConfigYaml));
|
|
46
|
-
return {
|
|
47
|
-
detected,
|
|
48
|
-
version,
|
|
49
|
-
paths: {
|
|
50
|
-
memoryDb: hasMemoryDb ? memoryDbPath : undefined,
|
|
51
|
-
configDir: hasConfig ? configDir : undefined,
|
|
52
|
-
agentsDir: hasAgents ? agentsDir : undefined,
|
|
53
|
-
},
|
|
54
|
-
assets: {
|
|
55
|
-
hasMemoryDb,
|
|
56
|
-
hasConfig,
|
|
57
|
-
hasAgents,
|
|
58
|
-
hasV2ConfigFiles,
|
|
59
|
-
hasV3ConfigYaml,
|
|
60
|
-
},
|
|
61
|
-
isV3Installation,
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Read version from memory.db
|
|
66
|
-
*/
|
|
67
|
-
readVersionFromDb(dbPath) {
|
|
68
|
-
try {
|
|
69
|
-
const db = openDatabase(dbPath, { readonly: true, fileMustExist: true });
|
|
70
|
-
try {
|
|
71
|
-
const tableExists = db.prepare(`
|
|
72
|
-
SELECT name FROM sqlite_master
|
|
73
|
-
WHERE type='table' AND name='kv_store'
|
|
74
|
-
`).get();
|
|
75
|
-
if (!tableExists) {
|
|
76
|
-
db.close();
|
|
77
|
-
return undefined;
|
|
78
|
-
}
|
|
79
|
-
const row = db.prepare(`
|
|
80
|
-
SELECT value FROM kv_store
|
|
81
|
-
WHERE key = 'aqe_version' AND namespace = '_system'
|
|
82
|
-
`).get();
|
|
83
|
-
db.close();
|
|
84
|
-
if (row) {
|
|
85
|
-
return safeJsonParse(row.value);
|
|
86
|
-
}
|
|
87
|
-
return undefined;
|
|
88
|
-
}
|
|
89
|
-
catch {
|
|
90
|
-
db.close();
|
|
91
|
-
return undefined;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
catch {
|
|
95
|
-
return undefined;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Create V2 detector
|
|
101
|
-
*/
|
|
102
|
-
export function createV2Detector(projectRoot) {
|
|
103
|
-
return new V2Detector(projectRoot);
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=detector.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Migration Module Index
|
|
3
|
-
* Handles v2 to v3 migration
|
|
4
|
-
*/
|
|
5
|
-
export { V2Detector, createV2Detector, type V2DetectionInfo } from './detector.js';
|
|
6
|
-
export { V2DataMigrator, createV2DataMigrator, type MigrationResult } from './data-migrator.js';
|
|
7
|
-
export { V2ConfigMigrator, createV2ConfigMigrator } from './config-migrator.js';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Migration Module Index
|
|
3
|
-
* Handles v2 to v3 migration
|
|
4
|
-
*/
|
|
5
|
-
export { V2Detector, createV2Detector } from './detector.js';
|
|
6
|
-
export { V2DataMigrator, createV2DataMigrator } from './data-migrator.js';
|
|
7
|
-
export { V2ConfigMigrator, createV2ConfigMigrator } from './config-migrator.js';
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* V2 to V3 Data Migration Module
|
|
3
|
-
* ADR-038: V3 QE Memory Unification
|
|
4
|
-
*
|
|
5
|
-
* Migrates data from V2 AQE fleet (.agentic-qe/memory.db) to V3 systems:
|
|
6
|
-
* - patterns → RealQEReasoningBank (.agentic-qe/memory.db)
|
|
7
|
-
* - captured_experiences → QEUnifiedMemory learning domain
|
|
8
|
-
* - learning_experiences → RL training data
|
|
9
|
-
* - concept_nodes/edges → Code intelligence knowledge graph
|
|
10
|
-
*
|
|
11
|
-
* @module migration
|
|
12
|
-
*/
|
|
13
|
-
export interface V2MigrationConfig {
|
|
14
|
-
/** Path to V2 memory.db file */
|
|
15
|
-
v2DbPath: string;
|
|
16
|
-
/** Path to V3 memory.db file */
|
|
17
|
-
v3PatternsDbPath: string;
|
|
18
|
-
/** Progress callback */
|
|
19
|
-
onProgress?: (progress: V2MigrationProgress) => void;
|
|
20
|
-
}
|
|
21
|
-
export interface V2MigrationProgress {
|
|
22
|
-
stage: 'connecting' | 'reading' | 'migrating' | 'validating' | 'complete';
|
|
23
|
-
table?: string;
|
|
24
|
-
current: number;
|
|
25
|
-
total: number;
|
|
26
|
-
message: string;
|
|
27
|
-
}
|
|
28
|
-
export interface V2MigrationResult {
|
|
29
|
-
success: boolean;
|
|
30
|
-
tablesMigrated: string[];
|
|
31
|
-
counts: Record<string, number>;
|
|
32
|
-
errors: string[];
|
|
33
|
-
duration: number;
|
|
34
|
-
}
|
|
35
|
-
export declare class V2ToV3Migrator {
|
|
36
|
-
private readonly config;
|
|
37
|
-
private v2Db;
|
|
38
|
-
private v3Db;
|
|
39
|
-
private startTime;
|
|
40
|
-
constructor(config: V2MigrationConfig);
|
|
41
|
-
/**
|
|
42
|
-
* Execute the full migration
|
|
43
|
-
*/
|
|
44
|
-
migrate(): Promise<V2MigrationResult>;
|
|
45
|
-
/**
|
|
46
|
-
* Safely parse JSON, returning a wrapper object for non-JSON strings
|
|
47
|
-
* Handles V2 data where state/action columns may contain plain strings like "task-started"
|
|
48
|
-
*/
|
|
49
|
-
private safeJsonParse;
|
|
50
|
-
private reportProgress;
|
|
51
|
-
private connect;
|
|
52
|
-
private disconnect;
|
|
53
|
-
private createV3Schema;
|
|
54
|
-
private readV2Data;
|
|
55
|
-
/**
|
|
56
|
-
* Migrate V2 patterns to V3 qe_patterns table
|
|
57
|
-
*/
|
|
58
|
-
private migratePatterns;
|
|
59
|
-
/**
|
|
60
|
-
* Migrate captured experiences to learning domain
|
|
61
|
-
* These are stored in memory_entries for now, could be moved to QEUnifiedMemory
|
|
62
|
-
*/
|
|
63
|
-
private migrateCapturedExperiences;
|
|
64
|
-
/**
|
|
65
|
-
* Migrate learning experiences (RL data)
|
|
66
|
-
* Store as learning patterns for SONA integration
|
|
67
|
-
*/
|
|
68
|
-
private migrateLearningExperiences;
|
|
69
|
-
/**
|
|
70
|
-
* Migrate concept graph (nodes and edges) for code intelligence
|
|
71
|
-
*/
|
|
72
|
-
private migrateConceptGraph;
|
|
73
|
-
/**
|
|
74
|
-
* Validate migration results
|
|
75
|
-
*/
|
|
76
|
-
private validateMigration;
|
|
77
|
-
private mapV2DomainToV3;
|
|
78
|
-
private mapTaskTypeToDomain;
|
|
79
|
-
private inferPatternType;
|
|
80
|
-
private calculateTier;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Create and execute a V2 to V3 migration
|
|
84
|
-
*/
|
|
85
|
-
export declare function migrateV2ToV3(v2DbPath?: string, v3PatternsDbPath?: string, onProgress?: (progress: V2MigrationProgress) => void): Promise<V2MigrationResult>;
|
|
86
|
-
//# sourceMappingURL=v2-to-v3-migration.d.ts.map
|